Skip to main content
POST
cURL
Set the Anthropic SDK base URL to https://inference.pearlresearch.ai; the SDK adds the versioned path. Use the regional endpoint shown on Integrations. Errors use Anthropic’s shape, with the request ID in the body and in a request-id header; see the Inference API overview.

Reasoning

Set the effort with "output_config": {"effort": "high"} (in the Python SDK, via extra_body). Levels a model doesn’t serve round up to the next one it does, as on the other formats. Send "thinking": {"type": "disabled"} to turn thinking off; GLM-5.3 and GLM-5.3-Flash always think and return 400. Bound thinking with the effort or max_tokens, which covers the thinking and the answer. See how effort levels map.

Authorizations

x-api-key
string
header
required

Your inference API key. Send this or Authorization; if you send both, they must carry the same key.

Headers

anthropic-version
string
required

One value, for example 2023-06-01. Missing returns 400.

Example:

"2023-06-01"

Body

application/json
model
string
required

A chat model ID from GET /models. A model that doesn't serve Messages returns 404.

max_tokens
integer
required

Cap on generated tokens, thinking included.

messages
object[]
required

The conversation, alternating user and assistant turns. Content is a string or an array of blocks; replay returned thinking and tool_use blocks, and answer each tool use with a tool_result block carrying its ID.

system

The system prompt.

stream
boolean

Stream named server-sent events, see the text/event-stream response below.

output_config
object

{"effort": …}, the reasoning effort; see Reasoning.

thinking
object

{"type": "disabled"} turns thinking off. Thinking budgets (budget_tokens) are not supported by any model today and return 400.

tools
object[]

Tool definitions. Support varies by model.

tool_choice
object

The choice policy. Support varies by model.

temperature
number

Sampling parameter.

top_p
number

Sampling parameter.

top_k
number

Sampling parameter.

stop_sequences
string[]

Custom stop sequences.

Response

The completion, or an event stream when streaming.

id
string

Message ID.

type
enum<string>

Always message.

Available options:
message
role
enum<string>

Always assistant.

Available options:
assistant
content
object[]

Content blocks: text, thinking on reasoning models, and tool_use when the model calls a tool.

model
string

The model that served the request.

stop_reason
string

Why generation stopped, for example end_turn, max_tokens, stop_sequence, or tool_use.

stop_sequence
string | null

The stop sequence that matched, if any.

usage
object

input_tokens and output_tokens, what you're billed on, plus cache_read_input_tokens when the model reports cache reads.