# Token Usage

`sk-4ai-...` is the only credential used to access the 4AICode relay and must be included with every request.

## Creating a Token

Go to **Dashboard → Manage Tokens → New Token**, enter a name, and click **Create**.

> ⚠️ The token is displayed only once. Copy it to a password manager such as 1Password or Bitwarden immediately. Once you close the dialog, it cannot be recovered—you can only revoke it and create a new one. **Do not paste it into chat windows or commit it to git**.

## Usage

Use the `Authorization: Bearer` header:

```
Authorization: Bearer sk-4ai-xxxxxxxxxxxxxxxx
```

URL query parameters (`?api_key=...`) and the `X-Api-Key` header are not supported because they can easily be exposed in HTTP logs.

## Team Isolation

A token can access only the team under which it was created:

- Switch teams → create a new token
- Usage is always billed to the team that owns the token

There is no single token that can access all teams.

## Revoking a Token

Click **Revoke** on the **Manage Tokens** page. Revocation is irreversible and takes effect immediately—all requests will return 401 within 1 second. After revocation, you can create a new token with the same name.

### When to Revoke a Token

| Scenario | Revoke? |
|---|---|
| Pasted into a public repo, group chat, or screenshot | ✅ Immediately |
| Stored on a former employee's development machine | ✅ Immediately |
| Scheduled rotation (every 90 days recommended) | ✅ |
| Switching laptops | ❌ Reuse it directly |
| Suspected compromise | ✅ Revoke first |

## Error Codes

| Status Code | Meaning |
|---|---|
| **401** | Token is missing, malformed, or revoked |
| **403** | The team has been suspended by an administrator |
| **429** | Rate limit or quota exceeded. See [Rate Limits](/docs/en/guides/rate-limit) / [Quotas](/docs/en/guides/quota) for details. |

## FAQ

**Q: How many tokens can I have?**
A: There is no hard limit. We recommend using one token per device so that you can revoke access for an individual device.

**Q: Can one token be used with both Claude and GPT-5?**
A: Yes. Tokens are tied to teams, not models.
