sessions
Chat
sessions
Chat
Initiates a chat session.
Parameters: developer (Developer): The developer associated with the chat session. session_id (UUID): The unique identifier of the chat session. chat_input (ChatInput): The chat input data. background_tasks (BackgroundTasks): The background tasks to run. x_custom_api_key (Optional[str]): The custom API key.
Returns: ChatResponse: The chat response.
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
Headers
Path Parameters
Query Parameters
Body
application/json
Available options:
user
, assistant
, system
, tool
Allowed value:
"function"
Available options:
key
, type
, cursor_position
, mouse_move
, left_click
, right_click
, middle_click
, double_click
, screenshot
Available options:
str_replace
, insert
, view
, undo_edit
Payload for creating a tool
Maximum length:
40
Available options:
function
, integration
, system
, api_call
, computer_20241022
, text_editor_20241022
, bash_20241022
System definition
Available options:
agent
, user
, task
, execution
, doc
, session
, job
Available options:
create
, update
, patch
, create_or_update
, embed
, change_status
, search
, chat
, history
, delete
, get
, list
Available options:
tool
, doc
, execution
, transition
API call definition
Available options:
GET
, POST
, PUT
, DELETE
, PATCH
, HEAD
, OPTIONS
, CONNECT
, TRACE
Minimum length:
1
Anthropic new tools
Allowed value:
"computer_20241022"
Required range:
x > 600
Required range:
x > 400
Required range:
1 < x < 10
Available options:
auto
, none
Maximum length:
120
Required range:
-1 < x < 1000
Required range:
x > 1
Available options:
text
, json_object
Required range:
0 < x < 2
Required range:
0 < x < 2
Required range:
0 < x < 1
Required range:
-2 < x < 2
Required range:
-2 < x < 2
Required range:
0 < x < 5
Required range:
0 < x < 1
Response
201
application/json
Successful Response
Streaming chat completion output
The message generated by the model
Available options:
user
, assistant
, system
, tool
Allowed value:
"function"
Available options:
key
, type
, cursor_position
, mouse_move
, left_click
, right_click
, middle_click
, double_click
, screenshot
Available options:
str_replace
, insert
, view
, undo_edit
Available options:
stop
, length
, content_filter
, tool_calls
Allowed value:
"function"
Available options:
key
, type
, cursor_position
, mouse_move
, left_click
, right_click
, middle_click
, double_click
, screenshot
Available options:
str_replace
, insert
, view
, undo_edit
{
"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>"
}
]
}
}
]
}