Results, Pagination, and Streaming

The Genesis /responses endpoint follows the OpenAI Responses style. Chat Completions, Embeddings, Rerank, and Messages retain their own result structures. Parse the business result according to the endpoint, while consistently recording usage, latency, and error status.

Responses endpoint

POST /responses supports stateless calls. For models connected to a stateful channel, the console integration material also lists store, previous_response_id, Conversations, and retrieve, delete, and input-items operations. These are not shared capabilities of every model. Select the target model on the Use page and copy its current example before adding stateful fields.

A minimal request normally identifies a model and supplies input, but input parts and output items vary with model capability. Treat the console-generated request body as the current contract. Business content is returned in native Responses fields such as output[], not in the Chat Completions choices[] structure.

Result locations

Endpoint

Primary result

Chat Completions

choices[].message.content

Responses

output[]

Messages

content[]

Embeddings

data[].embedding

Rerank

results[]

Models

data[]

Use usage for reconciliation. One ecosystem can report prompt_tokens / completion_tokens, while another reports input_tokens / output_tokens. Read fields that are present instead of calculating billing from absent fields.

Pagination and batched results

The arrays returned by /embeddings and /rerank are batch results for one request, not paginated collections. /models currently returns available models in data[]; any cursor or additional pages must come from the live response. Continue pagination only when a response explicitly supplies a next-page marker. Do not invent undocumented page or offset parameters.

Handle an SSE stream

When an endpoint supports streaming, setting stream: true returns incremental Server-Sent Events. An OpenAI-style stream commonly contains multiple data: events and ends with data: [DONE]. Messages emits native Anthropic events and a native termination event.

A streaming client should:

  1. verify a successful HTTP status before parsing events;

  2. split SSE events on blank lines and retain incomplete lines across network chunks;

  3. merge deltas in the endpoint’s native format instead of treating each event as a complete response;

  4. stop on [DONE], the native termination event, or a normal connection close;

  5. record usage from the final event when present, otherwise reconcile with Genesis Logs and Usage.

Once a request has emitted output, automatic retries can duplicate content and usage. Retry an interrupted stream only when the application can identify and deduplicate requests. For backoff behavior on 429 and 5xx, see Error Codes.