OpenAI (GPT) Chat
Call the GPT series models via the OpenAI-compatible format.
Endpoint
POST $URL/v1/chat/completionsSupported Models
| Model | Positioning |
|---|---|
gpt-5.6-sol / gpt-5.6-luna / gpt-5.6-terra | Latest GPT-5.6 series |
gpt-5.5 / gpt-5.5-plus | GPT-5.5 series |
gpt-5.4 / gpt-5.4-pro / gpt-5.4-mini / gpt-5.4-nano | GPT-5.4 series |
gpt-5.3-codex | Code-specialized |
gpt-5.2 / gpt-5.2-chat / gpt-5.2-codex | GPT-5.2 series |
gpt-5 / gpt-5-mini / gpt-5-pro | GPT-5 series |
o3 / o3-mini | Reasoning series |
gpt-4.1 / gpt-4o | Classic versions |
More historical versions are available in the "Model Hub" section of the console.
Request Example
bash
curl $URL/v1/chat/completions \
-H "Authorization: Bearer $YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [
{"role": "user", "content": "Explain quantum computing in one sentence"}
]
}'python
from openai import OpenAI
client = OpenAI(api_key="YOUR_API_KEY", base_url="$URL/v1")
resp = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Explain quantum computing in one sentence"}],
)
print(resp.choices[0].message.content)ts
import OpenAI from 'openai'
const client = new OpenAI({
apiKey: process.env.YOUR_API_KEY,
baseURL: '$URL/v1',
})
const resp = await client.chat.completions.create({
model: 'gpt-4o',
messages: [{ role: 'user', content: 'Explain quantum computing in one sentence' }],
})
console.log(resp.choices[0].message.content)Main Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | One of the model names above |
messages | array | Yes | Conversation messages |
stream | boolean | No | Whether to stream the response |
temperature | number | No | 0–2 |
max_tokens | integer | No | Maximum tokens to generate |
Integration Methods
Method 1: OpenAI SDK (recommended)
Just replace base_url and api_key, zero-code migration.
Method 2: Direct HTTP
Any HTTP client can construct the request following the curl example above.
