Crun Anthropic Messages API
Anthropic-compatible /messages endpoint for CRUN language models, supporting Claude-style messages, system prompts, vision content blocks, tools, thinking, and streaming events.
API Endpoint
Authentication
You can authenticate with either:Authorization: Bearer YOUR_API_KEYX-API-KEY: YOUR_API_KEY
anthropic-version and anthropic-beta are accepted and forwarded upstream when provided.
Basic Message
System Prompt
Anthropic Messages uses a top-levelsystem field instead of a system role in the messages array.
Conversation History
CRUN does not store conversation state for/messages. To continue a conversation, include the prior user and assistant turns in the next request.
Vision Input
When the selected model supports vision, pass a content array withtext and image blocks. Image sources can use a URL/file source.
Tool Use
Passtools to let the model request structured function calls. Your application executes the tool and sends the result back in a follow-up message.
Thinking
When supported by the selected model and upstream provider, usethinking to request extended reasoning behavior.
Streaming
Setstream=true to receive Anthropic-style Server-Sent Events.
Response Examples
Notes
max_tokensis capped by the selected model’s output token limit when configured in CRUN.messagesonly supportsuserandassistantroles. Use the top-levelsystemfield for system instructions.- Additional Anthropic-compatible fields are accepted and passed through when supported by the upstream model.
- Tool use, thinking, image blocks, URL sources, and beta features depend on the selected model and upstream provider.
- Unknown model IDs return an OpenAI-style error body with
code: "model_not_found".
Related Resources
LLM Quickstart
OpenAI Responses API
Pricing
Authorizations
Use your CRUN API key as a Bearer token for Anthropic-compatible SDKs.
Headers
Optional Anthropic API version header forwarded upstream.
"2023-06-01"
Optional Anthropic beta feature header forwarded upstream.
Body
Anthropic-compatible Messages request. Additional compatible fields are accepted and passed through when supported by the upstream model.
Public model ID returned by GET /api/v1/models.
1"claude-sonnet-4-6"
Conversation messages. Include previous user and assistant turns yourself to continue a multi-turn conversation.
1Maximum output tokens. Capped by the selected model.
x >= 11024
System prompt. Anthropic Messages uses a top-level system field.
"You are a concise assistant."
Whether to return a Server-Sent Events stream.
false
List of stop sequences.
["END"]Sampling temperature.
0 <= x <= 10.7
Nucleus sampling value.
0 <= x <= 11
Top-k sampling value.
x >= 040
Developer-defined metadata.
Anthropic tool definitions. Your application executes tool calls and returns tool results in a follow-up request.
Tool selection strategy.
"auto"
Extended thinking configuration when supported by the upstream model.
{ "type": "enabled", "budget_tokens": 1024 }Response
Successful response. Returns JSON when stream=false, or SSE when stream=true.
