> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orgo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Bring your own model key

> Pay for agent runs with your own OpenAI or Anthropic key: which key runs which model, every error a key can get, and what Orgo still bills.

[Create chat completion](https://docs.orgo.ai/api-reference/chat/completions.md) runs an agent on one of your computers. Without a key of your own, Orgo pays the model provider and bills the run to the workspace owner's AI credits. Send your own OpenAI or Anthropic key in a header and your key pays instead.

The default model, `orgo-agent` (Computer Use), runs on OpenAI's GPT-6 Astra. To pay for the default with your own key, send an OpenAI key.

## Which key runs which model

| Key you send | `model` | What runs | Who pays |
| - | - | - | - |
| None | None | `orgo-agent`. On Android, `claude-sonnet-5`. | Orgo credits |
| None | Any | That model | Orgo credits |
| Only `X-OpenAI-Key` | None or `orgo-agent` | `orgo-agent`. On Android, nothing: `400`. | Your OpenAI account. On Android, nobody. |
| Only `X-Anthropic-Key` | None | `claude-sonnet-5` | Your Anthropic account |
| Only `X-Anthropic-Key` | A `claude-*` model or `orgo-agent-opus-5.5` | That model | Your Anthropic account |
| Both | None | `orgo-agent`. On Android, `claude-sonnet-5`. | Your OpenAI account. On Android, your Anthropic account. |
| Both | Any | That model | The account of the model's provider |
| A key for the other provider | A model that key can't pay for | Nothing. `400` | Nobody |

* `orgo-agent` is an OpenAI model. Every `claude-*` model and `orgo-agent-opus-5.5` are Anthropic models.
* A key pays only for its own provider's models. When it can't pay for the model, the request is refused with `400` and nothing runs. Over HTTP, Orgo never ignores your key and bills credits instead.
* `orgo-agent` does not run on Android. There, `X-OpenAI-Key` alone with no `model` is refused with `400` `own_key_unsupported`, and naming `orgo-agent` returns `400` `model_unsupported_os` before any key check.
* An empty header counts as not sent.
* The response says who paid. `orgo.own_key` is `"openai"`, `"anthropic"`, or `null` when Orgo credits paid. `orgo.cost_cents` is `0` when your key paid. `model` names the model that ran.

## Send your key

Set `$OPENAI_API_KEY` to your OpenAI key, `$ORGO_API_KEY` to your Orgo API key, and `$COMPUTER_ID` to the `id` of a running computer.

```bash cURL theme={null}
curl https://www.orgo.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $ORGO_API_KEY" \
  -H "X-OpenAI-Key: $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "computer_id": "'"$COMPUTER_ID"'",
    "messages": [{"role": "user", "content": "Open Chrome and search for the weather in Paris"}]
  }'
```

```python Python theme={null}
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://www.orgo.ai/api/v1",
    api_key=os.environ["ORGO_API_KEY"],
)

response = client.chat.completions.create(
    model="orgo-agent",
    messages=[{"role": "user", "content": "Open Chrome and search for the weather in Paris"}],
    extra_body={"computer_id": os.environ["COMPUTER_ID"]},
    # Your OpenAI key pays for orgo-agent.
    extra_headers={"X-OpenAI-Key": os.environ["OPENAI_API_KEY"]},
)

print(response.model, response.orgo["own_key"], response.orgo["cost_cents"])
# orgo-agent openai 0
```

For a Claude model, send `X-Anthropic-Key: $ANTHROPIC_API_KEY` and name the model, such as `"model": "claude-opus-5.5"`. Header names are not case-sensitive.

## Errors

| Status | `code` | `type` | When |
| - | - | - | - |
| 400 | `own_key_model_mismatch` | `invalid_request` | You named a model that no key you sent can pay for. |
| 400 | `own_key_unsupported` | `invalid_request` | You sent only `X-OpenAI-Key`, named no model, and no OpenAI model runs on the computer (Android) or is open to your account. |
| 401 | `invalid_own_key` | `authentication_error` | The provider rejected your key: wrong, revoked, or without permission. |
| 429 | `own_key_rate_limited` | `rate_limit_error` | Your key is over the provider's rate limit, or out of quota or credit. |
| 400 | `own_key_model_unavailable` | `invalid_request` | The provider says your key can't use the model. |

The first two are checked before the run starts. Nothing runs, nothing is billed, and nothing is stored. The last three come from the provider once the run calls it, with the provider's own words after the colon. They use no Orgo credits.

### The messages

`own_key_model_mismatch`, Anthropic key with an OpenAI model:

```text theme={null}
orgo-agent runs on OpenAI, so your X-Anthropic-Key can't pay for it. Send X-OpenAI-Key, or choose a Claude model (claude-sonnet-5, claude-opus-5.5, ...). Leave out the key to use your Orgo credits.
```

`own_key_model_mismatch`, OpenAI key with an Anthropic model:

```text theme={null}
claude-sonnet-5 runs on Anthropic, so your X-OpenAI-Key can't pay for it. Send X-Anthropic-Key, or choose an OpenAI model (orgo-agent). Leave out the key to use your Orgo credits.
```

The part `, or choose an OpenAI model (orgo-agent)` is left out when `orgo-agent` can't run on that computer or is not open to your account.

`own_key_unsupported`, with the computer's operating system in the parentheses:

```text theme={null}
No OpenAI model runs on this computer (android) right now, so your X-OpenAI-Key can't pay for this run. Send X-Anthropic-Key to use a Claude model, or leave out the key to use your Orgo credits.
```

When `orgo-agent` runs on the computer but is not open to your account, the message starts `No OpenAI model is available to your account right now` instead.

`invalid_own_key`:

```text theme={null}
OpenAI rejected your X-OpenAI-Key: <the provider's message>
Anthropic rejected your X-Anthropic-Key: <the provider's message>
```

`own_key_rate_limited`:

```text theme={null}
Your X-OpenAI-Key is over OpenAI's rate limit or out of quota: <the provider's message>
Your X-Anthropic-Key is over Anthropic's rate limit or out of quota: <the provider's message>
```

`own_key_model_unavailable`. The first form is used when the provider's model ID differs from Orgo's, the second when they match:

```text theme={null}
orgo-agent runs on OpenAI's gpt-6-astra, and your X-OpenAI-Key can't use it: <the provider's message>
Your X-Anthropic-Key can't use claude-sonnet-5 on Anthropic: <the provider's message>
```

When the provider sends no message, these three end with its HTTP status instead, as in `Anthropic rejected your X-Anthropic-Key (HTTP 401).`

Orgo removes your key from the provider's message before sending it. The key itself, a masked form such as `sk-proj-****abcd`, and anything shaped like an `sk-` key each become `[your key]`. The message is then put on one line and cut at 300 characters.

Every error has the endpoint's usual shape:

```json theme={null}
{
  "error": {
    "type": "authentication_error",
    "message": "Anthropic rejected your X-Anthropic-Key: invalid x-api-key",
    "code": "invalid_own_key"
  }
}
```

### Errors while streaming

With `"stream": true`, the two `400`s checked before the run still arrive as a `400` status. A provider refusal arrives after the stream has started, so the status is already `200`. The same `message`, `type`, and `code` come as one error event, then the stream ends:

```text theme={null}
data: {"error":{"message":"OpenAI rejected your X-OpenAI-Key: Incorrect API key provided: [your key]. You can find your API key at https://platform.openai.com/account/api-keys.","type":"authentication_error","code":"invalid_own_key"}}

data: [DONE]
```

Any other failure keeps its usual answer: `500` `internal_error`, or a `server_error` event with no `code` when streaming.

## What is still billed

* **No AI credits for the model.** Orgo checks no balance, places no hold, and applies no per-request budget. `orgo.cost_cents` is `0`, and `orgo.credit_balance_cents` is left out.
* **Your provider bills your key** at its own rates. `orgo-agent` asks OpenAI for its fast tier, so OpenAI bills your key at fast tier rates.
* **The computer is billed as usual.** Your key pays only for the model.

## Your key still goes through Orgo

Your key does not give you a direct line to the provider.

* Orgo's servers run the agent and make every model call with your key. Your messages, the screenshots, and the model's replies pass through Orgo.
* Orgo keeps the chat thread and a 200-character preview of your last message, the same as without a key.
* Orgo uses your key for that request only and does not store it.

To keep your prompts and the model's replies off Orgo entirely, run the loop yourself, described in [Use any other provider](#use-any-other-provider).

## MCP and the CLI do not pass your key

The Orgo MCP server sends only your Orgo API key. It cannot send `X-OpenAI-Key` or `X-Anthropic-Key`, so a chat completion through MCP (`orgo_create_chat_completion`) always bills Orgo credits. Its `orgo_create_chat_completion` tool lists `X-OpenAI-Key` and `X-Anthropic-Key` as inputs because they come from the API spec, but the server drops them. Don't put your key there. The CLI's `orgo agent` and `orgo run` work the same way. To pay with your own key, call `POST https://www.orgo.ai/api/v1/chat/completions` over HTTP, as in [Send your key](#send-your-key).

## Use any other provider

The chat endpoint takes keys for OpenAI and Anthropic only. There is no header for Google, xAI, DeepInfra, or any other provider.

For any other provider, run the agent loop yourself. Call the provider directly with your own key, and use Orgo only for the computer: screenshots, clicks, typing, keys, and bash. Orgo bills no AI credits on that path, the computer is billed as usual, and your prompts and the model's replies never reach Orgo. Worked examples for Claude, GPT, and Gemini are in [Use any model](https://docs.orgo.ai/guides/models.md#run-the-loop-yourself).

## Agents installed on a computer

Agents that run on the computer itself do not use these headers. They read a key from the workspace owner's [Settings → Secrets](https://www.orgo.ai/settings/secrets):

| Agent | Key from Secrets |
| - | - |
| Hermes | `ANTHROPIC_API_KEY` |
| OpenClaw | `ANTHROPIC_API_KEY` |
| Claude Code | `ANTHROPIC_API_KEY` |
| Codex | `OPENAI_API_KEY` |

Hermes and OpenClaw do not use an OpenAI key. Without a key, Hermes runs on Orgo's models and bills the owner's AI credits. See [Hermes](https://docs.orgo.ai/guides/hermes.md) and [OpenClaw](https://docs.orgo.ai/guides/openclaw.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.