Skip to main content
POST
/
api
/
chat
Send a message
curl --request POST \
  --url https://operator.io/api/chat \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "messages": [
    {
      "role": "user",
      "parts": [
        {
          "type": "text",
          "text": "Build an agent that predicts AQI for 50 cities. Score daily against actuals."
        }
      ]
    }
  ]
}
'
{
  "chatId": "<string>",
  "text": "<string>"
}

Authorizations

Authorization
string
header
required

API key (ck_live_...). Create one in Settings > API Keys.

Headers

x-response-format
enum<string>

Set to json to receive a non-streaming JSON response with { chatId, text }.

Available options:
json

Body

application/json
messages
object[]
required

The messages to send.

id
string

Chat ID. Omit to create a new chat, or pass an existing ID to continue a conversation.

Response

Streaming response (default) or JSON when x-response-format: json is set.

chatId
string
text
string