system field and Anthropic-style message objects — and returns a response shaped to the Anthropic specification. This means you can run Claude models (and any other Piramyd-hosted model) through your existing Anthropic SDK integration by changing only the base_url.
Endpoint
Authentication
The Messages endpoint accepts both standard Piramyd bearer tokens and thex-api-key header used by the Anthropic SDK. Use whichever form your integration already expects.
Request Parameters
The model ID to use. Retrieve valid IDs from
GET /v1/models. Example: claude-opus-4.8.The conversation history as an array of message objects. Each object contains:
role—"user"or"assistant"content— a string, or an array of typed content blocks (e.g. text, image) for multimodal messages
system field instead.The system prompt. This is a top-level field in Anthropic format — not a message inside the
messages array.Maximum number of tokens to generate. This field is required in Anthropic format (unlike Chat Completions where it has a default). Set it explicitly to avoid unexpected truncation.
Sampling temperature between
0 and 1 (Anthropic range). Lower values produce more focused output.Set to
true to receive the response as a stream of Anthropic-format SSE events.Request Examples
Response Shape
The response follows the Anthropic Messages response format.Array of content blocks generated by the model. For standard text responses, this contains one block with
type: "text" and a text field.Why the model stopped generating:
"end_turn"— natural end of output"max_tokens"— hit themax_tokenslimit"tool_use"— the model is requesting a tool call
