Skip to main content
POST
/
chat
/
completions
Create chat completion
curl --request POST \
  --url https://api.vivgrid.com/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "managed",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant."
    },
    {
      "role": "user",
      "content": "Tell me a story about a blue dinosaur. no more than 10 words"
    }
  ],
  "reasoning_effort": "medium",
  "max_completion_tokens": 64,
  "stream": true
}
'
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1710000000,
  "model": "managed",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Rain cats and dogs."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 24,
    "completion_tokens": 12,
    "total_tokens": 36
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json
messages
object[]
required
Minimum array length: 1
model
string
default:managed

Optional; recommended to set to "managed" because the actual model is selected server-side. See /models to see all model supported

temperature
number
Required range: 0 <= x <= 2
top_p
number
Required range: 0 <= x <= 1
n
integer
Required range: 1 <= x <= 16
stream
boolean
stream_options
object
stop
max_completion_tokens
integer<int32>
presence_penalty
number
Required range: -2 <= x <= 2
frequency_penalty
number
Required range: -2 <= x <= 2
logit_bias
object
logprobs
boolean
top_logprobs
integer
Required range: 0 <= x <= 20
user
string
response_format
object
tools
object[]

Use Vivgrid serverless LLM tool to manage tools and skills; clients typically leave this empty.

tool_choice
enum<string>

Use Vivgrid serverless LLM tool to manage tools and skills; leave unset to let the platform auto-select.

Available options:
auto
reasoning_effort
enum<string>

Controls reasoning depth: none, low, medium, high

Available options:
none,
low,
medium,
high

Response

Chat completion response

id
string
required
object
string
required
created
integer<int64>
required
model
string
required
choices
object[]
required
system_fingerprint
string
usage
object