Skip to main content

ChatCompletions Format

Creates a model response based on conversation history. Supports streaming and non-streaming responses.

Compatible with OpenAI Chat Completions API.

Try It

POST/v1/chat/completionshttps://api-platform.ope.ai

Authentication

Uses Bearer Token authentication.

  • Header: Authorization: Bearer <token>
  • Example: Authorization: Bearer sk-xxxxxx

Request body (application/json)

The following fields are referenced for compatibility with OpenAI Chat Completions API; you can adjust based on OPEAI Platform's actual support scope.

FieldTypeRequiredDescriptionDefault / Range
modelstringYesModel ID-
messagesarray<object>YesConversation message list-
temperaturenumberNoSampling temperatureDefault 1; Range 0~2
top_pnumberNoNucleus sampling parameterDefault 1; Range 0~1
nintegerNoNumber of completions to generateDefault 1; Range >=1
streambooleanNoWhether to stream responsesDefault false
stream_optionsobjectNoStreaming parameters-
stopstring | array<string>NoStop sequences-
max_tokensintegerNoMaximum number of tokens to generate-
max_completion_tokensintegerNoMaximum completion tokens-
presence_penaltynumberNoPresence penaltyDefault 0; Range -2~2
frequency_penaltynumberNoFrequency penaltyDefault 0; Range -2~2
logit_biasobjectNoLogit bias-
userstringNoEnd-user identifier-
toolsarray<object>NoTools list-
tool_choicestring | objectNoTool choice strategy-
response_formatobjectNoResponse format-
seedintegerNoRandom seed-
reasoning_effort"low" | "medium" | "high"NoReasoning effort (for models that support reasoning)-
modalitiesarray<string>NoOutput modalities-
audioobjectNoAudio output configuration-

Request examples

The domain below is an example: https://api-platform.ope.ai.

curl -X POST "https://api-platform.ope.ai/v1/chat/completions" \
-H "Authorization: Bearer $OPEAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "DeepSeek-V3.2",
"messages": [
{
"role": "user",
"content": "hello"
}
]
}'

Response examples

{
"id": "string",
"object": "chat.completion",
"created": 0,
"model": "string",
"choices": [
{
"index": 0,
"message": {
"role": "system",
"content": "string",
"name": "string",
"tool_calls": [
{
"id": "string",
"type": "function",
"function": { "name": "string", "arguments": "string" }
}
],
"tool_call_id": "string",
"reasoning_content": "string"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0,
"prompt_tokens_details": {
"cached_tokens": 0,
"text_tokens": 0,
"audio_tokens": 0,
"image_tokens": 0
},
"completion_tokens_details": {
"text_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0
}
},
"system_fingerprint": "string"
}