Skip to main content
POST
/
v1
/
chat
/
completions
curl --request POST \
  --url https://api.powertokens.ai/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "qwen3.6-plus",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant."
    },
    {
      "role": "user",
      "content": "Hello, please introduce yourself."
    }
  ],
  "temperature": 0.7,
  "max_tokens": 2000
}
'
{
  "id": "<string>",
  "object": "chat.completion",
  "created": 123,
  "model": "<string>",
  "choices": [
    {
      "index": 123,
      "message": {
        "role": "system",
        "content": "<string>",
        "tool_calls": [
          {}
        ]
      },
      "finish_reason": "<string>"
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
enum<string>
required

Model name. Only the public chat models in the final Ali whitelist are supported.

Available options:
qwen3-max,
qwen3.6-plus,
qwen3.5-flash,
qwen3-coder-plus,
deepseek-v3.2
Example:

"qwen3.6-plus"

messages
object[]
required

List of conversation messages. Supports text content and multimodal content (image+text).

stream
boolean
default:false

Whether to use streaming output. Default is false.

temperature
number
default:0.7

Sampling temperature, controls output randomness. Range [0, 2].

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

Nucleus sampling probability threshold.

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

Maximum number of tokens to generate.

Required range: x >= 1
stop
string[]

List of stop sequences.

seed
integer

Random seed for reproducible generation.

tools
object[]

List of tools for Function Calling.

tool_choice
string

Tool selection strategy. Options: auto, none, required.

Whether to enable search enhancement. Only some models support this.

response_format
object

Response format for forcing JSON output.

Response

Success, returns chat completion result. Streaming mode returns SSE stream.

id
string

Response unique identifier.

object
string
Example:

"chat.completion"

created
integer<int64>

Unix timestamp of creation time (seconds).

model
string

Model name used.

choices
object[]
usage
object