Query a Knowledge Base
Endpoints
Query a Knowledge Base
Send questions and receive answers with citations
POST
Query a Knowledge Base
Endpoint
Path Parameters
The unique identifier of the knowledge base to query.
Request Headers
Bearer token with your API key:
Bearer YOUR_API_KEYMust be
application/jsonRequest Body
The question or search query to send to the knowledge base.
Example Request
Response
The generated answer to your query based on the knowledge base content.
List of source documents that support the answer.
Number of tokens consumed by this query.
Example Response
Error Responses
| Status | Error | Description |
|---|---|---|
400 | invalid_query | Query is empty or malformed |
401 | unauthorized | Missing or invalid API key |
403 | forbidden | Key doesn’t have access to this KB |
429 | query_cap_exceeded | Monthly query limit reached |
429 | rate_limit_exceeded | Too many requests per minute |
500 | internal_error | Server error, retry later |
Next Steps
Rate Limits
Understand usage caps
Error Handling
Handle errors gracefully
(7).png?fit=max&auto=format&n=6FZsVQ5mPkveKHn2&q=85&s=46e497b52f808bab8589207e29abb2e1)
(6).png?fit=max&auto=format&n=3Dv90z8s7pwEMiZV&q=85&s=5b1b766bf867af4abce636e36c001b97)