Skip to main content
POST

Authorizations

x-api-key
string
header
required

Tikway API Key. Passed through the x-api-key request header according to the Anthropic native protocol.

Body

application/json
model
string
required

The Claude model ID used to generate the message, for example claude-opus-5.

max_tokens
integer
required

The maximum number of tokens to generate content. The model can be stopped before reaching the upper limit; set to 0 to only warm up the prompt cache without generating a reply.

Required range: x >= 0
messages
object[]
required

Enter the conversation message. The model works in user and assistant turns; consecutive messages with the same role will be merged. If there is no system role, please use the top-level system for system prompt words.

Maximum array length: 100000
system

System prompt word. The Messages API does not support system role messages, this field should be used.

stream
boolean

Whether to stream message events as Server-Sent Events.

stop_sequences
string[]

Customize stop sequence; model generation stops when it reaches any sequence.

temperature
number

Sampling temperature. Higher values ​​make the output more random; usually adjusted with top_p, top_k.

Required range: 0 <= x <= 1
top_p
number

Kernel sampling threshold.

Required range: 0 <= x <= 1
top_k
integer

The number of candidate tokens with the highest probability retained during each sampling step.

Required range: x >= 0
thinking
Enabled thinking · object

Extended thinking configuration. Optional enabled, adaptive, disabled, or passed in null. When think is enabled, think tokens count toward max_tokens.

tools
object[]

A tool definition that can be called by Claude.

tool_choice
object

Controls whether and how Claude selects tools.

output_config
object

Output configuration.

output_format
object

JSON output format configuration.

metadata
object

Request metadata.

service_tier
enum<string>

Service level selection.

Available options:
auto,
standard_only
speed
enum<string>

Inference speed mode.

Available options:
standard,
fast
container

Code execution container configuration or container ID.

context_management
object

Context management configuration.

mcp_servers
object[]

MCP server definition.

cache_control
object

Request-level prompt word cache control.

diagnostics
object

Diagnostic information configuration.

fallback_credit_token

Fallback service deduction token.

fallbacks
object

Model fallback configuration.

inference_geo
string

Reasoning about geographic preferences.

Response

200 - application/json
id
string
required

Message unique ID.

type
enum<string>
required

Object type, fixed to message.

Available options:
message
role
enum<string>
required

Message role, fixed to assistant.

Available options:
assistant
model
string
required

The actual Claude model ID used.

content
object[]
required

List of content blocks generated by Claude.

stop_reason
enum<string>
required

Generate a stop reason.

Available options:
end_turn,
max_tokens,
stop_sequence,
tool_use,
pause_turn,
refusal,
model_context_window_exceeded
usage
object
required

Billing and current limiting word usage statistics.

stop_sequence
string

If the sequence ends due to a custom stop, it is a hit sequence.

stop_details
object

Structured information for rejection and other stopping situations.

container
object

Code execution container information.

context_management
object

Context management results of server-side applications.

diagnostics
object

Diagnostic information, such as cache miss reasons.

input_transformations
object[]

Transformations applied by the API to the input, such as chunks of thought that are discarded.