# Citrus Mobile auth.md

Citrus Mobile is pay-as-you-go eSIM data in 220 destinations. The Reseller API
lets an agent or application provision eSIMs, fund them, and read usage.

**Audience:** autonomous agents and applications acting on behalf of a Citrus
Mobile reseller account holder.

**Auth method:** long-lived API key, sent as an HTTP bearer credential. There is
no OAuth authorization server, so `/.well-known/oauth-authorization-server`,
`/.well-known/openid-configuration`, and `/.well-known/oauth-protected-resource`
are intentionally absent. This document is the self-contained description of how
to authenticate.

**Registration endpoint:** <https://citrusmobile.com/developer> (human-operated;
see [Registration](#registration) below).

Machine-readable companions to this file:

- API catalog: <https://citrusmobile.com/.well-known/api-catalog>
- Capability manifest: <https://citrusmobile.com/.well-known/ai-catalog.json>
- MCP server card: <https://citrusmobile.com/.well-known/mcp/server-card.json>
- OpenAPI 3.1 spec: <https://citrusmobile.com/openapi-reseller.yaml>

## What needs credentials

| Surface | Credential |
| --- | --- |
| `GET https://citrusmobile.com/api/agent-tools` and public tool calls | None |
| MCP tools `get_rates`, `check_coverage`, `estimate_cost`, `search_docs` | None |
| MCP tools `get_account`, `list_esims`, `get_esim`, `provision_esim`, `fund_esim` | Reseller API key |
| Everything under `https://citrusmobile.com/api/v2/reseller` | Reseller API key |

Rates, coverage, and cost estimates are deliberately open, so an agent can plan
a purchase before anyone has an account.

## Credential type

Citrus Mobile issues **long-lived API keys**, not OAuth tokens. There is no
authorization server, no dynamic client registration, and no token endpoint.
Do not attempt an OAuth flow.

- Format: `rsk_` prefix, 68 characters
- Scope: the full reseller account that owns the key
- Lifetime: until revoked
- Transport: `Authorization: Bearer rsk_...` over HTTPS only

```http
GET /api/v2/reseller/account HTTP/1.1
Host: citrusmobile.com
Authorization: Bearer rsk_a1b2c3d4e5f6...
```

## Registration

Key issuance is human-in-the-loop. An agent cannot self-register, because a
reseller account holds a real money balance.

1. A human creates a developer account at <https://citrusmobile.com/developer>.
2. They top up the reseller balance (minimum $10).
3. They create an API key in the developer dashboard and hand it to the agent as
   a configured secret.

For MCP clients:

```bash
claude mcp add --transport http citrus https://citrusmobile.com/api/mcp \
  --header "Authorization: Bearer rsk_..."
```

## Spending money

`provision_esim` (`POST /api/v2/reseller/esim/provision`) charges a $1.75
provisioning fee, and `fund_esim` (`POST /api/v2/reseller/esim/{iccid}/fund`)
moves real balance onto an eSIM wallet. Both take effect immediately and are not
reversible from the API. Confirm the action and the amount with the human who
owns the account before calling either.

## Limits and errors

- 100 requests per minute per API key
- `401` — key missing, invalid, or revoked
- `402` — insufficient reseller balance
- `429` — rate limited; back off and retry

## Revocation

Keys are revoked from the developer dashboard at
<https://citrusmobile.com/developer>; revocation takes effect immediately. A
suspected leak should be reported through <https://citrusmobile.com/support>.
