Chat Completions

POST
/chat/completions

OpenAI-compatible Chat Completions endpoint.

Authorization

BearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://api.vivgrid.com/v1/chat/completions" \  -H "Content-Type: application/json" \  -d '{    "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
  }
}
Empty
Empty
Empty