curl --request POST \
--url https://api.octen.ai/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "anthropic/claude-opus-4.8",
"max_tokens": 2048,
"messages": [
{
"role": "user",
"content": "Explain attention in one sentence."
}
]
}
'{
"id": "msg_01XFDUDYJgAACzvnptvVoYEL",
"type": "message",
"role": "assistant",
"model": "anthropic/claude-opus-4.8",
"content": [
{
"type": "text",
"text": "Attention lets a model dynamically weight its inputs and focus on the most relevant information."
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 18,
"output_tokens": 32
}
}LLM Chat (Anthropic-Compatible)
Compatible with the Anthropic Messages protocol, with optional built-in octen_broad_search and octen_search tools.
curl --request POST \
--url https://api.octen.ai/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "anthropic/claude-opus-4.8",
"max_tokens": 2048,
"messages": [
{
"role": "user",
"content": "Explain attention in one sentence."
}
]
}
'{
"id": "msg_01XFDUDYJgAACzvnptvVoYEL",
"type": "message",
"role": "assistant",
"model": "anthropic/claude-opus-4.8",
"content": [
{
"type": "text",
"text": "Attention lets a model dynamically weight its inputs and focus on the most relevant information."
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 18,
"output_tokens": 32
}
}Authorizations
Bearer token used for request authentication. Alternatively, you can send the API key in the x-api-key header. Note: A payment method is required to use the API.
Headers
Anthropic protocol version, e.g. 2023-06-01. Sent automatically by the Anthropic SDK. Defaults to 2023-06-01 if omitted.
Body
Request body for the Messages API. Some parameters apply only to certain models; unsupported parameters are ignored.
The model to use. Anthropic models also accept their native ids (e.g. claude-opus-4-8), which map to anthropic/claude-opus-4.8.
openai/gpt-6-astra, openai/gpt-5.6-sol, openai/gpt-5.6-terra, openai/gpt-5.6-luna, openai/gpt-5.5-pro, openai/gpt-5.5, openai/gpt-5.4, anthropic/claude-fable-5.1, anthropic/claude-fable-5, anthropic/claude-opus-5, anthropic/claude-opus-4.8, anthropic/claude-opus-4.6, anthropic/claude-sonnet-5, anthropic/claude-sonnet-4.6, anthropic/claude-haiku-4.5, google/gemini-3.8-flash, google/gemini-3.5-flash, google/gemini-3.5-flash-lite, google/gemini-3.1-pro-preview, google/gemini-3.1-flash-lite, google/gemini-3-flash-preview, moonshotai/kimi-k3, moonshotai/kimi-k2.6, moonshotai/kimi-k2.5, minimax/minimax-m2.5, qwen/qwen3.6-plus, deepseek/deepseek-v4-pro, deepseek/deepseek-v4-flash-0731 Maximum number of tokens to generate, including thinking and visible output tokens.
x >= 1The conversation so far, in chronological order.
Show child attributes
Show child attributes
System prompt. A plain string or an array of text blocks supporting cache_control.
A tool definition. One of a custom tool, the built-in octen_broad_search tool, or the octen_search tool.
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
Controls whether and how the model calls tools.
Show child attributes
Show child attributes
Whether to enable streaming output.
Controls randomness.
0 <= x <= 1Nucleus sampling. If unset, no nucleus truncation is applied. Set only one of temperature and top_p.
x <= 1Sample only from the top K tokens. If unset, top-k filtering is disabled.
x >= 0Stop sequences.
Thinking options for reasoning models.
Show child attributes
Show child attributes
Request metadata.
Show child attributes
Show child attributes
Controls how the model produces its output.
Show child attributes
Show child attributes
Top-level prompt caching marker. Sets a cache breakpoint on the last cacheable content block in the request, equivalent to setting cache_control on that block directly.
Show child attributes
Show child attributes
Response
Successful message response. When stream=false, returns a single message object. When stream=true, returns an Anthropic SSE event stream.
- Option 1
- Option 2
A non-streaming response. Returned when stream=false.
The unique identifier for this request.
The response type. message on success.
message, error Always assistant.
assistant The model used for this response.
The response content, as a list of content blocks.
Show child attributes
Show child attributes
Why the model stopped.
end_turn, max_tokens, stop_sequence, tool_use, pause_turn, refusal Token usage information.
Show child attributes
Show child attributes
Additional detail about why the model stopped. Returned only when stop_reason is refusal.
Show child attributes
Show child attributes
The stop sequence that was hit, or null.
Was this page helpful?