API reference

Depaza API documentation

A complete REST reference for the Depaza API — OpenAI- and Anthropic-compatible. Authentication, every endpoint, streaming, batches, vision, files, search, pricing and errors, with copy-paste samples.

https://depaza.eu/v1 Full reference (Markdown) ↗

Quickstart

The Depaza API is OpenAI- and Anthropic-compatible. Create an API key under Settings → API in your account, then send requests with it as a Bearer token. The base URL is shown above. In default mode, tools (web search and page reading) run automatically on our side — you do not define or execute them.

curl https://depaza.eu/v1/chat/completions \
  -H "Authorization: Bearer $DEPAZA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "core",
    "messages": [{"role": "user", "content": "What changed in EU AI rules this week?"}]
  }'

Authentication

Pass your key in the Authorization header as a Bearer token. The Anthropic-compatible routes (/v1/messages) also accept the x-api-key header. Keys look like dpz_live_… and are shown only once at creation — store them securely. Revoke a key anytime in the dashboard; revocation takes effect immediately.

Authorization: Bearer dpz_live_…
x-api-key: dpz_live_…   (Anthropic SDK / Claude CLI)

SDK compatibility

Point any OpenAI or Anthropic SDK at Depaza by changing one line — the base URL and your key. Two tool modes are chosen automatically: by default Depaza applies its own system prompt and runs tools server-side, returning a finished answer; if you send your own tools array, Depaza respects your system message and returns tool_calls for you to execute (standard function calling). See Tools below.

Python — OpenAI SDK

from openai import OpenAI

client = OpenAI(
    api_key="dpz_live_…",
    base_url="https://depaza.eu/v1",
)

resp = client.chat.completions.create(
    model="core",
    messages=[{"role": "user", "content": "Summarise today's EU tech news"}],
)
print(resp.choices[0].message.content)

Node.js — OpenAI SDK

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "dpz_live_…",
  baseURL: "https://depaza.eu/v1",
});

const resp = await client.chat.completions.create({
  model: "core",
  messages: [{ role: "user", content: "Summarise today's EU tech news" }],
});
console.log(resp.choices[0].message.content);

Python — Anthropic SDK

from anthropic import Anthropic

client = Anthropic(
    api_key="dpz_live_…",
    base_url="https://depaza.eu",  # SDK appends /v1
)

msg = client.messages.create(
    model="core",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello from Europe"}],
)
print(msg.content[0].text)

Models

Pass the id as the "model" field. List them programmatically with GET /v1/models. All models are EU-hosted; output is clamped to 8192 tokens.

Model id Name Best for
lite Depaza Lite Fast, everyday questions and high-volume tasks
core Depaza Core The best balance of quality, speed and tool use (default)
max Depaza Max Deep analysis and the most demanding tasks

Also selectable via the API: coder (code), reason (long reasoning), boss (unrestricted, advanced). On /v1/messages, Anthropic model names are mapped automatically — names containing "haiku" → lite, all others → max.

Core API

Chat completions

POST/v1/chat/completions

OpenAI-compatible. Send a messages array, set "stream": true for Server-Sent Events, or omit it for a single JSON response. The response includes a standard "usage" block plus a "depaza_billing" object with what the turn cost and your remaining balance. Image blocks route to a vision model automatically (paid plans).

Key parameters

  • model — lite, core or max — required.
  • messages — Array of {role, content}. In default mode it must end with a user message and system messages are ignored. When you send your own tools, the full role history is honoured — including your system message and assistant/tool messages.
  • tools — Optional. Your own function definitions (OpenAI shape). Sending this switches to function-calling mode — see Tools.
  • tool_choice — Optional. auto (default), none, required, or a specific function — only with your own tools.
  • stream / stream_options.include_usage — Stream SSE chunks; optionally emit a final usage chunk.
  • temperature, top_p, top_k, max_tokens, stop, seed, presence/frequency_penalty — Standard sampling params (forwarded to the model).
  • response_format — JSON mode / json_schema (honoured by lite/max).
  • mode — standard (default), document (research → draft → Office file) or expert (draft → critique).
  • attachments — Up to 5 files {file|base64, filename?, mime?}, OCR'd and prepended (paid plans).
  • depaza_events — When streaming, also emit custom depaza.* frames so you can observe server-side tools and document phases.

