Skip to main content
POST
/
api
/
v1
/
chats
Create chat
curl --request POST \
  --url https://app.sure.am/api/v1/chats \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "Monthly budget review",
  "message": "<string>",
  "model": "<string>"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "title": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "messages": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "type": "user_message",
      "role": "user",
      "content": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "model": "<string>",
      "tool_calls": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "function_name": "<string>",
          "function_arguments": {},
          "created_at": "2023-11-07T05:31:56Z",
          "function_result": {}
        }
      ]
    }
  ],
  "error": "<string>",
  "pagination": {
    "page": 2,
    "per_page": 2,
    "total_count": 1,
    "total_pages": 1
  }
}

Headers

Authorization
string
required

Bearer token with write scope

Body

application/json
title
string
required
Example:

"Monthly budget review"

message
string

Optional initial message in the chat

model
string

Optional OpenAI model identifier

Response

chat created

id
string<uuid>
required
title
string
required
created_at
string<date-time>
required
updated_at
string<date-time>
required
messages
object[]
required
error
string | null
pagination
object