Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Chat

Create a chat completion

post

Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.

Authorizations
AuthorizationstringRequired

API key as bearer token in Authorization header

Body
providerone of · nullableOptional

When multiple model providers are available, optionally indicate your routing preference.

routeone of · nullableOptional
string · enumOptionalPossible values:
userstringOptional
session_idstringOptional

A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters.

modelstringOptional
modelsstring[]Optional
frequency_penaltynumber · double · nullableOptional
logprobsboolean · nullableOptional
top_logprobsnumber · double · nullableOptional
max_completion_tokensnumber · double · nullableOptional
max_tokensnumber · double · nullableOptional
presence_penaltynumber · double · nullableOptional
response_formatone ofOptional
or
or
or
or
seedinteger · nullableOptional
stopone of · nullableOptional
stringOptional
or
string[]Optional
streambooleanOptionalDefault: false
stream_optionsone of · nullableOptional
temperaturenumber · double · nullableOptionalDefault: 1
tool_choiceone ofOptional
string · enumOptionalPossible values:
or
top_pnumber · double · nullableOptionalDefault: 1
Responses
200

Successful chat completion response

application/json
idstringRequired
creatednumber · doubleRequired
modelstringRequired
objectstring · enumRequiredPossible values:
system_fingerprintstring · nullableOptional
post/chat/completions
POST /api/v1/chat/completions HTTP/1.1
Host: app.interactive.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 51

{
  "messages": [
    {
      "role": "system",
      "content": "string"
    }
  ]
}
{
  "id": "text",
  "choices": [
    {
      "finish_reason": "tool_calls",
      "index": 1,
      "message": {
        "role": "assistant",
        "content": "text",
        "name": "text",
        "tool_calls": [
          {
            "id": "text",
            "type": "function",
            "function": {
              "name": "text",
              "arguments": "text"
            }
          }
        ],
        "refusal": "text",
        "reasoning": "text"
      },
      "reasoning_details": [
        {
          "type": "reasoning.summary",
          "summary": "text",
          "id": "text",
          "format": "unknown",
          "index": 1
        }
      ],
      "logprobs": {
        "content": [
          {
            "token": "text",
            "logprob": 1,
            "bytes": [
              1
            ],
            "top_logprobs": [
              {
                "token": "text",
                "logprob": 1,
                "bytes": [
                  1
                ]
              }
            ]
          }
        ],
        "refusal": [
          {
            "token": "text",
            "logprob": 1,
            "bytes": [
              1
            ],
            "top_logprobs": [
              {
                "token": "text",
                "logprob": 1,
                "bytes": [
                  1
                ]
              }
            ]
          }
        ]
      }
    }
  ],
  "created": 1,
  "model": "text",
  "object": "chat.completion",
  "system_fingerprint": "text",
  "usage": {
    "completion_tokens": 1,
    "prompt_tokens": 1,
    "total_tokens": 1,
    "completion_tokens_details": {
      "reasoning_tokens": 1,
      "audio_tokens": 1,
      "accepted_prediction_tokens": 1,
      "rejected_prediction_tokens": 1
    },
    "prompt_tokens_details": {
      "cached_tokens": 1,
      "audio_tokens": 1,
      "video_tokens": 1
    }
  }
}

Last updated

Was this helpful?