Streaming request

{
  "model": "core",
  "messages": [{"role": "user", "content": "…"}],
  "stream": true,
  "stream_options": {"include_usage": true}
}

Response

{
  "id": "chatcmpl-…",
  "object": "chat.completion",
  "model": "core",
  "choices": [{ "index": 0, "message": { "role": "assistant", "content": "…" }, "finish_reason": "stop" }],
  "usage": { "prompt_tokens": 812, "completion_tokens": 415, "total_tokens": 1227 },
  "depaza_billing": { "web_searches": 1, "balance_cents_after": 2461 }
}

Tools & function calling

Depaza picks a tool mode automatically based on whether your request includes a tools array.

Built-in tools — no tools field

If you do not pass tools, web search and live page reading run automatically inside the turn when the model decides they are useful. You never receive tool calls to execute — you get a finished, web-grounded answer. This is the same engine that powers the Depaza chat app.

Your own tools — function calling

Send a tools array and Depaza behaves like a standard OpenAI endpoint: only your tools are offered, your system message is respected, and nothing runs server-side. The model returns tool_calls with finish_reason "tool_calls"; run them on your side, append each result as a {role:"tool", tool_call_id, content} message, and call again to let the model finish. Use tool_choice to force or disable calls.

Request — offer a tool

curl https://depaza.eu/v1/chat/completions \
  -H "Authorization: Bearer $DEPAZA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "core",
    "messages": [{"role": "user", "content": "What is the weather in Paris?"}],
    "tools": [{
      "type": "function",
      "function": {
        "name": "get_current_weather",
        "description": "Get the current weather for a city",
        "parameters": {
          "type": "object",
          "properties": {"city": {"type": "string"}},
          "required": ["city"]
        }
      }
    }]
  }'

Response — the model calls it

{
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant", "content": null,
      "tool_calls": [{
        "id": "call_abc", "type": "function",
        "function": { "name": "get_current_weather", "arguments": "{\"city\": \"Paris\"}" }
      }]
    },
    "finish_reason": "tool_calls"
  }]
}

List models

GET/v1/models

Returns the OpenAI-shaped catalog with context window and max output for each model. Bearer auth.

{
  "object": "list",
  "data": [
    { "id": "lite", "object": "model", "owned_by": "depaza", "context_window": 128000, "max_output_tokens": 8192 },
    { "id": "core", "object": "model", "owned_by": "depaza", "context_window": 128000, "max_output_tokens": 8192 },
    { "id": "max",  "object": "model", "owned_by": "depaza", "context_window": 128000, "max_output_tokens": 8192 }
  ]
}

Usage & balance

GET/v1/usage

Bearer-authenticated balance/usage for the calling key. Credit keys report a EUR balance; membership (CLI) keys report a rolling weekly token window instead.

{ "email": "you@example.com", "plan": "pro",
  "mode": "credit", "balance_cents": 2461, "currency": "EUR" }

Messages (Anthropic-compatible)

POST/v1/messages

Drop-in for the Anthropic SDK and the Claude CLI (ANTHROPIC_BASE_URL). The request is translated to Depaza's engine and back to Anthropic shape. Auth via x-api-key or Bearer.

Key parameters

  • model — Depaza id, or an Anthropic name (mapped). Defaults to core.
  • max_tokens — Required. Clamped to 8192.
  • messages — Anthropic message objects. content may be a string or block array: text, image, document (PDF/Office text-extracted and inlined), tool_use, tool_result.
  • system — Optional system prompt (string or array of text blocks).
  • tools / tool_choice — Anthropic tool defs {name, description, input_schema}; tool_choice auto/any/none/tool.
  • stream, temperature, top_p, top_k, stop_sequences — Streaming + sampling.

Request

curl https://depaza.eu/v1/messages \
  -H "x-api-key: $DEPAZA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "core",
    "max_tokens": 1024,
    "system": "You are concise.",
    "messages": [{"role": "user", "content": "Name three EU capitals."}]
  }'

Response

{
  "id": "msg_…", "type": "message", "role": "assistant", "model": "core",
  "content": [{ "type": "text", "text": "Paris, Berlin, Madrid." }],
  "stop_reason": "end_turn", "stop_sequence": null,
  "usage": { "input_tokens": 24, "output_tokens": 8 }
}

