POST /v1/chat/completions
OpenAI-compatible chat completions endpoint for text generation, streaming, tool use, and structured output.
Endpoint
POSThttps://api.gpt88.cc/v1/chat/completions
This is the primary OpenAI-compatible text generation endpoint on gpt88.cc. Most existing OpenAI SDK integrations can keep the same request shape. Create a key in Agent API Keys before running the examples.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Required | Model ID to call, for example gpt-5.6-sol. Use GET /v1/models to fetch the real-time list available to your key. |
messages | array<Message> | Required | Conversation history in chronological order. |
stream | boolean | Optional | When true, the response is returned as Server-Sent Events. Default: false |
temperature | number | Optional | Sampling temperature. Higher values increase randomness. Default: 1 |
max_tokens | integer | Optional | Maximum number of output tokens for this response. |
response_format | object | Optional | Structured output hint, commonly { "type": "json_object" }. |
tools | array<Tool> | Optional | Function-calling tool definitions using JSON schema. |
modelstringRequiredModel ID to call, for examplegpt-5.6-sol. Use GET /v1/models to fetch the real-time list available to your key.messagesarray<Message>RequiredConversation history in chronological order.streambooleanWhen true, the response is returned as Server-Sent Events.Default:falsetemperaturenumberSampling temperature. Higher values increase randomness.Default:1max_tokensintegerMaximum number of output tokens for this response.response_formatobjectStructured output hint, commonly{ "type": "json_object" }.toolsarray<Tool>Function-calling tool definitions using JSON schema.
request bodyjson
{
"model": "gpt-5.6-sol",
"stream": false,
"temperature": 0.7,
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Introduce gpt88.cc in one sentence."}
]
}Examples
curl https://api.gpt88.cc/v1/chat/completions \
-H "Authorization: Bearer $GPT88_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.6-sol",
"stream": false,
"temperature": 0.7,
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Introduce gpt88.cc in one sentence."}
]
}'Response example
200 OKjson
{
"id": "chatcmpl-9f3a2b8c1d4e5f6a",
"object": "chat.completion",
"created": 1730000000,
"model": "gpt-5.6-sol",
"choices": [
{
"index": 0,
"finish_reason": "stop",
"message": {
"role": "assistant",
"content": "gpt88.cc is a unified AI API gateway with an OpenAI-compatible interface."
}
}
],
"usage": {
"prompt_tokens": 24,
"completion_tokens": 20,
"total_tokens": 44
}
}Notes
- Use GET /v1/models to refresh available models.
- Use Error Codes for retry and failure handling.