API Reference

Chat Completions Endpoint

Creates a model completion response for the provided chat conversation history. Supports multi-turn context, streaming, and tool execution.


Endpoint URL

POSThttps://api.cortiqa.co/api/v1/chat/completions

Request Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer sk-cortiqa-...
Content-TypestringYesapplication/json

Request Body Parameters

FieldTypeRequiredDescription
modelstringYesID of the model to use, e.g. openai/gpt-oss-120b.
messagesarrayYesA list of message objects with role and content.
temperaturenumberNoSampling temperature between 0.0 and 2.0 (default: 0.7).
streambooleanNoIf true, returns Server-Sent Events delta tokens. Default: false.
max_tokensintegerNoMaximum output tokens to generate (up to 4,096).
toolsarrayNoList of tool definitions available to the model.

cURL Example

Terminal
curl https://api.cortiqa.co/api/v1/chat/completions \
  -H "Authorization: Bearer sk-cortiqa-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-oss-120b",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant powered by Cortiqa."},
      {"role": "user", "content": "Explain microservices in 1 sentence."}
    ],
    "temperature": 0.7
  }'

Response Object

Response
{
  "id": "chatcmpl-91b4ca",
  "object": "chat.completion",
  "created": 1726982400,
  "model": "openai/gpt-oss-120b",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Microservices are an architectural approach where an application is composed of small, independently deployable services communicating over lightweight APIs."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 24,
    "completion_tokens": 28,
    "total_tokens": 52
  }
}
Was this page helpful?