Create a response (streaming)
This method uses Jockey to reason over content in a knowledge store and create a response. It uses Open Responses conventions for input items and streaming events.
Before you use this method, you must create an asset, create a knowledge store, and add the asset to the knowledge store as an item.
Multi-turn conversations: Supported via a session identifier. The first request implicitly creates a session; subsequent requests pass the returned identifier to continue the conversation.
Selections: By default, Jockey reasons over every item in the knowledge store. To narrow the scope, set the optional selections parameter to specific items or item collections, then reference each one with a {{sel:N}} token in the content field of an input item (N is the zero-based position in the selections array). The narrowing is applied at the prompt level; the knowledge store does not block access to other items.
Streaming: Set the stream parameter to true to receive the response as Server-Sent Events (SSE). The reply streams in as a sequence of typed events and ends with a data: [DONE] message.
Example response
Example streamed response (SSE)
Authentication
Your API key.
You can find your API key on the API Keys page.
Request
When true, the response is returned as Server-Sent Events (SSE).
The session identifier for a multi-turn conversation. Pass the session identifier returned from a previous response to continue that conversation. Omit to start a new session.
When provided, the knowledge_store_id field must match the knowledge store the session
was originally created against, or the request returns 400.
Additional guidance for Jockey, acting as a per-request system prompt.
Additional items to include in the response's output array. By default, the output array contains only Jockey's final reply.
Values:
intermediate_outputs: Also includes the steps Jockey took to produce the reply.
Restricts the request to specific knowledge store items or item collections. The restriction is applied at the prompt level; the knowledge store does not block access to other items. Treat it as a strong preference, not a hard access boundary. Omit to run against every item.
Selections persist in the session context, and selections sent on later turns are added to that context. You can reference selections from earlier turns in natural language without repeating their {{sel:N}} tokens.
Response
Wraps a response object. Emitted for response.created, response.in_progress,
response.completed, and response.failed events.
Wraps a response object. Emitted for response.created, response.in_progress,
response.completed, and response.failed events.
Wraps a response object. Emitted for response.created, response.in_progress,
response.completed, and response.failed events.
Wraps a response object. Emitted for response.created, response.in_progress,
response.completed, and response.failed events.
A heartbeat frame the server sends about every 10 seconds when no other event has been emitted, for example while a tool call is still running. It carries no response data. Use it to keep the connection alive and to detect stalled streams; otherwise you can ignore it.
sequence_number uses the same counter as all other event types. If you
skip keepalive frames, the numbers you see will have gaps; these gaps do
not mean events were dropped.