Skip to content

Chat completions

The main inference endpoint on the Public Free Model APIs. It follows OpenAI’s chat completions schema. A dedicated endpoint serves the same path from your own vLLM or SGLang, and none of the request filtering below applies there.

POST /v1/chat/completions Bearer key or session

Also reachable at /api/v1/chat/completions — the two paths are the same endpoint.

ParameterTypeDescription
modelstringRequiredModel to run. Must be one returned by GET /v1/models.
messagesarrayRequiredConversation so far. Each item has a role (system, user, assistant, or tool) and content. Where a system message may sit differs per model — see below.
streambooleanOptionalStream the response as server-sent events. Defaults to false.
temperaturenumberOptionalSampling temperature. Higher is more random.
top_pnumberOptionalNucleus sampling threshold.
max_tokensintegerOptionalCap on tokens generated in the response.
presence_penaltynumberOptionalPenalises tokens already present.
frequency_penaltynumberOptionalPenalises tokens by how often they’ve appeared.
response_formatobjectOptional{"type": "json_object"} or a json_schema, on models where json_output is true.
toolsarrayOptionalTool definitions, if the model supports tool calling.
tool_choicestring or objectOptionalWhich tool the model may or must call.
reasoning_effortstringOptionalControls thinking length. Accepted tiers vary per model — see the table below; low and medium work everywhere. Whether omitting it disables thinking also varies per model.
reasoning.effortstringOptionalSame thing, unified form. Cannot be combined with reasoning_effort.
Terminal window
curl https://developer.amd.com.cn/radeon/api/v1/chat/completions \
-H "Authorization: Bearer $RADEON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "DeepSeek-V4-Flash",
"messages": [
{"role": "system", "content": "You are a concise assistant."},
{"role": "user", "content": "What is ROCm?"}
],
"temperature": 0.7,
"max_tokens": 256
}'
{
"id": "chatcmpl-8f3b21d0",
"object": "chat.completion",
"created": 1756108800,
"model": "DeepSeek-V4-Flash",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "ROCm is AMD's open software platform for GPU computing..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 24,
"completion_tokens": 118,
"total_tokens": 142
}
}

finish_reason is stop when the model finished on its own, length when it hit max_tokens, and tool_calls when it wants a tool invoked.

Reasoning models add reasoning_tokens to usage, and a prompt-cache hit adds usage.prompt_tokens_details.cached_tokens.

Set stream: true to receive server-sent events. Each event carries a delta rather than the whole message, and the stream ends with data: [DONE].

from openai import OpenAI
client = OpenAI(
base_url="https://developer.amd.com.cn/radeon/api/v1",
api_key="rc-...",
)
stream = client.chat.completions.create(
model="DeepSeek-V4-Flash",
messages=[{"role": "user", "content": "Explain ROCm in two sentences."}],
stream=True,
)
for chunk in stream:
delta = chunk.choices[0].delta.content
if delta:
print(delta, end="", flush=True)

Streaming responses aren’t buffered by the platform, so tokens arrive as the model produces them.

A non-streaming request can take up to 10 minutes before the platform gives up. When streaming, the same 10 minutes applies to the gap between chunks rather than to the whole generation. Long generations should stream, both so you see progress and so the connection stays active.

401 invalid key. 429 rate limited — see Rate limits. 502 or 503 the backend is unreachable or saturated; retry with backoff.

A model name that isn’t in the catalog is rejected by the gateway with 400 and Requested model <name> not supported — the request never reaches a backend. Errors the model itself raises, such as a context-length overflow, are passed through with the backend’s own status and message. See Errors for the response shapes.