POST
/
sessions
/
{session_id}
/
chat
{
  "usage": {
    "completion_tokens": 123,
    "prompt_tokens": 123,
    "total_tokens": 123
  },
  "jobs": [],
  "docs": [],
  "created_at": "2023-11-07T05:31:56Z",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "choices": [
    {
      "index": 123,
      "finish_reason": "stop",
      "logprobs": {
        "content": [
          {
            "token": "<string>",
            "logprob": 123,
            "bytes": [
              123
            ],
            "top_logprobs": [
              {
                "token": "<string>",
                "logprob": 123,
                "bytes": [
                  123
                ]
              }
            ]
          }
        ]
      },
      "tool_calls": [
        {
          "type": "function",
          "function": {
            "name": "<string>",
            "arguments": "<string>"
          },
          "integration": "<any>",
          "system": "<any>",
          "api_call": "<any>",
          "computer_20241022": {
            "action": "key",
            "text": "<string>",
            "coordinate": [
              123
            ]
          },
          "text_editor_20241022": {
            "command": "str_replace",
            "path": "<string>",
            "file_text": "<string>",
            "insert_line": 123,
            "new_str": "<string>",
            "old_str": "<string>",
            "view_range": [
              123
            ]
          },
          "bash_20241022": {
            "command": "<string>",
            "restart": true
          },
          "id": "<string>"
        }
      ],
      "delta": {
        "role": "user",
        "tool_call_id": "<string>",
        "content": "<string>",
        "name": "<string>",
        "continue": true,
        "tool_calls": [
          {
            "type": "<string>",
            "function": {
              "name": "<string>",
              "arguments": "<string>"
            },
            "integration": "<any>",
            "system": "<any>",
            "api_call": "<any>",
            "computer_20241022": {
              "action": "key",
              "text": "<string>",
              "coordinate": [
                123
              ]
            },
            "text_editor_20241022": {
              "command": "str_replace",
              "path": "<string>",
              "file_text": "<string>",
              "insert_line": 123,
              "new_str": "<string>",
              "old_str": "<string>",
              "view_range": [
                123
              ]
            },
            "bash_20241022": {
              "command": "<string>",
              "restart": true
            },
            "id": "<string>"
          }
        ]
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

Headers

X-Custom-Api-Key
string | null

Path Parameters

session_id
string
required

Query Parameters

connection_pool
any

Body

application/json
messages
object[]
required
tools
object[]

Payload for creating a tool

tool_choice
Available options:
auto,
none
recall
boolean
default:
true
save
boolean
default:
true
model
string | null
Maximum length: 120
stream
boolean
default:
false
stop
string[]
seed
integer | null
Required range: -1 < x < 1000
max_tokens
integer | null
Required range: x > 1
logit_bias
object | null
response_format
object | null
agent
string | null
repetition_penalty
number | null
Required range: 0 < x < 2
length_penalty
number | null
Required range: 0 < x < 2
min_p
number | null
Required range: 0 < x < 1
frequency_penalty
number | null
Required range: -2 < x < 2
presence_penalty
number | null
Required range: -2 < x < 2
temperature
number | null
Required range: 0 < x < 5
top_p
number | null
Required range: 0 < x < 1

Response

201
application/json
Successful Response
created_at
string
required
id
string
required
choices
object[]
required

Streaming chat completion output

usage
object | null

Usage statistics for the completion request

jobs
string[]
docs
object[]