Streaming (SSE events)

event: message_start
data: {"type":"message_start","message":{"id":"msg_…","role":"assistant","content":[],…}}

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Paris"}}

event: message_delta
data: {"type":"message_delta","delta":{"stop_reason":"end_turn"},"usage":{"output_tokens":8}}

event: message_stop
data: {"type":"message_stop"}

Count tokens

POST/v1/messages/count_tokens

Estimate input tokens for a request (Anthropic-shaped). Approximate — a ~3.5 chars/token heuristic, not an exact tokenizer.

curl https://depaza.eu/v1/messages/count_tokens \
  -H "x-api-key: $DEPAZA_API_KEY" -H "Content-Type: application/json" \
  -d '{"model":"core","messages":[{"role":"user","content":"Hello"}]}'

→ { "input_tokens": 2 }

Message Batches

POST/v1/messages/batches

Anthropic-compatible asynchronous batches: submit up to 10,000 message requests, processed in the background and fetched by id once the batch ends. Auth via x-api-key or Bearer; create is limited to 60/min.

Endpoints

  • POST /v1/messages/batches — Create. Each request needs a unique custom_id and params (a /v1/messages body).
  • GET /v1/messages/batches — List your batches.
  • GET /v1/messages/batches/{id} — Retrieve / poll processing_status.
  • GET /v1/messages/batches/{id}/results — JSONL results — only when status is ended.
  • POST /v1/messages/batches/{id}/cancel — Initiate cancellation.

Create

curl https://depaza.eu/v1/messages/batches \
  -H "x-api-key: $DEPAZA_API_KEY" -H "Content-Type: application/json" \
  -d '{
    "requests": [
      { "custom_id": "q1", "params": { "model": "core", "max_tokens": 256,
        "messages": [{"role":"user","content":"Capital of France?"}] } }
    ]
  }'

Batch object

{
  "id": "msgbatch_…", "type": "message_batch",
  "processing_status": "in_progress",
  "request_counts": { "processing": 1, "succeeded": 0, "errored": 0, "canceled": 0, "expired": 0 },
  "created_at": "2026-06-04T10:00:00+00:00", "ended_at": null,
  "expires_at": "2026-06-05T10:00:00+00:00", "results_url": null
}

Results (JSONL, one line per request)

{"custom_id":"q1","result":{"type":"succeeded","message":{"id":"msg_…",
  "content":[{"type":"text","text":"Paris."}],"stop_reason":"end_turn",
  "usage":{"input_tokens":12,"output_tokens":3}}}}

Capabilities

Vision

POST/v1/vision

A dedicated EU vision model turns image(s) into text so text-only models can "see" screenshots. Bearer auth, paid plans only, 60/min.

Parameters

  • images — Required. 1–4 base64 strings (or data: URLs), ≤ 8 MB each.
  • prompt — Defaults to "Describe this image in detail."
  • temperature, max_tokens — 0–2 (default 0.2); 64–4000 (default 1800).
curl https://depaza.eu/v1/vision \
  -H "Authorization: Bearer $DEPAZA_API_KEY" -H "Content-Type: application/json" \
  -d '{"prompt":"What does this screenshot show?","images":["<base64>"]}'

→ { "text": "A login form with email and password fields…",
    "model": "mistral-small-…" }

Files — text extraction

POST/v1/files

Extract text from a file: image OCR, scanned-PDF OCR and mechanical text/PDF/Office extraction — the same pipeline as chat attachments. Bearer auth, paid plans only, max 10 MB. Supports PDF, images, Office (DOCX/XLSX/PPTX), CSV, JSON and text. Send multipart "file" or JSON {file: <base64>, mime?}.

curl https://depaza.eu/v1/files \
  -H "Authorization: Bearer $DEPAZA_API_KEY" \
  -F "file=@report.pdf"

→ { "text": "Q1 revenue grew 18%…", "mime": "application/pdf", "ocr": false }

Download a generated file

GET/v1/files/{id}

Download an Office file produced by Document Mode or the generate_* tools, authorised by your bearer key. Streams the binary as an attachment.

curl -L https://depaza.eu/v1/files/123 \
  -H "Authorization: Bearer $DEPAZA_API_KEY" -o report.docx

