Chat
Create a chat completion based on a list of messages. Requires authorization.
Authorizations
Body
modelstringRequiredExample:
Model ID to use for the completion
copilot-zero
temperaturenumberOptionalDefault:
Sampling temperature between 0 and 1.
0.7
max_tokensintegerOptionalDefault:
Maximum tokens to generate (max 4096).
1024
streambooleanOptionalDefault:
Whether to stream partial responses.
false
instructionsstring | nullableOptional
Optional instructions for the model.
Responses
200
Chat completion response
application/json
400
Invalid request (missing or invalid parameters)
application/json
401
Unauthorized - Invalid or missing API key
application/json
429
Too many requests - rate limit exceeded
application/json
500
Internal server error
application/json
post
POST /v1/chat/completions HTTP/1.1
Host: api.secton.org
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 165
{
"model": "copilot-zero",
"messages": [
{
"role": "user",
"content": "Hello, how can I help you?"
}
],
"temperature": 0.7,
"max_tokens": 1024,
"stream": false,
"instructions": "text"
}
{
"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
}
}
Was this helpful?