Skip to main content
POST
/
v1
/
chat
/
completions
Create a chat completion
curl --request POST \
  --url https://gomodel.example.com/v1/chat/completions \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "max_tokens": 123,
  "messages": [
    {
      "content": [
        {
          "image_url": {
            "detail": "<string>",
            "media_type": "<string>",
            "url": "<string>"
          },
          "input_audio": {
            "data": "<string>",
            "format": "<string>"
          },
          "text": "<string>",
          "type": "<string>"
        }
      ],
      "role": "<string>",
      "tool_call_id": "<string>",
      "tool_calls": [
        {
          "function": {
            "arguments": "<string>",
            "name": "<string>"
          },
          "id": "<string>",
          "type": "<string>"
        }
      ]
    }
  ],
  "model": "<string>",
  "parallel_tool_calls": true,
  "provider": "<string>",
  "reasoning": {
    "effort": "<string>"
  },
  "stream": true,
  "stream_options": {
    "include_usage": true
  },
  "temperature": 123,
  "tool_choice": "<unknown>",
  "tools": [
    {}
  ]
}
'
{
  "choices": [
    {
      "finish_reason": "<string>",
      "index": 123,
      "logprobs": {},
      "message": {
        "content": [
          {
            "image_url": {
              "detail": "<string>",
              "media_type": "<string>",
              "url": "<string>"
            },
            "input_audio": {
              "data": "<string>",
              "format": "<string>"
            },
            "text": "<string>",
            "type": "<string>"
          }
        ],
        "role": "<string>",
        "tool_calls": [
          {
            "function": {
              "arguments": "<string>",
              "name": "<string>"
            },
            "id": "<string>",
            "type": "<string>"
          }
        ]
      }
    }
  ],
  "created": 123,
  "id": "<string>",
  "model": "<string>",
  "object": "<string>",
  "provider": "<string>",
  "system_fingerprint": "<string>",
  "usage": {
    "completion_tokens": 123,
    "completion_tokens_details": {
      "accepted_prediction_tokens": 123,
      "audio_tokens": 123,
      "reasoning_tokens": 123,
      "rejected_prediction_tokens": 123
    },
    "prompt_tokens": 123,
    "prompt_tokens_details": {
      "audio_tokens": 123,
      "cached_tokens": 123,
      "image_tokens": 123,
      "text_tokens": 123
    },
    "raw_usage": {},
    "total_tokens": 123
  }
}

Authorizations

Authorization
string
header
required

Body

application/json

Chat completion request

max_tokens
integer
messages
object[]
model
string
parallel_tool_calls
boolean
provider
string

Gateway routing hint; stripped before upstream execution.

reasoning
object
stream
boolean
stream_options
object
temperature
number
tool_choice
any

string or object

tools
object[]

Response

JSON response or SSE stream when stream=true

choices
object[]
created
integer
id
string
model
string
object
string
provider
string
system_fingerprint
string
usage
object