Skip to main content
POST
/
threads
/
{thread_id}
/
messages
Create a message in thread
curl --request POST \
  --url https://api.anyapi.ai/v1/threads/{thread_id}/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "role": "user",
  "content": "<string>"
}
'
{
  "id": "<string>",
  "object": "message",
  "thread_id": "<string>",
  "role": "<string>",
  "content": [
    {}
  ],
  "created_at": 123
}

Authorizations

Authorization
string
header
required

Bearer token authentication. Get your API key from the dashboard.

Path Parameters

thread_id
string
required

The ID of the thread

Body

application/json
role
enum<string>

Role of the message sender

Available options:
user,
assistant
content
string

Message content

Response

Message created successfully

id
string

Message ID

object
string
Example:

"message"

thread_id
string

Thread ID

role
string

Message role

content
object[]
created_at
integer

Creation timestamp