Skip to main content
Create Chat Completion
curl --request POST \
  --url https://{api_endpoint}/api/v1/completions/chat \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "<string>",
  "messages": [
    {
      "role": "<string>",
      "content": "<string>",
      "name": "<string>"
    }
  ],
  "frequency_penalty": 123,
  "presence_penalty": 123,
  "logit_bias": {},
  "temperature": 123,
  "n": 123,
  "seed": 123,
  "stop": [
    "<string>"
  ],
  "stream": true,
  "top_p": 123,
  "max_tokens": 123,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "<string>",
        "description": "<string>",
        "parameters": {}
      }
    }
  ],
  "tool_choice": "<string>",
  "user": "<string>",
  "extra_model_args": {}
}'
{
  "content": "<string>",
  "response_metadata": {}
}

Authorizations

Authorization
string
header
required

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

Body

application/json
model
string
required
messages
ChatMessage · object[]
required
frequency_penalty
number | null
default:0
presence_penalty
number | null
default:0
logit_bias
object | null
temperature
number | null
default:1
n
integer | null
default:1
seed
integer | null
stop
string[] | null
stream
boolean | null
default:false
top_p
number | null
default:1
max_tokens
integer | null
tools
Tool · object[] | null
tool_choice
string | null
default:auto
user
string | null
extra_model_args
object | null

Response

Successful Response

content
string
required
response_metadata
object | null