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

  • modelstringRequired
    Model ID to call, for example gpt-5.6-sol. Use GET /v1/models to fetch the real-time list available to your key.
  • messagesarray<Message>Required
    Conversation history in chronological order.
  • streamboolean
    When true, the response is returned as Server-Sent Events.
    Default:false
  • temperaturenumber
    Sampling temperature. Higher values increase randomness.
    Default:1
  • max_tokensinteger
    Maximum number of output tokens for this response.
  • response_formatobject
    Structured 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