/chat/completions
POST
/chat/completions
Request
Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.Example:
Authorization: Bearer ********************
Header Params
x-opengateway-failover-sequence
string <json>
required
Default:
["openai","azure"]
x-opengateway-vllm-endpoint
string
optional
x-opengateway-vllm-api-key
string
optional
x-opengateway-timeout
string
optional
Body Params application/json
model
string
required
messages
array [object {5}]
required
role
enum<string>
required
Allowed values:
systemuserassistanttool
content
string
optional
name
string
optional
tool_calls
string
optional
tool_call_id
string
optional
frequency_penalty
integer <int32>
optional
logit_bias
string <json>
optional
logprobs
boolean
optional
top_logprobs
integer <int32>
optional
max_tokens
integer <int32>
optional
n
integer <int32>
optional
presence_penalty
integer <int32>
optional
response_format
string <json>
optional
seed
integer <int32>
optional
service_tier
string
optional
stop
array[string]
optional
stream
boolean
optional
stream_options
string <json>
optional
temperature
integer <int32>
optional
top_p
integer <int32>
optional
tools
array [object {2}]
optional
type
string
required
function
object
required
Example
{
"model": "string",
"messages": [
{
"role": "system",
"content": "string",
"name": "string",
"tool_calls": "string",
"tool_call_id": "string"
}
],
"frequency_penalty": 0,
"logit_bias": "string",
"logprobs": true,
"top_logprobs": 0,
"max_tokens": 0,
"n": 0,
"presence_penalty": 0,
"response_format": "string",
"seed": 0,
"service_tier": "string",
"stop": [
"string"
],
"stream": true,
"stream_options": "string",
"temperature": 0,
"top_p": 0,
"tools": [
{
"type": "string",
"function": {
"description": "string",
"name": "string",
"parameters": {
"type": "string",
"properties": {},
"required": [
"string"
],
"additionalProperties": true
},
"strict": false
}
}
]
}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/chat/completions' \
--header 'x-opengateway-failover-sequence;' \
--header 'x-opengateway-vllm-endpoint;' \
--header 'x-opengateway-vllm-api-key;' \
--header 'x-opengateway-timeout;' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "string",
"messages": [
{
"role": "system",
"content": "string",
"name": "string",
"tool_calls": "string",
"tool_call_id": "string"
}
],
"frequency_penalty": 0,
"logit_bias": "string",
"logprobs": true,
"top_logprobs": 0,
"max_tokens": 0,
"n": 0,
"presence_penalty": 0,
"response_format": "string",
"seed": 0,
"service_tier": "string",
"stop": [
"string"
],
"stream": true,
"stream_options": "string",
"temperature": 0,
"top_p": 0,
"tools": [
{
"type": "string",
"function": {
"description": "string",
"name": "string",
"parameters": {
"type": "string",
"properties": {},
"required": [
"string"
],
"additionalProperties": true
},
"strict": false
}
}
]
}'
Responses
🟢201Created
application/json
Body
object {0}
Example
{}
🟢201Created
🟠400Bad Request
Modified at 2025-05-23 07:58:24