Choose a Chat Endpoint with the REST APIBeta
Pick between the Chat, Chat Stream, and Chat Completions endpoints when you call a published service.
Prerequisites
- You need a Haystack Platform API key. For details, see Generate API Keys.
- You need a published service. For details, see Connect to a Published Service.
Chat
Use Chat when your app sends a query and waits for the full answer. For conversational services, the platform appends prior turns from a search session. If you omit a search session ID, the platform creates a new session and returns it in the X-Search-Session-Id response header so you can reuse it on the next turn.
For request and response fields, see Chat.
Chat Stream
Use Chat Stream when your app should show the answer as it is generated. Search sessions group turns into a conversation, matching Chat. The response is an SSE stream of events such as text deltas, tool calls, reasoning, and the final result.
For the event schema and options, see Chat Stream.
Chat Completions
Use Chat Completions when you connect a tool that expects the OpenAI /chat/completions contract, such as an OpenAI SDK or an OpenAI-compatible chat client. It's a compatibility layer on top of the service. If you build your own app, use Chat Stream or Chat instead.
Chat Completions doesn't use search sessions. Your client sends the conversation history with each request. You identify the service with the model field in the form {workspace_name}/{deployment_id}. To list the model IDs you can call, use List Models. The platform stores each run in search history, so you can trace the query afterward.
Chat Completions doesn't support client-side tool calling: the platform ignores tools and tool_choice. If your service uses an Agent with its own tools, the Agent still runs them inside the service. To forward generation parameters such as temperature, see Passing Extra OpenAI Parameters Through Chat Completions.
For request and response fields, streaming, file references, and error codes, see Chat Completions.
Related Information
Was this page helpful?