Skip to content
API referenceMessages (Anthropic)

Messages (Anthropic)

Anthropic Messages: capabilities of the selected model and server prompt.

Model protocol

POST /v1/messages uses one endpoint, header set and SDK configuration. Keys have no product modes. The capabilities below depend on the family, model and actual application of a Claude server prompt.

Endpoint-aware matrix

CapabilityClaude without a server promptClaude with an applied promptOpenAI endpoints
StreamingNative Anthropic SSE, including thinking and citation deltasText and client functions; no thinking/signature/citation deltasChat Completions and Responses use their own streaming events with and without a server prompt
Client functionsNative tool_usetool_resultThe same client cycle, including rich tool_result; the client executes the functionChat and Responses support client function calls; server tools do not run
Thinking / effortNative thinking blocks and signatures; output_config.effortthinking and output_config.effort are accepted and control depth; explicit thinking takes priority; separate signed thinking blocks/signatures are not returnedNative thinking blocks are outside the Chat/Responses contract
cache_controlExplicit breakpoints, 5m/1h, and cache tiersExplicit breakpoints, 5m/1h, and public cache tiers; a hit is not guaranteedExplicit cache_control is unsupported in Chat/Responses; automatic caching remains
Samplingtop_k, top_p, temperature on Opus 4.6, Sonnet 4.6 and Haiku 4.5. Opus 5, Opus 4.8, Opus 4.7, Sonnet 5, Fable 5 and Fable 5.1 do not accept these fields at all, so Guard removes them from the requestDepend on the model and thinking compatibility; disabling thinking alone does not guarantee samplingtop_p and temperature depend on the model and thinking; top_k is unsupported
PDF / documentsNative PDFs and text/content documentsBase64 PDFs and text/content documents in a user message or tool_resultChat/Responses do not accept PDFs; use Messages
CitationsNative document citations and citations_deltaUnsupportedUnsupported
VisionBase64 and direct public URLsBase64 in Messages; URL support is not promisedChat accepts base64; Responses input_image is unsupported
Structured outputsMessages: output_config.formatMessages: output_config.format; explicit thinking keeps format while conflicting effort is not appliedResponses structured text.format is unsupported
Web search / Web fetchNative Anthropic server toolsThe same native server tools in Anthropic MessagesOutside the Chat/Responses contract
ModelsIncluding Fable 5/5.1, Opus 4.5 and Sonnet 4.5Fable 5/5.1, Opus 4.5 and Sonnet 4.5 with an applicable prompt are rejected before billingFable 5/5.1 are available without actual server-prompt application

Basic request

python
import anthropic
client = anthropic.Anthropic(
    api_key=KEY,
    base_url="https://api.guardrelay.ai",
)
msg = client.messages.create(
    model="claude-opus-5",
    max_tokens=512,
    system="You are a concise assistant.",
    messages=[{"role": "user", "content": "Explain recursion in two sentences."}],
)
print(msg.content[0].text)

Kimi on this surface

Kimi works here and answers in the ordinary Anthropic shape. The address and the key are the ones every family uses: https://api.guardrelay.ai and the Authorization: Bearer gd-… header. The gateway picks the family from the exact id in the model field: k3, k3-256k, kimi-for-coding or kimi-for-coding-highspeed. Kimi needs no separate key and no separate address.

FieldWhat happens to it
modelthe exact id of one of the four Kimi models
messagesthe conversation in the Anthropic shape, roles user and assistant
max_tokensrequired, a positive integer; it also sets the output part of the money reserve
systema string or an array of content blocks
streamtrue turns on streaming
stop_sequences, temperature, top_p, top_kaccepted and passed upstream as sent
tools, tool_choiceclient functions: the model returns a call, your code runs it
thinkingthe Anthropic-shaped switch: exactly {"type": "enabled"}, optionally with budget_tokens; it works on all four models
output_configtakes effort and format inside
context_managementaccepted and passed upstream

The answer is an ordinary Anthropic object: id, the content array, stop_reason and usage. On k3 the content array carries a signed thinking block next to the text. A token pre-count works for Kimi too: this surface has its own count_tokens path, it answers with the input token count and takes the same fields except max_tokens, stream and the sampling parameters stop_sequences, temperature, top_p, top_k.

Claude Code on a Kimi model

Claude Code speaks exactly this protocol, so it runs on Kimi as well. Install it the usual way with npm i -g @anthropic-ai/claude-code, put the address and the key into environment variables, and name the model by its exact id at launch. Mac / Linux:

Environment variables
bash · macOS / Linux
export ANTHROPIC_BASE_URL="https://api.guardrelay.ai"
export ANTHROPIC_AUTH_TOKEN="gd-your-key-from-bot"

claude --model k3
PowerShell · Windows
$env:ANTHROPIC_BASE_URL = "https://api.guardrelay.ai"
$env:ANTHROPIC_AUTH_TOKEN = "gd-your-key-from-bot"

claude --model k3

Windows PowerShell:

powershell
$env:ANTHROPIC_BASE_URL = "https://api.guardrelay.ai"
$env:ANTHROPIC_AUTH_TOKEN = "gd-your-key-from-bot"
claude --model k3

Kimi, Composer and Grok on this endpoint

Kimi does serve this surface: the answer is an ordinary Anthropic one, and on k3 it carries a signed thinking block as well. Composer and Grok accept it too, but their contract is shorter than the Anthropic one.

CapabilityComposerGrok
Request fieldsmodel, messages, system, max_tokens, stream, tools; automatic tool_choice, output_config with effort only (ignored)same
Roles in messagesuser and assistant onlysame
System texttop-level system only; a system role inside messages is rejectedsame
Content blocktype and text; an additional cache_control is accepted and ignoredsame
Imagesno, 400 cursor_image_input_unavailableyes, inline base64
Client toolsyesyes
thinking, temperature, top_k, top_p, metadata, cache_controlAccepted and ignored; cache_control is block-levelsame
PDF, documents, citationsnono
A typed Anthropic tool — computer use, text editor, web search400 cursor_parameter_unavailable before any chargesame
Context window200K, estimate500K, measured
max_tokensup to 32,000; without the field the full 32,000 is reservedsame

The response is the ordinary Anthropic shape: a text block in content and stop_reason: "end_turn". If the model called one of your tools, tool_use blocks are added to content and stop_reason is tool_use — a turn you answer with a tool_result block. usage carries input_tokens, output_tokens and cache_read_input_tokens, while cache_creation_input_tokens is always 0: these models are not charged for cache writes.

bash
curl https://api.guardrelay.ai/v1/messages \
  -H "x-api-key: $GUARD_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "cursor-grok-4.6-high",
    "max_tokens": 256,
    "system": "Answer briefly.",
    "messages": [{"role": "user", "content": "Connection check"}]
  }'

A full function call

Tools are described the Anthropic way: a name, a description and an input_schema. The model returns a tool_use block and stop_reason: "tool_use", your client runs the function, and the result goes back as a tool_result block in a new message with the user role.

json
{
  "model": "cursor-grok-4.6-high",
  "max_tokens": 1024,
  "messages": [{"role": "user", "content": [{"type": "text", "text": "What is the weather in Moscow?"}]}],
  "tools": [{
    "name": "get_weather",
    "description": "Current weather in a city",
    "input_schema": {
      "type": "object",
      "properties": {"city": {"type": "string"}},
      "required": ["city"]
    }
  }]
}
json
{
  "role": "user",
  "content": [{
    "type": "tool_result",
    "tool_use_id": "toolu_01...",
    "content": "+7, clear"
  }]
}

Documentation sections

On this page