Skip to main content
POST
/
v1
/
chat
/
completions
Create chat completion
curl --request POST \
  --url https://api.generalcompute.com/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "messages": [
    {
      "role": "system",
      "content": "<string>",
      "name": "<string>",
      "function_call": "<unknown>",
      "tool_calls": "<unknown>"
    }
  ],
  "temperature": 1,
  "top_p": 0.5,
  "n": 123,
  "stream": false,
  "stop": "<string>",
  "max_tokens": 123,
  "presence_penalty": 0,
  "frequency_penalty": 0,
  "logit_bias": {},
  "user": "<string>",
  "top_k": 123,
  "repetition_penalty": 123
}
'
{
  "id": "<string>",
  "object": "chat.completion",
  "created": 123,
  "model": "<string>",
  "choices": [
    {
      "index": 123,
      "message": {
        "role": "<string>",
        "content": "<string>",
        "function_call": "<unknown>",
        "tool_calls": "<unknown>"
      },
      "finish_reason": "<string>",
      "logprobs": "<unknown>"
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123
  },
  "system_fingerprint": "<string>"
}
Create chat completions with streaming, tool calls, and JSON mode using the fully OpenAI-compatible payload.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Chat completion request payload

model
string
required
messages
object[]
required
Minimum array length: 1
temperature
number
Required range: 0 <= x <= 2
top_p
number
Required range: 0 <= x <= 1
n
integer
stream
boolean
default:false
stop
max_tokens
integer
presence_penalty
number
Required range: -2 <= x <= 2
frequency_penalty
number
Required range: -2 <= x <= 2
logit_bias
object
user
string
top_k
number
repetition_penalty
number

Response

Chat completion response

id
string
required
object
enum<string>
required
Available options:
chat.completion
created
number
required
model
string
required
choices
object[]
required
usage
object
system_fingerprint
string