Skip to main content
POST
/
v1
/
chat
/
completions
Create a chat conversation
curl --request POST \
  --url https://api.ai.cc/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "gpt-4",
  "messages": [
    {
      "role": "developer",
      "content": "You are a helpful assistant."
    },
    {
      "role": "user",
      "content": "Hello!"
    }
  ]
}
'
{
  "id": "<string>",
  "object": "chat.completion",
  "created": 123,
  "model": "<string>",
  "choices": [
    {
      "index": 123,
      "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": 123,
    "completion_tokens": 123,
    "total_tokens": 123,
    "prompt_tokens_details": {
      "cached_tokens": 123,
      "text_tokens": 123,
      "audio_tokens": 123,
      "image_tokens": 123
    },
    "completion_tokens_details": {
      "text_tokens": 123,
      "audio_tokens": 123,
      "reasoning_tokens": 123
    }
  },
  "system_fingerprint": "<string>"
}
This endpoint integrates a third-party model. For detailed parameter information, please refer to the official documentation at OpenAI Docs.

Authorizations

Authorization
string
header
required

Authentication is done using Bearer Token. Format: Authorization: Bearer sk-xxxxxx

Body

application/json
model
string
required

model ID

messages
object[]
required

message list

temperature
number
default:1

What sampling temperature to use, between 0 and 2.

Required range: 0 <= x <= 2
top_p
number
default:1

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.

Required range: 0 <= x <= 1
n
integer
default:1

How many chat completion choices to generate for each input message.

Required range: x >= 1
stream
boolean
default:false

If set to true, the model response data will be streamed to the client as it is generated using server-sent events.

stream_options
object
stop

Up to 4 sequences where the API will stop generating further tokens.

max_tokens
integer

The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API.

max_completion_tokens
integer

An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.

presence_penalty
number
default:0

Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.

Required range: -2 <= x <= 2
frequency_penalty
number
default:0

Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.

Required range: -2 <= x <= 2
logit_bias
object
user
string
tools
object[]
tool_choice
Available options:
none,
auto,
required
response_format
object
seed
integer
reasoning_effort
enum<string>
Available options:
low,
medium,
high
modalities
enum<string>[]
Available options:
text,
audio
audio
object

Response

Successfully created response

id
string
object
string
Example:

"chat.completion"

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