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.
Also reachable at /api/v1/chat/completions — the two paths are the same endpoint.
Request
Section titled “Request”| Parameter | Type | Description | |
|---|---|---|---|
model | string | Required | Model to run. Must be one returned by GET /v1/models. |
messages | array | Required | Conversation 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. |
stream | boolean | Optional | Stream the response as server-sent events. Defaults to false. |
temperature | number | Optional | Sampling temperature. Higher is more random. |
top_p | number | Optional | Nucleus sampling threshold. |
max_tokens | integer | Optional | Cap on tokens generated in the response. |
presence_penalty | number | Optional | Penalises tokens already present. |
frequency_penalty | number | Optional | Penalises tokens by how often they’ve appeared. |
response_format | object | Optional | {"type": "json_object"} or a json_schema, on models where json_output is true. |
tools | array | Optional | Tool definitions, if the model supports tool calling. |
tool_choice | string or object | Optional | Which tool the model may or must call. |
reasoning_effort | string | Optional | Controls 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.effort | string | Optional | Same thing, unified form. Cannot be combined with reasoning_effort. |
Example
Section titled “Example”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 }'Response
Section titled “Response”{ "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.
Streaming
Section titled “Streaming”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.
Timeouts
Section titled “Timeouts”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.
Errors
Section titled “Errors”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.