OpenAI & Anthropic Compatible API | Viktor Docs
Documentation
Learn how to set up and get the most out of Viktor.
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:completionsscope granted.
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:
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
| Method | Endpoint | Protocol |
|---|---|---|
POST |
/api/compat/v1/chat/completions |
OpenAI Chat Completions |
POST |
/api/compat/v1/responses |
OpenAI Responses |
POST |
/api/compat/v1/messages |
Anthropic Messages |
POST |
/api/compat/v1/messages/count_tokens |
Anthropic token counting |
GET |
/api/compat/v1/models |
Model listing (returns viktor) |
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 — send the full message history on each call, as you would with the upstream APIs. The Responses surface supports
previous_response_idto continue a server-side conversation across calls. - System messages are appended to Viktor's own system prompt, never substituted, so Viktor stays Viktor.
- Structured output via
response_formatwith 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
429includesRetry-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.