# Claude Code と Codex の設定

Claude Code と Codex のモデル呼び出しを Felo API Platform 経由に設定します。

This guide shows how to route Claude Code or Codex model calls through Felo API Platform LLM API instead of calling a model vendor directly.

::: warning Felo API credits are required
Felo のモデル呼び出しは **Felo API Platform の前払いサービス残高**から課金されます。**Felo Pro のサブスクリプションには API/モデル利用分は含まれず**、これらの呼び出しには使えません。最初のリクエスト前に [Console Billing](https://openapi.felo.ai/console/billing) でチャージしてください。
:::

```bash
export FELO_API_KEY="YOUR_API_KEY"
```

## Supported Client Paths

| Client or API surface | Recommended Felo endpoint | Model example | Notes |
|-----------------------|---------------------------|---------------|-------|
| Claude Code | `POST /api/v1/messages` | `claude-sonnet-5` | Uses Anthropic Messages wire format. |
| Codex | `POST /api/v1/responses` | `gpt-5.6-sol` | Custom providers should use Responses API. |
| Chat Completions | `POST /api/v1/chat/completions` | `gpt-5.6-sol` | Useful for SDKs and server-side integrations. |

## Claude Code

```bash
export ANTHROPIC_API_KEY="$FELO_API_KEY"
export ANTHROPIC_BASE_URL="https://openapi.felo.ai/api"
export ANTHROPIC_MODEL="claude-sonnet-5"

claude
```

## Codex

Add a Felo provider to `~/.codex/config.toml`.

```toml
model_provider = "felo"
model = "gpt-5.6-sol"

[model_providers.felo]
name = "Felo API Platform LLM API"
base_url = "https://openapi.felo.ai/api/v1"
env_key = "FELO_API_KEY"
wire_api = "responses"
```

Keep API keys in your shell or secret manager.

## Billing and credits

Felo のモデル呼び出しは Felo Pro とは別に前払いです。Felo Pro のサブスクリプションに API クレジットは含まれません。残高は [Console Billing](https://openapi.felo.ai/console/billing) で確認・チャージできます。残高不足時は `402 INSUFFICIENT_CREDITS` が返ります。
