Skip to main content
POST /api/v1/converse streams one model turn over Server-Sent Events. You send the whole conversation every time, you supply the tool definitions, and you run any tool the model asks for. The platform stores no conversation and runs no tool. Use it when your application already owns conversation state and you want a metered model gateway. Use a Conversation instance when you want the platform to keep transcripts, run platform tools, enforce guardrails, and gate releases with evals. Credential: an organization API key, or a scoped key with conversations:use. The route uses the default org rate limit bucket and is exempt from the 30-second request timeout.

How it works

  1. You post messages (the whole history), optional system, optional tools, and optional model and max_tokens.
  2. The platform streams message_start, then text_delta frames and one tool_use frame per tool call the model makes, then message_end.
  3. If message_end.stop_reason is tool_use, you run the tools, append the assistant’s tool_use blocks and your tool_result blocks to messages, and post the whole conversation again.

Request

Content blocks: File and image blocks are not accepted on this route. The example below uses Harbor Group, a fictional company whose staff look up the review status of its suppliers. The tool runs in your application, not on the platform. Tool names use letters, digits, _, ., and -, must not contain __, and must be at most 64 characters where each . counts as two.

The stream

Headers and framing match the instance turn route: Content-Type: text/event-stream, one event: line and one data: line of JSON per frame, then a blank line.
stop_reason is end_turn for a finished answer, tool_use when the model wants tools run, and max_tokens when the output was cut off at max_tokens. Any other provider value passes through unchanged. usage has the same six fields as on instance turns; cached_input_tokens is filled by OpenAI models and is a subset of input_tokens, while cache_creation_input_tokens and cache_read_input_tokens are filled by Anthropic models.

Continue after a tool call

Append the assistant’s tool call and your result, then post everything again:

Errors

Before the first frame, errors use the JSON envelope. After it, the status is already 200 and the failure is a terminal error frame with code and message. This route does not include the provider failure reason that instance turns carry. A model call that fails transiently is attempted up to three times, with waits of at most 5 seconds, while nothing has been streamed. Once a frame is sent, a failure is final.

Metering

A completed call records one usage row for your org with the model and token counts, when the provider reports token usage. Stateless calls are not tied to any instance or conversation.

Conversations overview

When a managed instance fits better.

Converse (API reference)

The generated endpoint contract.
Last modified on September 25, 2026