Dot2API: Turn Your OpenAI Dot Into an API That Speaks Both OpenAI and Claude

Dot2API is a self-hosted gateway. It exposes one OpenAI Dot through two formats: OpenAI Chat Completions and Anthropic Messages. Point your existing SDK at it, and every request gets queued. Your Dot wakes up through MCP Events, claims the task over MCP, and answers. The reply comes back as an ordinary completion.

Unlike most 2API projects, Dot2API doesn’t reverse-engineer a web interface and never touches your OpenAI account credentials. It uses the public MCP 2.0 connector and the Events protocol. It doesn’t call any model itself. That means you don’t hand over account passwords, and you’re not depending on a page layout that can change overnight. The trade-off: a Dot is an agent, not a model endpoint. What you get is format compatibility, not behavioral compatibility.

What problem does Dot2API actually solve?

Short answer: it turns a Dot that only works inside its own chat window into an API other programs can call, without exposing your account credentials.

Plenty of teams already have an OpenAI Dot. It’s wired into email, calendars, internal tools. It can do real work. But when you want a scheduled job, an automation pipeline, a self-hosted bot, or another agent to hand it a task, you need a standard entry point. Dot2API fills that gap. A request arrives, gets queued, the Dot is woken by an event, claims the task, answers, and the result comes back in OpenAI or Anthropic format.

The gateway doesn’t call models. That’s the Dot’s job. Dot2API handles the plumbing: gateway, queue, events, format translation. This positioning defines both what it can do and what it can’t.

How it differs from most 2API projects

Most 2API projects reverse-engineer web endpoints or use your account credentials directly against the upstream. Dot2API does neither. It uses the public MCP 2.0 connector and Events protocol. As the source puts it, it doesn’t call any model itself.

The upside is that you never hand your OpenAI account credentials to the gateway. The downside is that it depends on MCP support on the Dot side. If your Dot environment can’t handle MCP connectors and event subscriptions, this whole approach won’t run.

Who should use it, and who shouldn’t

Good fits: scheduled jobs, automation pipelines, self-hosted bots, and letting other agents delegate a single task. Say you have a daily “summarize unread email” workflow, or an internal bot that forwards hard questions to the Dot. These scenarios don’t care much about latency, they care about format compatibility, and Dot2API delivers exactly that.

Poor fits: model backends for coding agents like Codex or Claude Code, and real-time chat frontends. The reasons are simple. Every Dot reply takes seconds to minutes. Streaming isn’t token-by-token. Tool calls aren’t supported. If you plug it into a chat window that expects instant responses, the experience will be rough. I initially read “OpenAI and Claude compatible” and assumed it could serve as a model backend. The capability boundaries make it clear: it’s for wiring a Dot into automation, not for replacing a model endpoint.

How does it work under the hood?

Short answer: client requests hit a compatibility layer, a task kernel handles leases, retries, and deadlines, an event outbox notifies the Dot through signed webhooks, and the Dot claims and completes work over an MCP endpoint.

flowchart LR
    classDef access fill:#e1f5fe,stroke:#01579b
    classDef core fill:#fff3e0,stroke:#e65100
    classDef infra fill:#e8f5e9,stroke:#1b5e20
    classDef upstream fill:#fce4ec,stroke:#880e4f

    Clients["API clients<br/>OpenAI SDK · Anthropic SDK · curl"]

    subgraph Core["Dot2API"]
        direction TB
        Compat["Compatibility layer<br/>/v1/chat/completions · /v1/messages"]
        Tasks["Task kernel<br/>leases · retries · deadlines"]
        Events["Event outbox<br/>signed webhooks"]
        MCP["MCP endpoint<br/>/mcp"]
        Compat --> Tasks
        Tasks --> Events
        MCP --> Tasks
    end

    Database[("SQLite")]
    Dot["OpenAI Dot"]

    Clients -->|requests| Compat
    Compat -.->|replies| Clients
    Events -->|task.available| Dot
    Dot -->|claim_task / complete_task| MCP
    Tasks --> Database

    class Clients access
    class Compat,Tasks,Events,MCP core
    class Database infra
    class Dot upstream

What happens when a request comes in

