Bring your own key

Bring your own key

OpenAgent runs the agent; you supply the model. You bring an API key from your provider, it goes to your box, and model traffic never touches our servers. That is why we can bill machine-time only, with zero markup on tokens.

Why you bring the key

We meter the machine your agent runs on, by the second — not the tokens it spends. Inference billing stays entirely between you and your provider, so there is no token margin for us to add and no usage of yours for us to meter. See pricing for what we do charge.

Which key

  • Codex → an OpenAI API key.
  • Claude Code → an Anthropic API key.

Use a provider API key, not a subscription login. Providers such as Anthropic and Google do not permit routing subscription-plan credentials through third-party services like ours; an API key is the supported path. This is spelled out in the Terms of Service.

How the key reaches your box

There are two ways to get your key onto the box:

  1. In-band, when the agent asks. Open /app, start a session, and the agent's auth dialog requests a key. You paste it; it travels over TLS through the relay to your box and nowhere else.
  2. In the box template. Set env_vars.OPENAI_API_KEY (or the variable your provider expects) in the create template, and it is placed in the box's environment at boot.

Either way the key ends up on your box, which is a micro-VM only you can reach.

Where the key lives

The agent stores its credentials on the box's own disk — Codex, for example, keeps them under /home/agent/.codex. That is why a reconnect does not ask again: the credential is already on the box. It stays there until you destroy the box, at which point the disk is erased. Your key is never written to our database.

Model traffic

When the agent calls the model, the request goes straight from your box to the provider's API over TLS — we do not proxy it, see it, or meter it. In our live runs the agent reached api.openai.com directly and the provider authenticated (or rejected) the key itself.

Revoking

Revoke or rotate the key at your provider at any time — it is your key on your account. To remove the copy on the box, destroy the box; its disk, and the stored credential with it, are erased. The provider bills you directly for whatever tokens you spent.

Your key sits on your box's disk until you destroy the box. The box is a single-user micro-VM scoped to you, but treat the key as present on that machine — if you ever have doubts, rotate it at the provider.