# OpenAI Codex — CryptoDataAPI

> Add live crypto market data to OpenAI Codex: install the CryptoDataAPI Agent Skill and add the MCP server to ~/.codex/config.toml (stdio bridge). Free tier.

Give **OpenAI Codex CLI** live crypto market data — prices, funding, open interest, liquidations, market regimes, Fear & Greed, dealer gamma and whale activity — as native MCP tools.

Two parts: the **Agent Skill** (knowledge) and the **[MCP server](/ai-agents/mcp-server)** (live tools). Codex stores MCP servers in `~/.codex/config.toml` as `[mcp_servers.<name>]` tables; the transport is chosen by which keys you set (`command` = stdio, `url` = streamable HTTP).

- **Vendor:** OpenAI
- **Agent docs:** https://developers.openai.com/codex/mcp
- **Config:** `~/.codex/config.toml`
- **MCP transports:** stdio, http (streamable)
- **Skill directory:** `.agents/skills/ (skills CLI)`

## Step 1 — Install the Agent Skill

Install the skill with the skills CLI. For Codex, skills install under the agent skills directory (`.agents/skills/`); the CLI handles placement. See the [Agent Skill page](/ai-agents/agent-skill) for what's inside.

**Terminal:**
```bash
npx skills add Crypto-Data-API/cryptodataapi-skills -g -y
```

## Step 2 — Connect the MCP server

The reliable path on Codex is the **stdio bridge** — the `cryptodataapi-mcp` npm package, which carries your key in the `CRYPTODATA_API_KEY` env var (needs Node.js). Add it with the CLI, or hand-edit `~/.codex/config.toml`.

Codex also supports remote **streamable-HTTP** servers (a `url` key), but its HTTP auth is oriented around a bearer-token env var, so passing our custom `X-API-Key` header isn't cleanly supported on every version — prefer stdio unless your Codex build documents custom HTTP headers.

**CLI (stdio):**
```bash
codex mcp add cryptodataapi \
  --env CRYPTODATA_API_KEY=cdk_live_YOUR_KEY \
  -- npx -y cryptodataapi-mcp
```

**~/.codex/config.toml:**
```toml
[mcp_servers.cryptodataapi]
command = "npx"
args = ["-y", "cryptodataapi-mcp"]
env = { CRYPTODATA_API_KEY = "cdk_live_YOUR_KEY" }
```

## Step 3 — Try these prompts

Start Codex and confirm the server loaded (`/mcp` or `codex mcp list`). Then ask for a market read — see the example prompts below.

## Example prompts

- "What's the current market regime and which strategy baskets fit it?"
- "Compare BTC funding rates across exchanges and flag crowded positioning."
- "Which coins have the highest liquidation risk right now?"
- "Pull the daily snapshot and generate a Python backtest scaffold from it."
- "Is dealer gamma amplifying or dampening BTC moves today?"

## FAQ

### Does it cost anything?

No. The skill is free and the **Free** API tier (no card) covers the whole market-wide picture. Per-coin quant, gamma and whale signals need [Pro](/pricing).

### Where does my API key live?

In the `env` of the `[mcp_servers.cryptodataapi]` table in `~/.codex/config.toml` (or the `--env` you pass to `codex mcp add`). The bridge sends it as `X-API-Key` on each call.

### The HTTP server won't initialize — what now?

Some Codex builds have had trouble initializing streamable-HTTP MCP servers, and our auth uses a custom header rather than a bearer token. If the remote form misbehaves, switch to the **stdio** config above — it's the dependable path on Codex. Also confirm Node.js is installed so `npx` can run the bridge.

## Related

- [MCP Server](https://cryptodataapi.com/ai-agents/mcp-server)
- [Agent Skill](https://cryptodataapi.com/ai-agents/agent-skill)
- [Gemini CLI setup](https://cryptodataapi.com/ai-agents/gemini-cli)
- [Claude Code setup](https://cryptodataapi.com/ai-agents/claude-code)
- [REST API docs](https://cryptodataapi.com/api/docs)

---

Canonical: https://cryptodataapi.com/ai-agents/openai-codex
Machine-readable API map: https://cryptodataapi.com/llms.txt
Agent skill repo: https://github.com/Crypto-Data-API/cryptodataapi-skills (`npx skills add Crypto-Data-API/cryptodataapi-skills -g -y`)
Free API key (no signup): POST https://cryptodataapi.com/api/v1/auth/keys {"email":"you@example.com"}