Transcription

POST/v1/transcribe

Audio → text (EU-hosted Whisper large-v3). Public API for short clips (paid, 60/min, 25 MB max, multipart or base64). In the web chat: real-time mic dictation up to 10 minutes with client-side segmentation + screen wake lock, plus long audio file attachments with automatic background chunking for arbitrary-length recordings (paid).

curl https://depaza.eu/v1/transcribe \
  -H "Authorization: Bearer $DEPAZA_API_KEY" \
  -F "audio=@note.webm"

→ { "text": "..." }

# Also supports JSON base64:
# { "audio": "<base64 or data:...>", "filename": "note.webm" }

# Web chat: up to 10 min continuous dictation (client segmentation + wake lock)
# + long audio attachments with automatic ffmpeg chunking (paid).

Account

CLI session sync

POST/v1/sessions

Opt-in sync of CLI coding transcripts so they appear in the web dashboard. Bearer auth, paid plans only. Upsert replaces the transcript (send the full message list each turn), keyed on session_id.

POST https://depaza.eu/v1/sessions
{ "session_id": "abc-123", "status": "ended", "model": "core",
  "messages": [ {"role":"user","content":"…"}, {"role":"assistant","content":"…"} ] }

→ { "ok": true, "id": 8842 }

GET https://depaza.eu/v1/sessions            → { "sessions": [ … ] }
GET https://depaza.eu/v1/sessions/abc-123    → { "session_id": "…", "messages": [ … ] }

API keys

Manage keys from the logged-in web session (these routes use session auth, not bearer — they back the Settings UI). The plaintext token is returned once on creation and never stored in recoverable form.

GET    https://depaza.eu/v1/keys          → { "keys": [ … ] }
POST   https://depaza.eu/v1/keys          → { "id": 17, "token": "dpz_live_…", "name": "prod" }
DELETE https://depaza.eu/v1/keys/17       → { "ok": true }

Credits & billing

Accounts using API keys are prepaid; CLI keys are included in your plan. Add credit (minimum €25) under Settings → API. Enable auto-recharge to top up automatically from a saved card when your balance falls below a threshold you choose. If your balance is empty (or an auto-recharge has failed), the API returns 402 until you top up.

Pricing

Usage is billed in EUR against your prepaid balance at the live rates below. Web search is charged only when a query actually reaches the external engine; answers from our own index or cache are free.

Model Input / 1M tokens Output / 1M tokens
Depaza Lite €0.56 €0.56
Depaza Core €1.64 €2.19
Depaza Max €5.56 €16.67
BOSS (Unrestricted) €1.64 €2.19
Web search (external) €0.022 per search

Reference

Rate limits

Limits are sliding windows; exceeding one returns 429 with a Retry-After header (seconds). Every /v1/ response carries an x-request-id header for tracing.

POST /v1/chat/completions 120/min, 10,000/day per key (API keys)
POST /v1/messages 120/min per user
POST /v1/messages/batches 60/min per user
POST /v1/sessions 120/min per user
/v1/vision · /v1/files · /v1/search · /v1/transcribe 60/min per user

Errors

Most routes use the OpenAI envelope {"error": {message, type, code}}; the Anthropic-compatible routes use {"type":"error","error":{type, message}}.

400 Invalid request — bad model id, malformed/empty messages, missing max_tokens, unsupported file.
401 Invalid or missing API key.
402 Insufficient credit / failed auto-recharge, or a paid-plan / weekly-cap gate.
403 Account suspended, or Code CLI access requires a paid plan.
404 Batch, session or file not found.
429 Rate limited. Honour the Retry-After header.
5xx Upstream model error or transient failure.

Build it with the Depaza Code CLI

Don't hand-write the client — the Depaza Code CLI already knows this API (it reads this exact reference) and can scaffold, run and debug your integration in the terminal. It's your European dev team, on European soil.

curl -fsSL https://depaza.com/install.sh | sh   # install
depaza auth                                       # connect this terminal
depaza docs                                       # print the full API reference
depaza "build a Python client for /v1/messages with streaming"

This page is also served as Markdown at /llms.txt — point any agent or LLM at it. Learn more about the CLI.

Ready to build?

Generate a key in your dashboard and make your first call in minutes.