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
string
required
The model ID to use. Retrieve valid IDs from
GET /v1/models. Example: claude-opus-4.8.array
required
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.string
The system prompt. This is a top-level field in Anthropic format — not a message inside the
messages array.integer
required
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.
float
Sampling temperature between
0 and 1 (Anthropic range). Lower values produce more focused output.boolean
default:"false"
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.string
Unique identifier for this message, prefixed with
msg_.string
Always
"message".string
Always
"assistant".array
Array of content blocks generated by the model. For standard text responses, this contains one block with
type: "text" and a text field.string
The exact model ID that generated the response.
string
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
object
Token counts for this request.
