Skip to main content
The Zark API provides programmatic access to chat, image generation, video generation, and file storage. It lets you build applications that leverage Zark’s AI capabilities, from natural language queries to media generation and data analysis. The base URL for all routes is https://api.zarkai.xyz. All requests require authentication via the x-api-key header.
curl -X POST https://api.zarkai.xyz/v1/chat \
  -H "x-api-key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [{"role": "user", "content": "Hello"}],
    "workspace_id": "wks-xxxxx"
  }'

Endpoints

Chat

Send messages to Zark with automatic tool selection, file references, and streaming

Images

Generate images from text prompts or edit existing images

Videos

Generate videos from text, animate images, or edit existing video

Files

Upload, list, retrieve, and delete files in your Space

Authentication

All API requests require an API key passed in the x-api-key header:
HeaderValue
x-api-keyYour API key
Content-Typeapplication/json

Streaming

The Chat endpoint supports Server-Sent Events (SSE) when stream: true is set. Events are delivered as they’re generated:
EventDescription
ai_chunkIncremental text content
ai_completeFinal complete response
media_itemGenerated image or video file reference
file_search_resultsMatching files from a file query
tableData table with rows and columns

Errors

All errors return a JSON object with error and code fields:
{
  "error": "Invalid API key",
  "code": "unauthorized"
}
StatusDescription
400Bad request — missing or invalid parameters
401Unauthorized — invalid or missing API key
404Not found — resource doesn’t exist
429Rate limited — too many requests