A client hits /v1/chat/completions or /v1/messages. The compatibility layer passes it to the task kernel. The kernel does a few things: persists the task, atomically claims it, applies a lease, retries within limits, and enforces a deadline. If the caller disconnects, the task is cancelled automatically. The event outbox then fires task.available. The Dot wakes up, calls claim_task over the MCP endpoint to take the work, processes it, and calls complete_task to submit the result. That result flows back through the kernel and returns to the client as an ordinary completion.

SQLite is the persistence layer. Tasks don’t vanish when the service restarts. Leases and retries make sure one task isn’t processed twice at the same time, and that a task has a chance to be re-claimed if the Dot drops out mid-flight.

The event outbox and the MCP endpoint

The event outbox delivers signed, at-least-once webhooks. The Dot subscribes to task.available. The MCP endpoint at /mcp is where the Dot picks up its tools and event subscriptions. It claims tasks and submits results through it.

One deployment detail that bites people: the Dot connects from OpenAI’s network, so the service needs a public HTTPS address. Both quick-start paths below only listen on localhost, so you need a TLS reverse proxy in front. That’s not optional. It’s the precondition for the Dot to reach you at all.

Core capabilities and where the limits are

Short answer: it handles format compatibility, async tasks, durable queueing, signed events, and basic security controls. It doesn’t do token-by-token streaming, tool calls, image input, or real-time concurrency.

Area Capability
Endpoints OpenAI Chat Completions, Anthropic Messages, model list, async task API
Clients OpenAI-compatible and Anthropic-compatible SDKs, automation tools, plain HTTP
Streaming SSE in both formats, with keep-alive while the Dot works
Reliability Durable tasks, atomic claim, leases, limited retries, deadlines, cancel on caller disconnect
Events MCP Events subscription, callback verification, signed at-least-once webhook delivery
Security Expiring keys that store only fingerprints, permission-scoped identities, rate limiting, audit log
Operations One-command init, liveness and readiness probes, consistent backups, hardened container image

The reliability column deserves a second look. Durable tasks and leases aren’t decoration. A Dot task can run for minutes. Network blips, service restarts, and caller timeouts all happen in that window. Without leases, a task could be claimed twice. Without deadlines, expired tasks would keep clogging the queue. Dot2API builds all of that into the task kernel.

Why streaming isn’t token-by-token

A Dot is an agent, not a model endpoint. It doesn’t generate tokens and spit them out as it goes. The full reply arrives in one chunk. SSE here is for keep-alive — keeping the connection alive while the Dot works — not for streaming tokens. If you set stream to true, the client gets keep-alive frames and then the complete content at the end. That’s fine for automation. It’s a poor fit for real-time chat frontends.

Why tool calls aren’t supported

tools is ignored. The Dot uses its own tools and won’t return a tool call. The reason is the same positioning: Dot2API doesn’t call models and doesn’t proxy model tool calls. It hands the request to the Dot, and the Dot handles it its own way. Images and tool result blocks return 400. Text only. Sampling parameters and max_tokens are accepted and ignored. Token usage is pinned at 0.

These constraints look numerous, but in the right scenario they don’t matter. Scheduled jobs don’t need tool calls. Self-hosted bots don’t need token streaming. What you need is to reliably hand a task to the Dot and get a result back.

Quick start: Docker Compose and running from source

Short answer: get a public HTTPS address with a TLS reverse proxy in front, then start the service with either Docker Compose or the source workflow — init first, setup second.

The Dot connects from OpenAI’s network, so the service needs a public HTTPS address. Both paths below only listen on localhost, so put a TLS reverse proxy in front. Deployment specifics live in the deployment docs.

Docker Compose

git clone https://github.com/Pluviobyte/dot2api.git
cd dot2api

docker compose build
docker compose run --rm dot2api init
docker compose run --rm dot2api setup
docker compose up -d

Running from source

You need Python 3.11 or newer, plus uv.

uv sync --frozen --no-dev
uv run --no-sync dot2api init
uv run --no-sync dot2api setup
uv run --no-sync dot2api serve

setup prints two credentials. They’re shown once. The database stores only fingerprints:

{"api_key": "d2a_...", "dot_token": "d2a_...", "queue": "dot"}

What each credential is for

api_key goes into the SDK on the caller side. dot_token is what the Dot uses to reach the MCP endpoint. Both are shown once, and the database stores only fingerprints. Lose them and you reissue. The source notes that issuing more keys, distinguishing callers, rotating tokens, and the various management commands are all covered in the configuration docs.

