BeLive Token Hub
API ReferenceChat

Claude (Anthropic-Compatible)

POST /v1/messages — Anthropic-native chat endpoint, works directly with the Claude SDK and Claude Code.

BeLive Studio provides an Anthropic-native Messages endpoint, usable with the official Anthropic SDK or by pointing tools like Claude Code at BeLive Studio.

Endpoint

POST https://api.tokenhub.belivestudios.com/v1/messages

Request Example

curl https://api.tokenhub.belivestudios.com/v1/messages \
  -H "x-api-key: sk-your-belive-studios-key" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-fable-5",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Auth header

Anthropic's native format uses the x-api-key header, which is the recommended form shown above. The platform compatibility layer also accepts Authorization: Bearer, but Anthropic SDK and Claude Code integrations should keep x-api-key and anthropic-version.

Important note

The example above does not explicitly send a thinking configuration, but the model may still return thinking content blocks based on its capabilities. For models that support manual extended thinking, thinking.type: "enabled" makes thinking tokens count toward the turn's max_tokens limit. Under Anthropic's compatibility rules, set budget_tokens to at least 1,024 and normally below max_tokens so the final answer has room. Manual-budget mode still works on Claude 4.6 but is deprecated; newer models that support adaptive thinking should use thinking.type: "adaptive".

Common request parameters

ParameterTypeRequiredDescription
modelstringyesModel ID, exactly as listed in the model list
max_tokensintegeryesMaximum output tokens for the turn; thinking content also counts toward this limit
messagesarrayyesConversation messages, commonly using the user and assistant roles
systemstring | arraynoSystem prompt; Anthropic's native format does not use a system role inside messages
temperaturenumbernoSampling temperature, usually 0–1; support depends on the model
top_pnumbernoNucleus-sampling parameter; normally avoid tuning it together with temperature
top_kintegernoLimits candidate tokens considered for sampling; support depends on the model
stop_sequencesarraynoCustom stop sequences; a match normally produces stop_reason: "stop_sequence"
streambooleannoWhether to return Server-Sent Events
thinkingobjectnoThinking configuration, such as manual enabled budgets or supported adaptive mode
toolsarraynoClient tool definitions; use only when tool calling is supported
tool_choiceobjectnoControls whether or how the model selects a tool

Parameter compatibility

Sampling parameters, thinking modes, and tool calling vary by Claude model version. Send only parameters supported by the selected model; some models restrict or ignore sampling parameters when thinking is enabled.

Extended thinking

The following Claude Opus 4.6 manual extended-thinking request was tested successfully on the platform, but this mode is deprecated on Claude 4.6. Prefer adaptive thinking for new integrations:

{
  "model": "claude-opus-4-6",
  "max_tokens": 4096,
  "thinking": {
    "type": "enabled",
    "budget_tokens": 2048
  },
  "messages": [
    {
      "role": "user",
      "content": "Analyze this problem and provide a solution"
    }
  ]
}

For models that support adaptive thinking, set thinking.type to "adaptive" and do not send budget_tokens at the same time; sending both causes a parameter error. The available thinking configuration depends on the model version.

Response fields

{
  "id": "msg_0123456789",
  "type": "message",
  "role": "assistant",
  "content": [
    {"type": "thinking", "thinking": "..."},
    {"type": "text", "text": "..."}
  ],
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 25,
    "output_tokens": 120,
    "output_tokens_details": {
      "thinking_tokens": 80
    }
  }
}

content may contain thinking and text blocks. Read each block according to its type, even when the request does not explicitly send a thinking configuration. stop_reason describes why generation ended, such as end_turn or max_tokens. usage.input_tokens and usage.output_tokens report input and output token counts, with thinking content included in output usage. When present, usage.output_tokens_details.thinking_tokens reports the thinking-token count.

FieldDescription
idUnique message identifier
typeObject type, message for a Messages response
roleResponse role, normally assistant
modelModel ID actually used
content[]Response content blocks, which may include text, thinking, and tool_use
content[].typeType of the current block; parse each block according to this field
stop_reasonWhy generation ended, such as end_turn, max_tokens, stop_sequence, or tool_use
stop_sequenceCustom stop sequence that was matched; normally null when none matched
usage.input_tokensInput-token count
usage.output_tokensOutput-token count, including thinking consumption when enabled
usage.output_tokens_details.thinking_tokensThinking-token count when the platform response provides this detail
usage.cache_creation_input_tokensInput tokens written to prompt cache; normally 0 when caching is unused
usage.cache_read_input_tokensInput tokens read from prompt cache; normally 0 on a cache miss

Python SDK

from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.tokenhub.belivestudios.com",
    api_key="sk-your-belive-studios-key",
)

msg = client.messages.create(
    model="claude-fable-5",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}],
)
text = "".join(
    block.text for block in msg.content
    if block.type == "text"
)
print(text)

Client Integration

Tools speaking the Anthropic protocol (Claude Code, CC Switch, etc.) can point their base URL at https://api.tokenhub.belivestudios.com (no /v1 — clients append the path themselves). See the Claude Code guide.

On this page