Documentation

Learn how to set up and get the most out of Viktor.

OpenAI and Anthropic compatible API

Drive Viktor agent runs with the OpenAI or Anthropic SDKs you already use — no new client code required.

If your application already talks to OpenAI or Anthropic, you can point it at Viktor and get an AI employee instead of a bare model. The compatible API accepts the standard Chat Completions, Responses, and Messages wire formats and runs a full Viktor agent behind them — with access to your connected tools.

  • OpenAI-style base URL: https://api.viktor.com/api/compat/v1
  • Anthropic-style base URL: https://api.viktor.com/api/compat
  • Model ID: viktor
  • Authentication: the same Viktor API keys, with the chat:completions scope granted. API keys require a paid plan or Enterprise.

Quickstart

Grant the chat:completions scope to a key in Settings → API Keys, then swap the base URL, API key, and model in your existing code:

Python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.viktor.com/api/compat/v1",
    api_key="zt_live_sk_...",
)

completion = client.chat.completions.create(
    model="viktor",
    messages=[
        {"role": "user", "content": "Summarize yesterday's Stripe payouts."}
    ],
)
print(completion.choices[0].message.content)

The Anthropic SDK works the same way with base_url="https://api.viktor.com/api/compat".

Endpoints

MethodEndpointProtocol
POST/api/compat/v1/chat/completionsOpenAI Chat Completions
POST/api/compat/v1/responsesOpenAI Responses
POST/api/compat/v1/messagesAnthropic Messages
POST/api/compat/v1/messages/count_tokensAnthropic token counting
GET/api/compat/v1/modelsModel listing (viktor plus a viktor/<slug> per model your workspace may select)
GET/api/compat/v1/models/{model_id}Model retrieval (404 for models your workspace cannot use)

Streaming is supported on all three chat surfaces.

How it differs from a bare model

  • Each call runs the Viktor agent, not a single model invocation. Viktor can use your connected integrations and skills while producing the reply, so calls take longer than a plain LLM call and are capped at 10 minutes.
  • Conversation state: Chat Completions and Anthropic Messages are stateless by default — send the full message history on each call, as you would with the upstream APIs. The Responses surface supports previous_response_id to continue a server-side conversation across calls. Chat Completions has the same option as a Viktor extension: every response carries an X-Viktor-Response-Id header, and passing that value as previous_response_id with only the new messages continues the same conversation, including Viktor's earlier tool results.
  • System messages are appended to Viktor's own system prompt, never substituted, so Viktor stays Viktor.
  • Structured output via response_format with a JSON Schema is supported, as are tool declarations.
  • Credits: each call consumes workspace credits like any other Viktor run. See how credits work.
  • Rate limits: requests are limited per route and per key owner (all keys of the same owner share one quota), and the limits scale with your workspace plan tier — higher plans get proportionally higher limits. A 429 includes Retry-After; wait for the advertised interval before retrying. See rate limits and retries.

When to use which API

  • Use this compatible API when you have existing OpenAI or Anthropic client code and want a drop-in upgrade.
  • Use the Public API when you want explicit threads, runs you can poll or cancel, and downloadable file artifacts.
  • Use the MCP server when the caller is itself an AI agent.
Get Started for Free