One security warning worth repeating, straight from the source: anyone holding an API key can issue instructions to your Dot, and your Dot may be wired into various applications. Only give the key to callers you trust as much as yourself. Don’t hardcode it into frontend code. Don’t hand it out freely in shared environments. Your Dot is connected to your email, calendar, and internal tools — a leaked key means someone else can act through it.

How do you connect your Dot?

Short answer: add an MCP connector, have the Dot listen for task.available, and give it a standing instruction set.

  1. Add an MCP connector at https://<host>/mcp, using dot_token as the bearer credential. If the connector can’t send auth headers, start the service with DOT2API_CAPABILITY_URLS=1 and use https://<host>/mcp/<dot_token>.
  2. Have the Dot subscribe to task.available on the dot queue.
  3. Give the Dot a standing instruction: list queued tasks, claim one, answer the conversation, submit the result.

Full steps, paste-ready instruction prompts, and troubleshooting are in the Dot integration docs. One thing I’d flag from step 1: DOT2API_CAPABILITY_URLS=1 is a fallback. Putting a token in the URL path is weaker than an auth header. Use headers whenever the connector supports them. Only flip that switch if it genuinely can’t.

Using the API

Short answer: OpenAI-compatible endpoints, Anthropic-compatible endpoints, a model list, an async task API, and an MCP endpoint. Credentials go in either an Authorization: Bearer header or an x-api-key header.

Endpoint Purpose
POST /v1/chat/completions OpenAI-compatible chat completions
POST /v1/messages Anthropic-compatible messages
GET /v1/models Model list — only dot
POST /v1/tasks · GET /v1/tasks/{task_id} Submit async, retrieve result
POST /mcp MCP tools and event subscriptions used by the Dot
GET /healthz · GET /readyz Liveness and readiness checks

Credentials work as Authorization: Bearer <api_key> or x-api-key: <api_key>. The model field accepts any value and is echoed back unchanged.

curl

curl https://dot2api.example.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dot",
    "messages": [{"role": "user", "content": "Summarize my unread email from today."}]
  }'

OpenAI SDK

from openai import OpenAI

client = OpenAI(base_url="https://dot2api.example.com/v1", api_key=API_KEY, timeout=600)
reply = client.chat.completions.create(
    model="dot",
    messages=[{"role": "user", "content": "Summarize my unread email from today."}],
)
print(reply.choices[0].message.content)

Anthropic SDK

from anthropic import Anthropic

client = Anthropic(base_url="https://dot2api.example.com", api_key=API_KEY, timeout=600)
reply = client.messages.create(
    model="dot",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Summarize my unread email from today."}],
)
print(reply.content[0].text)

Setting client timeouts

Set your client timeout longer than the completion timeout, or set stream to true so keep-alive frames hold the connection open. The default is up to 300 seconds of waiting, after which you get a 504 with a task_id you can read later. That means you can grab the task_id and retrieve the result afterwards with GET /v1/tasks/{task_id}. The async task API exists for exactly this.

If you’re using synchronous calls, a 600-second client timeout is a reasonable starting point. The default completion timeout is 300 seconds, so leaving headroom on the client side avoids a premature disconnect on a slow network. Streaming keeps the connection alive with keep-alive frames, but the full reply still arrives in one chunk. Not token-by-token.

Configuration reference

Short answer: data directory, bind address, port, queue name, completion timeout, task TTL, rate limit, and the capability URL switch are all environment variables.

Variable Default Meaning
DOT2API_DATA_DIR var Directory for the database and encryption keys
DOT2API_HOST 127.0.0.1 Bind address
DOT2API_PORT 8788 Bind port
DOT2API_QUEUE dot Queue the Dot subscribes to
DOT2API_COMPLETION_TIMEOUT 300 Seconds a request waits for the Dot before returning 504
DOT2API_TASK_TTL 3600 Seconds before an unanswered request expires
DOT2API_RATE_PER_MINUTE 120 Per-identity request limit per minute
DOT2API_CAPABILITY_URLS off Set to 1 to allow tokens in the MCP path

DOT2API_HOST defaults to 127.0.0.1, so it only listens on localhost. If you have a reverse proxy in front, that’s fine. If you want the service to face the internet directly, change this — though the source recommends a TLS reverse proxy anyway, so you usually won’t need to.

