メインコンテンツへスキップ
すべてのクライアント
OpenAI Responses Native · Profile Mode1M Context · ZDR

Codex

専用の bf16 プロファイルで OpenAI の Codex エージェントを実行します。

ベースURL
https://api.bf16.ai/v1
プロトコル
openai-responses

対象ユーザー
既存の Codex 設定を残したまま、別プロファイルで使い分けたいユーザー向け。

アーキテクチャと bf16.ai 連携の利点

OpenAI Codex CLI (~/.codex/bf16.config.toml) connected to https://api.bf16.ai/v1 via stateless OpenAI Responses API
Codex CLI uses wire_api = "responses" against https://api.bf16.ai/v1 on an isolated --profile bf16 without altering your default ChatGPT login.

OpenAI’s terminal coding agent (`@openai/codex`) speaks the modern OpenAI `/v1/responses` wire format rather than legacy `/v1/chat/completions`. Many third-party OpenAI-compatible relays fail with HTTP 404 or 400 when Codex sends `input` items, `function_call_output`, and reasoning summaries.

bf16.ai implements a full stateless `/v1/responses` endpoint on https://api.bf16.ai/v1, allowing Codex CLI to stream reasoning items, shell tool calls, and `apply_patch` diffs cleanly on an isolated `--profile bf16` configuration.

コマンドには $BF16_API_KEY と表示されています。サインインすると自分のキーが自動入力されます。

ワンコマンド設定

One-Command Codex `--profile bf16` Installer

Creates ~/.codex/bf16.config.toml, stores BF16_API_KEY in ~/.bf16.env (chmod 600), and verifies /v1/models so you can immediately run codex -c ~/.codex/bf16.config.toml --profile bf16.

export BF16_API_KEY="sk-bf16-v1-..."
mkdir -p ~/.codex && umask 077 && printf 'export BF16_API_KEY="%s"\n' "$BF16_API_KEY" > ~/.bf16.env
cat <<'EOF' > ~/.codex/bf16.config.toml
# ~/.codex/bf16.config.toml  (Codex 0.134+ profile file)
model = "deepseek/deepseek-v4.1-flash-uncensored"
model_provider = "bf16"
model_context_window = 1048576
model_auto_compact_token_limit = 900000

[model_providers.bf16]
name = "bf16.ai"
base_url = "https://api.bf16.ai/v1"
wire_api = "responses"
env_key = "BF16_API_KEY"
EOF
curl -fsS "https://api.bf16.ai/v1/models" -H "Authorization: Bearer $BF16_API_KEY" >/dev/null && echo "Ready! Run: codex -c ~/.codex/bf16.config.toml --profile bf16"
  1. 1

    APIキーをエクスポート

    プロファイルは環境変数 BF16_API_KEY を参照します。

    export BF16_API_KEY=sk-bf16-v1-...
  2. 2

    プロファイル設定ファイルを作成

    ~/.codex/bf16.config.toml
    # ~/.codex/bf16.config.toml  (Codex 0.134+ profile file)
    model = "deepseek/deepseek-v4.1-flash-uncensored"
    model_provider = "bf16"
    model_context_window = 1048576
    model_auto_compact_token_limit = 900000
    
    [model_providers.bf16]
    name = "bf16.ai"
    base_url = "https://api.bf16.ai/v1"
    wire_api = "responses"
    env_key = "BF16_API_KEY"
  3. 3

    プロファイルを指定して Codex を起動

    デフォルトの `codex` プロファイルはそのまま維持されます。

    mkdir -p ~/.codex
    cat > ~/.codex/bf16.config.toml <<'EOF'
    model = "deepseek/deepseek-v4.1-flash-uncensored"
    model_provider = "bf16"
    model_context_window = 1048576
    model_auto_compact_token_limit = 900000
    [model_providers.bf16]
    name = "bf16.ai"
    base_url = "https://api.bf16.ai/v1"
    wire_api = "responses"
    env_key = "BF16_API_KEY"
    EOF
    codex --profile bf16
Codex CLI — ~/.codex/bf16.config.toml
設定フィールド一覧
~/.codex/config.toml · [profiles.bf16] + [model_providers.bf16]

入力パラメータ早見表

base_url
https://api.bf16.ai/v1
env_key
BF16_API_KEY

Codex reads $BF16_API_KEY from your shell at launch.

wire_api
"responses"

Uses native /v1/responses streaming on api.bf16.ai.

Launch Command
codex -c ~/.codex/bf16.config.toml --profile bf16
Your default `codex` command and OpenAI account login remain completely untouched.

用途別おすすめモデル構成

設計・監査には Flagship モデル、並列サブタスクや画面認識には Flash モデルを組み合わせます。

役割モデル ID選定理由USD / 1M トークン
Fast Patch & Shell Execution (Default)deepseek/deepseek-v4.1-flash-uncensoredRapid tool cycles + Vision support for UI debugging inside Codex.$0.26 in / $0.045 cached / $1.00 out
Deep Multi-File Refactoringzai-org/glm-5.3-uncensoredSwitch model = "zai-org/glm-5.3-uncensored" in [profiles.bf16] for complex architecture or security audit sessions.$1.35 in / $0.25 cached / $4.20 out

正しく動いているか確認する方法

  • 起動時に bf16 プロバイダが表示されます。
  • コンソールのリクエストログに呼び出しが記録されます。
  • curl https://api.bf16.ai/v1/models -H "Authorization: Bearer $BF16_API_KEY"

本番運用の安全策と予算上限

  • Keep Codex sandbox approvals enabled (`suggest` or `auto-edit` inside git worktrees) so file writes outside your project require confirmation.
  • Export BF16_API_KEY before launching Codex — Codex reads env_key at process startup.

よくあるエラー

症状
プロファイルが反映されない。
原因
--profile bf16 を付けずに起動しています。
対処法
--profile bf16 を付けて起動するか、同じ設定を ~/.codex/config.toml に直接記載してください。
症状
未対応の wire format として 400 エラーになる。
原因
wire_api が未設定か chat になっています。
対処法
上記の通り wire_api = "responses" を指定してください。

まだインストールしていませんか?

npm install -g @openai/codex
公式ドキュメント