Generate an AI response grounded in your documents. Retrieves relevant chunks from the specified vector stores and uses them as context for the LLM (Retrieval-Augmented Generation).
POST
/responses
Authorization
AuthorizationRequiredBearer <token>
In: header
Request Body
application/jsonRequiredmodelstring
The model to use for generating the response.
Default:
"solar-pro4"inputRequiredstring | array<object>
The user's question or input.
toolsRequiredarray<object>
List of tools. Use the file_search type for RAG.
streamboolean
Enable streaming for real-time responses.
Default:
falseinstructionsstring
System instructions to guide the LLM's behavior.
Example
Non-streaming request
Non-streaming response
Streaming request
Set stream=True to receive Server-Sent Events (SSE) in real-time.
SSE event types
| Event | Description |
|---|---|
response.created | Response object created. |
file_search_call.searching | File search is in progress. |
file_search_call.completed | File search completed with results. |
output_text.delta | Incremental text chunk from the LLM. |
output_text.done | LLM text generation completed. |
response.completed | Full response completed. |
[DONE] | Final signal indicating the stream has ended. |