API Overview
Every capability is accessible through a single endpoint:Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
messages | array | Yes | Conversation messages. Each has role ("user", "assistant", "system") and content |
workspace_id | string | Yes | Your Space ID — scopes all file access and tool execution |
tools | array | No | Which tools to make available. null or omitted = all tools available |
tool_choice | string | No | "auto" (default) — Zark decides. Or a specific tool ID to prefer it |
temperature | number | No | 0-1. Lower = more focused. Default: 0 |
max_tokens | integer | No | Maximum response length. Default: 4000 |
stream | boolean | No | Enable SSE streaming. Default: false |
file_ids | array | No | File IDs to reference in this request |
folder_ids | array | No | Folder IDs to scope file operations |
model | string | No | Model override. null = default model |
Authentication
All requests require an API key in thex-api-key header:
Streaming
Whenstream: true is set, Zark sends Server-Sent Events (SSE) as the response is generated:
Python
Event Types
| Event | Description |
|---|---|
ai_chunk | Incremental text content of the response |
ai_complete | Final complete response |
media_item | Generated media (image/video) file reference |
file_search_results | List of matching files from a file query |
table | Table data with rows and columns from a data query |
Available Tools
Search & Research
| Tool ID | Name | Description |
|---|---|---|
web_search | Web Search | Real-time internet search for news, research, prices, current events |
chat_search | Chat History Search | Search past conversations for previous discussions and context |
Files & Media
| Tool ID | Name | Description |
|---|---|---|
file_manager | File Manager | Read, organize, search, tag, and analyze uploaded files |
media_processor | Media Processor | Transcribe and index audio/video — speech-to-text, visual analysis |
Creation
| Tool ID | Name | Description |
|---|---|---|
image_gen | Image Generator | Generate images, illustrations, diagrams from text descriptions |
video_gen | Video Generator | Generate or edit video from text, images, or existing video |
artifact | Artifact Creator | Build code, apps, scripts, documents, and reports |
Data & Compute
| Tool ID | Name | Description |
|---|---|---|
database | Database Queries | Query uploaded data files with natural language |
table_workshop | Table Workshop | Create, modify, merge, and transform tables |
code_runner | Code Runner | Execute Python for calculations, statistics, and modeling |