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

# API keys and credential safety

> Create, store, rotate, and protect API keys for 0xArchive REST, WebSocket, SDK, CLI, Skill, and API-key agent workflows; hosted MCP uses client-managed OAuth.

Create an API key, keep it out of code and browsers, and rotate it when access changes. One key works for the REST API, WebSocket, the SDKs, the CLI, the Agent skill, and other API-key agent workflows. The hosted MCP server is the exception: it uses OAuth managed by your client and needs no 0xArchive API key.

**Create a key for your project**

Set up your key in the dashboard, then keep it in your runtime environment or secret store as you follow the steps below.

[Create a key](https://0xarchive.io/dashboard?utm_source=docs\&utm_medium=referral\&utm_campaign=docs_referral\&utm_content=authentication_dashboard_link)

## Key lifecycle

**1. Create a key in the dashboard**

Create and manage keys in the [0xArchive dashboard](https://0xarchive.io/dashboard?utm_source=docs\&utm_medium=referral\&utm_campaign=docs_referral\&utm_content=authentication_dashboard_link). New accounts start on the Free tier.

**2. Store it outside source control**

Load the key from an environment variable or secret manager. Never place it in checked-in code, notebooks, prompts, logs, screenshots, or public issue text.

**3. Pass it the way each client expects**

The REST API takes the key in an HTTP header. WebSocket takes it during connection setup. The SDKs, CLI, Agent skill, and API-key agent workflows read it from their runtime environment. The hosted MCP server uses the client's built-in OAuth flow instead and needs no 0xArchive API key.

**4. Rotate when access changes**

Replace a key when a workflow, machine, environment, or teammate no longer needs access.

## If sign-in or key creation fails

Create and manage keys in the [dashboard](https://0xarchive.io/dashboard). If sign-in returns you to the same screen or key creation fails, email [support@0xarchive.io](mailto:support@0xarchive.io) with the time of the attempt, the failed step and the visible error text. These details let the team investigate without seeing your credentials. Do not send an API key, password or OAuth token.

Hosted MCP connects through the client's OAuth flow and needs no 0xArchive API key. A key-creation problem and an MCP authorization problem therefore have different recovery steps; use [MCP troubleshooting](https://docs.0xarchive.io/mcp-server.md#troubleshooting) for the latter.

## Where each client reads the key

| Client | How it gets the key |
| - | - |
| REST API | Read `OXARCHIVE_API_KEY` from the runtime environment and send it as `X-API-Key`. See [REST authentication](https://docs.0xarchive.io/rest-api/authentication.md) |
| WebSocket | Send the same API key during connection setup. See [WebSocket connection](https://docs.0xarchive.io/websocket/connection.md) |
| SDKs | Pass the key when you construct the client. See [SDK installation](https://docs.0xarchive.io/sdks/installation.md) |
| CLI | Export `OXA_API_KEY` for `oxa` commands. See [CLI](https://docs.0xarchive.io/cli.md) |
| Agent skill | Pass `OXARCHIVE_API_KEY` through the host environment or secret store. See [Agent skill](https://docs.0xarchive.io/skill.md) |
| Hosted MCP server | OAuth managed by your client; no 0xArchive API key. See [MCP server](https://docs.0xarchive.io/mcp-server.md) |
| Browser applications | Call your own backend; never expose a 0xArchive key to users. See [WebSocket connection](https://docs.0xarchive.io/websocket/connection.md) |

## Separate keys by environment

Use a different key for local development, CI, staging, production, and agent or tooling work where you can. Separate keys make rotation and incident diagnosis safer, and a leaked development key cannot expose a production workflow.

## Keep keys out of the browser

Do not embed a 0xArchive API key in frontend JavaScript or ship it to a browser. A browser application should call a backend you control. That backend holds the key, enforces user-level access, and keeps the credential out of browser URLs, telemetry, and copied prompts.

## Wallet verification

SIWE verifies wallet ownership for account and credential flows. It is not the default authentication method for market-data calls. Existing-wallet verification starts with `/v1/auth/web3/challenge`, then submits the signed message to `POST /v1/auth/web3/verify`. Follow [SIWE verification](https://docs.0xarchive.io/wallet-automation.md) for the complete wallet flow.

0xArchive never requests private keys or seed phrases, cannot move funds, cannot approve transactions, and cannot place or cancel venue orders.

## Next step

**Put your key to work**

Make the BTC order-book request and see how your key, response and request ID fit together.

[Make a request](https://docs.0xarchive.io/quickstart.md)


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