Skip to main content
POST
/
ask
Ask (streaming)
curl --request POST \
  --url https://api.zo.computer/ask \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "q": "<string>",
  "model_name": "<string>",
  "context_paths": [
    "<string>"
  ],
  "command_paths": [
    "<string>"
  ],
  "context_parts": [
    {}
  ],
  "conversation_id": "<string>",
  "open_file_path": "<string>",
  "open_file_page": 123,
  "expanded_paths": [
    "<string>"
  ],
  "workspace_overview": "<string>",
  "terminal_contents": "<string>",
  "restart_point": 123,
  "zo_site_config": {},
  "mode": "chat"
}
'
{
  "parts": [
    {
      "content": "<string>",
      "timestamp": "2023-11-07T05:31:56Z",
      "dynamic_ref": "<string>",
      "part_kind": "system-prompt"
    }
  ],
  "kind": "request",
  "metadata": {}
}

Authorizations

Authorization
string
header
required

Zo API key (zo_sk_...)

Body

application/json
q
string
required

User's message/question

model_name
string | null

Model override

context_paths
string[] | null

File paths to include as context

command_paths
string[] | null

Command file paths

context_parts
Context Parts · object[] | null

Pre-formatted context parts

conversation_id
string | null

Continue existing conversation

open_file_path
string | null

Currently open file path

open_file_page
integer | null

Current page in open file

expanded_paths
string[] | null

Expanded directory paths

workspace_overview
string | null

Workspace tree overview

terminal_contents
string | null

Terminal output to include

restart_point
integer | null

Message index to restart from

zo_site_config
Zo Site Config · object

Site configuration

mode
enum<string> | null
default:chat

Agent mode: 'chat' or 'schedule' etc

Available options:
chat,
schedule,
sms,
email,
telegram

Response

SSE stream of agent events

parts
(SystemPromptPart · object | UserPromptPart · object | ToolReturnPart · object | RetryPromptPart · object)[]
required

A system prompt, generally written by the application developer.

This gives the model context and guidance on how to respond.

kind
string
default:request
Allowed value: "request"
metadata
Metadata · object