Anthropic Message API (Subscription)

This page documents the parameter support verified on the subscription channel. Models called with a subscription-channel API key must follow the parameter statuses documented here.

POST/messages

Call Claude through the native Anthropic Messages protocol. Parameter status comes from official documentation and HopsAPI/RelayPool tests.

Official parameters not supported on this channel: speed, diagnostics, fallbacks, fallback_credit_token, mcp_servers, top_k, top_p. Restricted: temperature (only 1 passes), inference_geo (organization type); output_format is deprecated (use output_config.format); cache_control is not a top-level parameter (place it inside messages[].content[], system, or tools[] blocks). See each parameter's entry in the table below for the exact rejection behaviour.

x-api-key<token>

HopsAPI API Key.

In: header

Header Parameters

ParameterTypeRequiredDefaultDescription
x-api-keystringRequired–

HopsAPI API Key.

ParameterTypeRequiredDefaultDescription
anthropic-versionstringOptional–

Recommended 2023-06-01. Omitted values succeeded in the 2026-08-25 HopsAPI retest; invalid-version validation is not guaranteed across gateway versions or accounts.

ParameterTypeRequiredDefaultDescription
anthropic-betastringOptional–

prompt-caching-2024-07-31 was verified.

ParameterTypeRequiredDefaultDescription
anthropic-user-profile-idstringOptional–

The request was accepted in the 2026-08-25 HopsAPI retest, but no observable evidence proved that user-profile attribution took effect. Do not rely on this capability without account confirmation.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

ParameterTypeRequiredDefaultDescription
modelstringRequired–

Model ID. Use an authorized ID returned by GET /v1/models.

max_tokensintegerRequired–

Maximum output tokens. Required — send a positive integer. Omitting it currently does not error on this channel, but the effective default is unknown and the behaviour is not guaranteed.

messagesarrayRequired–

User / assistant messages. Text, images, search results, tool calls, and tool results were verified. Document processing requires a real valid PDF to verify end-to-end.

messages[].rolestringConditional–

Values: "user" "assistant"

messages[].contentstring | arrayConditional–
messages[].content[].typestringOptional–

Values: "text" "image" "document" "search_result" "tool_use" "tool_result"

messages[].content[].textstringOptional–
messages[].content[].sourceobjectOptional–
messages[].content[].namestringOptional–
messages[].content[].inputobjectOptional–
systemstring | arrayOptional–

Top-level system prompt; do not put it in messages.

system[].typestringOptional–

Values: "text"

system[].textstringOptional–
streambooleanOptionalfalse

Whether to return SSE streaming events. In the 2026-08-25 HopsAPI retest true, false, and omission all eventually succeeded, but non-streaming requests showed intermittent 424 the same day; for stability prefer stream: true.

stop_sequencesarrayOptional–

Array of custom stop strings.

thinkingobjectOptional–

Extended thinking; enabled, disabled, and adaptive were verified.

thinking.typestringOptional–

Values: "enabled" "disabled" "adaptive"

thinking.budget_tokensintegerOptional–

Required when type is enabled; minimum 1024 (below 1024 returns 400 in testing). The official spec requires it to be less than max_tokens, but this channel does not enforce that: budget_tokens >= max_tokens still returns 200, with output truncated at max_tokens.

thinking.displaystringOptional–

Values: "summarized" "omitted"

toolsarrayOptional–

Client tool definitions. Strict schemas verified; the two-turn tool_result loop is verified on Claude Opus 5, while Claude Sonnet 5 has a known issue of returning 200 without using the tool result (tested 2026-08-18).

tools[].namestringConditional–
tools[].descriptionstringOptional–
tools[].input_schemaobjectConditional–

JSON Schema for tool input. For an object schema with strict=true, include additionalProperties=false.

tools[].strictbooleanOptional–
tool_choiceobjectOptional–

Tool selection object. A string such as auto is rejected; use {type: auto}, {type: any}, {type: tool, name: ...}, or {type: none}.

tool_choice.typestringConditional–

Values: "auto" "any" "tool" "none"

tool_choice.namestringOptional–
tool_choice.disable_parallel_tool_usebooleanOptional–
cache_controlobjectOptional–

Not a top-level parameter — sending it at the root has no effect. cache_control is a marker placed inside the block you want cached: a messages[].content[] block, a system block, or a tools[] entry. Prompt caching works on this channel: once a block is marked, repeated requests report cache_read_input_tokens in the response.

cache_control.typestringOptional–

Values: "ephemeral"

cache_control.ttlstringOptional–

Values: "5m" "1h"

context_managementobjectOptional–

Context management; the tested shape was successful.

metadataobjectOptional–

Anonymous request metadata; user_id was verified.

metadata.user_idstringOptional–
output_configobjectOptional–

JSON Schema structured output through output_config.format.

output_config.formatobjectOptional–
output_config.format.typestringOptional–

Values: "json_schema"

output_config.format.schemaobjectOptional–
service_tierstringOptional–

Service tier; auto and standard_only were verified.

Values: "auto" "standard_only"

speedstringOptional–

Unsupported: standard and fast return Extra inputs are not permitted.

diagnosticsobjectOptional–

Unsupported: returns Extra inputs are not permitted.

fallbacksarrayOptional–

Unsupported: returns Extra inputs are not permitted.

fallback_credit_tokenstringOptional–

Unsupported on the current path.

mcp_serversarrayOptional–

Unsupported: returns Extra inputs are not permitted.

inference_geostringOptional–

Account restricted: unsupported for this organization type.

output_formatobjectOptional–

Deprecated: use output_config.format.

top_kintegerOptional–

Unsupported for Claude Opus 5 on this channel: the upstream rejects the request with a deprecated error for this model. The parameter itself is still current in the official Anthropic API — the restriction is the model, not the protocol. Official use: sample from only the top K options for each subsequent token.

top_pnumberOptional–

Unsupported for Claude Opus 5 on this channel: the upstream rejects the request with a deprecated error for this model. The parameter itself is still current in the official Anthropic API — the restriction is the model, not the protocol. Official use: nucleus sampling, 0 to 1.

temperaturenumberOptional–

This channel rejects the parameter as deprecated for this model: temperature: 0 returns 400 (message: temperature is deprecated for this model.); only 1 (the default) passes. Omitting the field uses the model default.

containerobjectOptional–

Shape pending: a request containing expires_at was rejected, which does not prove every shape is unsupported.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/messages" \  -H "x-api-key: sk-YOUR_KEY" \  -H "anthropic-version: 2023-06-01" \  -H "anthropic-beta: prompt-caching-2024-07-31" \  -H "anthropic-user-profile-id: usr_example" \  -H "Content-Type: application/json" \  -d '{    "model": "claude-opus-5",    "max_tokens": 256,    "stream": true,    "messages": [      {        "role": "user",        "content": "Why is quicksort usually fast in Go?"      }    ]  }'
{  "id": "string",  "type": "message",  "role": "assistant",  "model": "string",  "content": [    {      "type": "string",      "text": "string",      "thinking": "string",      "signature": "string",      "id": "string",      "name": "string",      "input": {}    }  ],  "stop_reason": "string",  "stop_sequence": "string",  "usage": {    "input_tokens": 0,    "output_tokens": 0,    "cache_creation_input_tokens": 0,    "cache_creation": {      "ephemeral_1h_input_tokens": 0    },    "cache_read_input_tokens": 0  }}