Text Series
Claude
- Anthropic Claude models through the Anthropic Messages API, with OpenAI-compatible Chat Completions compatibility.
- Primary endpoint
POST /v1/messages(https://api.apiko.app/v1/messages). The model list below is generated from the published Claude catalog.
POST
Authorization
Use either x-api-key with anthropic-version, or Authorization: Bearer.
Send your API key in the Anthropic header
x-api-key: <API_KEY>.Bearer authentication is also accepted:
Authorization: Bearer <API_KEY>.With x-api-key, send
2023-06-01; Bearer authentication is also accepted.Request body
application/json
model
enum<string>required
Claude model id. Use an id returned by the catalog.
Available options:
claude-fable-5, claude-fable-5-1, claude-fable-5-2, claude-haiku-4-5, claude-haiku-5-5, claude-opus-4-6, claude-opus-4-7, claude-opus-4-8, claude-opus-5, claude-opus-5-5, claude-sonnet-4-6, claude-sonnet-5, claude-sonnet-5-5Example:
"claude-sonnet-5-5"max_tokens
integerrequired
Required maximum output token count. Thinking tokens count toward it; with
high or above, leave room for the answer. When this limit is reached, the response is truncated. APIKO lowers values above 32,000 to 32,000 (16,000 during the free trial).messages
object[]required
Required conversation turns, each with a role and content.
system
string|object[]
Optional system instruction that guides the assistant.
stream
booleandefault:false
Set to true to receive the response as Server-Sent Events.
temperature
numberrange:0–1
Controls randomness; use a value from 0 through 1.
top_p
numberrange:0–1
Controls nucleus sampling; use it instead of changing temperature when needed.
top_k
integer
Limits sampling to the top K candidate tokens.
stop_sequences
string[]
Stops generation when one of the supplied strings is reached.
thinking
object
Controls extended thinking. Send an object, as supported by the model:
{"type": "disabled"}, {"type": "adaptive"}, or {"type": "enabled", "budget_tokens": N}. A string such as "disabled" returns HTTP 400.tools
object[]
Declares tools the assistant may call, including each tool name, description, and input schema.
tool_choice
object
Controls tool selection with auto, any, or a named tool.
output_config
object
output_config.effort sets the reasoning level: low, medium, high, xhigh or max. high and above think first. Lower levels think less and often return no visible thinking, but any thinking is still billed as output tokens. Which levels a model offers is shown on its page in the model catalog; values outside that list are not rejected but have no guaranteed effect.Model limitations
claude-opus-5-5 thinking
adaptive
claude-opus-5-5 accepts every thinking value but manages thinking itself: thinking: disabled can still return thinking blocks, and thinking: enabled with budget_tokens can return none. Use thinking: adaptive when you need thinking output.claude-haiku-4-5
systemstop_sequencesreasoning_effort
claude-haiku-4-5: system, stop_sequences and reasoning_effort are currently not guaranteed to take effect on every request. Check the reply before relying on them.Response
200 - application/json
id
string
Message id for this response.
type
"message"
The response type is message.
role
"assistant"
The generated response role is assistant.
content
object[]
Content blocks can be text, thinking, or tool_use.
model
string
The model id that handled the request.
stop_reason
string|null
Why generation stopped, such as end_turn or max_tokens.
stop_sequence
string|null
The matching stop sequence, when one ended generation.
usage
object
Token counts include input_tokens, cache_creation_input_tokens, cache_read_input_tokens, and output_tokens.
stream_events
SSE event sequence
Typical order: message_start, content_block_start, content_block_delta, content_block_stop, message_delta (with stop_reason and usage), message_stop.
ping can arrive at any point, and a response can contain several content blocks (for example thinking, then text); handle each event by its type, not its position.Errors
HTTP status / error.type
POST /v1/messages errors carry error.type and error.message, with no error.code. On Chat Completions the same errors carry error.code, for example insufficient_user_quota (403) or model_not_found (404).
400
error.type
invalid_request_error — the request is invalid, for example a required field is missing or a value has the wrong type. Fix the request instead of retrying it.401
error.type
authentication_error — the API key is missing or invalid.403
error.type
permission_error — for example insufficient balance (insufficient_user_quota on Chat Completions). Add credit before retrying.404
error.type
not_found_error with No available channel for model … (model_not_found on Chat Completions): the model id is wrong or the model was retired. This is not a temporary outage — do not retry; check the id with GET /v1/models.503
error.type
The same message with 503: the model exists but none of its routes can take the request right now. Retry later with exponential backoff, or pick another model.
Chat Completions compatibility
POST /v1/chat/completions
OpenAI-compatible
The existing OpenAI-compatible Chat Completions interface remains available for Claude models.
stream
boolean
For Chat Completions streaming, add stream_options.include_usage to receive usage in the final chunk before data: [DONE].
reasoning_effort
enum<string>
Reasoning level for Claude on Chat Completions:
none, minimal, low, medium, high, xhigh or max; any other value returns HTTP 400. It is converted to the Claude thinking settings: high and above think first and return the thinking in message.reasoning_content. Lower levels think less and usually return no reasoning_content, but any thinking is still billed as output tokens and included in usage.completion_tokens, even though completion_tokens_details.reasoning_tokens reports 0. claude-haiku-4-5 uses a thinking budget instead of effort levels, so it can think even at low; with reasoning_effort a small max_tokens is raised by the gateway, so output and cost can exceed the max_tokens you sent. Its reasoning_effort is not guaranteed to take effect (see Model limitations).