Skip to main content
POST
/
sessions
/
{session_id}
/
chat
Error
A valid request URL is required to generate request examples
{
  "created_at": "2023-11-07T05:31:56Z",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "choices": [
    {
      "index": 123,
      "delta": {
        "role": "user",
        "tool_call_id": "<string>",
        "content": "<string>",
        "name": "<string>",
        "tool_calls": []
      },
      "finish_reason": "stop",
      "logprobs": {
        "content": [
          {
            "token": "<string>",
            "logprob": 123,
            "top_logprobs": [
              {
                "token": "<string>",
                "logprob": 123,
                "bytes": [
                  123
                ]
              }
            ],
            "bytes": [
              123
            ]
          }
        ]
      },
      "tool_calls": [
        {
          "function": {
            "name": "<string>",
            "arguments": "<string>"
          },
          "type": "function",
          "integration": "<unknown>",
          "system": "<unknown>",
          "api_call": "<unknown>",
          "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": false
          },
          "id": "<string>"
        }
      ]
    }
  ],
  "usage": {
    "completion_tokens": 123,
    "prompt_tokens": 123,
    "total_tokens": 123
  },
  "jobs": [],
  "docs": []
}

Authorizations

Authorization
string
header
required

Headers

X-Custom-Api-Key
string | null

Path Parameters

session_id
string<uuid>
required

Query Parameters

Body

application/json
messages
Message · object[]
required
Minimum array length: 1
tools
CreateToolRequest · object[] | null
tool_choice
Available options:
auto,
none
recall
boolean
default:true
save
boolean
default:true
model
string | null
Maximum string length: 120
stream
boolean
default:false
stop
string[]
Maximum array length: 4
seed
integer | null
Required range: -1 <= x <= 1000
max_tokens
integer | null
Required range: x >= 1
logit_bias
Logit Bias · object
response_format
SimpleCompletionResponseFormat · object
  • SimpleCompletionResponseFormat
  • SchemaCompletionResponseFormat
agent
string<uuid> | 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
metadata
Metadata · object
auto_run_tools
boolean
default:false
recall_tools
boolean
default:true

Response

Successful Response

  • ChunkChatResponse
  • MessageChatResponse
created_at
string<date-time>
required
id
string<uuid>
required
choices
ChatOutputChunk · object[]
required
usage
CompletionUsage · object

Usage statistics for the completion request

jobs
string<uuid>[]
docs
DocReference · object[]