API reference
POST /v1/conversation — multi-turn chat
Send the whole thread each time: alternating user and assistant turns, content blocks, temperature and tools. Reference and examples for the SubToAPI conversation endpoint.
Updated
The conversation endpoint is stateless: you send the full history with every call and get the next assistant turn back. That keeps your data in your hands and makes retries trivial.
Request body
Content blocks
content may be a plain string or an array of blocks. Text blocks are { "type": "text", "text": "…" }; assistant turns can contain tool_use blocks and user turns can carry tool_result blocks — see tool use.
Response
Same shape as /v1/messages: content blocks, usage, latency_ms, model, provider, request_id and stop_reason.
Keep threads lean
Long histories cost input tokens on every call. Summarise older turns into the system prompt once a thread grows; the limit is 200 messages per request.
Frequently asked questions
- Do I have to alternate user and assistant turns?
- Yes. Start with a user message and alternate; two user messages in a row are rejected with
422 invalid_request. - Can I set temperature?
- Yes,
temperaturebetween 0 and 1. Lower values are more deterministic; omit it for the provider default.