Anthropic Messages
Use this endpoint when your client expects Anthropic’s Messages request and response shape, such as Claude-compatible SDKs or tools configured with a custom Anthropic base URL.
The request body, supported model values, streaming flag, top-level
system field, and optional tool fields are defined in the schema below.
Official protocol reference: Anthropic Messages API.
Errors use this endpoint’s protocol envelope and an HTTP error status, including failures rejected by the gateway. See Error handling for status codes, quota errors, and streaming failures.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Input messages. Alternating user / assistant turns.
The maximum number of tokens to generate before stopping. Required.
1024
A system prompt providing context and instructions, set at the top level.
"You are a helpful assistant."
If true, the response is streamed as Server-Sent Events.
Custom text sequences that will cause the model to stop generating. The generated text will not contain the stop sequence.
Optional Anthropic-compatible tool definitions. Support can vary by selected model and provider.
Controls tool use. Support can vary by selected model and provider.
Optional thinking/reasoning controls for models that support them. Support can vary by selected model and provider.
Response
Message result. When stream is true, the body is an SSE stream instead.