Skip to main content
POST
/
chat
/
completions
Generate a chat completion
curl --request POST \
  --url https://api.secton.org/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "copilot-zero",
  "messages": [
    {
      "role": "user",
      "content": "Hello, how can I help you?"
    }
  ],
  "temperature": 0.7,
  "max_tokens": 1024,
  "stream": false,
  "instructions": "<string>"
}'
{
  "object": "chat.completion",
  "model": "copilot-zero",
  "organization_id": "org_1234",
  "messages": [
    {
      "role": "user",
      "content": "Hello! How can I assist you today?"
    }
  ],
  "usage": {
    "prompt_tokens": 50,
    "completion_tokens": 100,
    "total_tokens": 150
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json

Chat completion request payload

model
string
required

Model ID to use for the completion

Example:

"copilot-zero"

messages
object[]
required

List of message objects forming the conversation history

temperature
number
default:0.7

Sampling temperature between 0 and 1.

max_tokens
integer
default:1024

Maximum tokens to generate (max 4096).

stream
boolean
default:false

Whether to stream partial responses.

instructions
string | null

Optional instructions for the model.

Response

Chat completion response

object
string
Example:

"chat.completion"

model
string
Example:

"copilot-zero"

organization_id
string
Example:

"org_1234"

messages
object[]

Full conversation including assistant's response

usage
object
I