DOT2API_COMPLETION_TIMEOUT and DOT2API_TASK_TTL are the two easiest to mix up. The first is how many seconds a request waits for the Dot before a 504. The second is how many seconds an unanswered request lives before it expires. One controls client wait, the other controls task lifetime. Tune them together.

Operations and security

Short answer: use health probes, consistent backups, and a hardened container image for operations. On the security side, only give keys to callers you trust as much as yourself.

The project ships liveness and readiness probes, consistent backups, and a hardened container image. GET /healthz is the liveness check. GET /readyz is readiness. Deployment, backup, and recovery are covered in the deployment docs.

On security, the source’s warning is worth repeating: anyone with an API key can direct your Dot, and your Dot may be connected to a range of applications. Only give the key to callers you trust as much as yourself. The project itself is intended for technical research and for personal use with your own Dot. Follow OpenAI’s terms and your local laws. You take responsibility for how you use it.

Development and testing

Short answer: sync dependencies with uv, then run pytest, ruff, the build, and the release check.

uv sync --frozen
uv run pytest
uv run ruff check .
uv run ruff format --check .
uv run python -m build
uv run python scripts/check_release.py

If you’re modifying the code, that set covers tests, style checks, build, and release verification. The contributing guide and security policy are worth a read too.

FAQ

Can Dot2API serve as the model backend for Codex or Claude Code?
No. The source is explicit: it can’t be the model backend for coding agents like Codex or Claude Code, and it isn’t suitable for real-time chat frontends. It fits scheduled jobs, automation pipelines, self-hosted bots, and letting other agents delegate a single task.

Is streaming token-by-token?
No. The complete reply arrives in one chunk. SSE here is for keep-alive, not token streaming.

Are tool calls supported?
No. tools is ignored. The Dot uses its own tools and won’t return a tool call.

Can I send images or tool result blocks?
No. Text only. Images and tool result blocks return 400.

Do sampling parameters and max_tokens do anything?
They’re accepted and ignored. Token usage is pinned at 0.

What happens if a request times out?
The default is 300 seconds of waiting, then a 504 with a task_id you can read later. Retrieve the result with GET /v1/tasks/{task_id}.

Can one Dot handle multiple requests at once?
One Dot processes one queue, and requests line up. Concurrency depends on the Dot side. On the Dot2API side, everything is queued.

Can I recover lost credentials?
No. The two credentials printed by setup are shown once, and the database stores only fingerprints. Lost them, reissue.

Practical checklist

  • •
    Get a public HTTPS address with a TLS reverse proxy in front.
  • •
    Run init, setup, serve via Docker Compose or source.
  • •
    Save api_key and dot_token — they’re shown once.
  • •
    Add an MCP connector to your Dot at https://<host>/mcp, using dot_token as the bearer credential.
  • •
    If the connector can’t send auth headers, start with DOT2API_CAPABILITY_URLS=1 and use https://<host>/mcp/<dot_token>.
  • •
    Have the Dot subscribe to task.available on the dot queue.
  • •
    Give the Dot a standing instruction: list queued tasks, claim one, answer the conversation, submit the result.
  • •
    Set the client timeout longer than the completion timeout, or set stream to true.
  • •
    Only give the key to callers you trust as much as yourself.
  • •
    For async results, use POST /v1/tasks and GET /v1/tasks/{task_id}.

One-page overview

Dot2API is a self-hosted gateway that exposes one OpenAI Dot through both OpenAI Chat Completions and Anthropic Messages formats. It doesn’t reverse-engineer a web interface, doesn’t touch OpenAI account credentials, uses the public MCP 2.0 connector and Events protocol, and doesn’t call any model itself.

It fits scheduled jobs, automation pipelines, self-hosted bots, and letting other agents delegate a task. It doesn’t fit coding agent backends or real-time chat frontends. Latency runs from seconds to minutes. Streaming arrives in one chunk. Text only. No tool calls. Sampling parameters and max_tokens are ignored. Token usage is pinned at 0. One Dot processes one queue, and requests line up.

Deployment needs a public HTTPS address and a TLS reverse proxy. Use init to initialize, setup to generate api_key and dot_token, and serve to start. On the Dot side, add an MCP connector, subscribe to task.available, and follow the standing instruction to claim and submit tasks. On security, only give keys to callers you trust as much as yourself. Licensed under MIT.