API reference
POST /v1/messages — single-turn requests
Reference for the SubToAPI messages endpoint: request fields, model aliases, JSON mode, thinking budget and the normalized response with token usage.
Updated
One request in, one normalized answer out. Use this endpoint for classification, extraction, summaries, rewrites and any task that fits a single prompt.
Request body
Response
JSON mode
Set json_mode: true and describe the shape you want in the system prompt. The model is steered towards valid JSON; always parse defensively and retry on a parse error.
Extended thinking
For hard problems pass thinking_budget (tokens). The best and balanced tiers support it; fast ignores it. Larger budgets cost latency, so start around 2,000–4,000 and measure.
Limits
Text fields
500k chars
system / content · 500,000 chars each
Conversation messages
200
turns per /v1/conversation call
Tools
50
tool definitions per request
Request body
4 MB
/v1/* · 4,000,000 bytes
Frequently asked questions
- Can I stream the response?
- Yes — add
"stream": trueto the body and the endpoint answers with the same server-sent events as /v1/conversation/stream. - Where do token counts come from?
- They are reported by the provider for this exact request and stored as usage metadata, so the dashboard and your logs agree.