Skip to main content
POST
/
v1
/
aibot
/
bots
/
{AgentId}
/
openai
/
chat
/
completions
Send Message to Agent (OpenAI Protocol)
curl --request POST \
  --url http://{your-domain}/v1/aibot/bots/{AgentId}/openai/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "Agent-xxxxx",
  "messages": [
    {
      "role": "user",
      "content": "This is a conversation message"
    }
  ],
  "stream": false
}
'
{
  "id": "record-427d3652",
  "object": "chat.completion",
  "created": "1726030224",
  "model": "Agent-xxxx",
  "choices": [
    {
      "index": 0,
      "delta": {
        "role": "assistant",
        "content": "Hello"
      },
      "finish_reason": "continue"
    }
  ]
}

Authorizations

Authorization
string
header
required

Token corresponding to the environment ID, obtained through login authentication

Body

application/json
model
string
required

Agent ID

Example:

"Agent-xxxxx"

messages
object[]
required

Messages

stream
boolean
required

Whether to return streaming response

Example:

false

Response

default - application/json

Agent conversation successful, streaming response

id
string

Chat record ID

Example:

"record-427d3652"

object
string

Interface type

Example:

"chat.completion"

created
number

Conversation timestamp

Example:

"1726030224"

model
string

Agent ID

Example:

"Agent-xxxx"

choices
object[]

choices