Chat Completions format
Create a model response from the conversation history. Streaming and non-streaming are both supported.
Compatible with the OpenAI Chat Completions API.
Request Body
application/json
Model ID
Conversation messages, in chronological order
Sampling temperature
10 <= value <= 2Nucleus sampling parameter
10 <= value <= 1Number of results to generate
11 <= valueWhether to stream the response
falseStreaming options
Stop sequences
Maximum tokens to generate
Maximum completion tokens
Presence penalty, -2.0–2.0. Positive values push the model toward new topics
0-2 <= value <= 2Frequency penalty, -2.0–2.0. Positive values reduce repeated wording
0-2 <= value <= 2Bias map adjusting the likelihood of specific tokens, keyed by token ID
End-user identifier for abuse tracing (OpenAI now recommends safety_identifier instead)
Tools the model may call
Tool choice: auto, none, or a specific tool
Response format. Set json_schema to enable structured outputs that strictly match the given schema
Random seed. The same seed and parameters make a best effort to reproduce results
Reasoning effort, for models that support reasoning
"low" | "medium" | "high"Expected output modalities, e.g. ["text"] or ["text","audio"]
Audio output settings; required when requesting the audio modality
Response Body
application/json
application/json
application/json
curl -X POST "https://jiniu.ai/v1/chat/completions" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4", "messages": [ { "role": "system", "content": "string" } ] }'{
"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"
}{
"error": {
"message": "string",
"type": "string",
"param": "string",
"code": "string"
}
}{
"error": {
"message": "string",
"type": "string",
"param": "string",
"code": "string"
}
}