Skip to main content
POST
cURL

Not supported

Responses are stateless. These return 400:
  • previous_response_id, and item_reference input items: send the history in input instead.
  • store: true and background: true.
There are no endpoints to retrieve, delete, or cancel a stored response, and no WebSocket transport. Disconnecting a request can still incur usage for generated tokens. See the SDK example for a multi-turn loop.

Reasoning

Set the effort with "reasoning": {"effort": "high"}. Levels a model doesn’t serve round up to the next one it does, and the response echoes the applied level in reasoning.effort. "effort": "none" turns thinking off; GLM-5.3 and GLM-5.3-Flash always think and return 400. max_output_tokens covers the reasoning and the answer. See how effort levels map.

Authorizations

Authorization
string
header
required

Bearer followed by an inference API key (sk-prl-infapi-). Create keys on the API Keys page. Management keys (sk-prl-mgmt-) cannot call models.

Body

application/json
model
string
required

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

input
required

A string, or an array of input items: messages, plus the output items earlier turns returned (reasoning, function calls) and your function_call_output items. Send the whole history each turn; item references are refused.

instructions
string

A system message for this request.

max_output_tokens
integer

Cap on generated tokens, reasoning included.

stream
boolean

Stream server-sent events instead of one JSON response.

store
enum<boolean>
default:false

Must be false or omitted (omitted is sent as false). Responses are stateless, so true returns 400.

Available options:
false
reasoning
object

{"effort": …}, one of none, minimal, low, medium, high, xhigh, max; see Reasoning.

tools
object[]

Function tools the model may call. Support varies by model.

temperature
number

Sampling parameter, as on chat completions.

top_p
number

Sampling parameter, as on chat completions.

Response

The completion, or an event stream when streaming.

id
string

Response ID.

object
enum<string>

Always response.

Available options:
response
created_at
integer

Unix timestamp (seconds).

status
enum<string>

completed, incomplete (stopped early, for example at max_output_tokens), or cancelled. Check it before using output.

Available options:
completed,
incomplete,
cancelled
model
string

The model that served the request.

output
object[]

Output items in order: reasoning models add a reasoning item, then a message with output_text content, or function_call items when the model calls tools. Replay them in the next turn's input.

usage
object

input_tokens and output_tokens, what you're billed on, with input_tokens_details.cached_tokens and output_tokens_details.reasoning_tokens when the model reports them.

reasoning
object

Levels a model doesn't serve round up to the next one it does, and the response echoes the applied level in reasoning.effort.