Zum Hauptinhalt springen
Alle Clients
OpenAI Responses Native · Profile Mode1M Context · ZDR

Codex

OpenAIs Coding-Agent auf einem separaten bf16-Profil.

Basis-URL
https://api.bf16.ai/v1
Protokoll
openai-responses

Für wen gedacht
Codex-Nutzer, die ein zweites Profil statt eines Austauschs wünschen.

Architektur & Zusammenspiel mit 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.

In den Befehlen steht $BF16_API_KEY. Melden Sie sich an, um Ihren eigenen Schlüssel automatisch einzusetzen.

1-BEFEHL-SETUP

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

    Schlüssel exportieren

    Das Profil liest die Umgebungsvariable BF16_API_KEY.

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

    Profildatei anlegen

    ~/.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 damit starten

    Ihr Standardprofil für `codex` bleibt unangetastet.

    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
KONFIGURATIONS-INSPEKTOR
~/.codex/config.toml · [profiles.bf16] + [model_providers.bf16]

Feld-für-Feld-Referenz

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.

Empfohlene Modell-Aufteilung

Planung über Flagship-Modelle, schnelle Subtasks und Screenshots über Flash-Modelle.

RolleModell-IDEinsatzgrundUSD / 1M Tokens
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

So prüfen Sie, ob es funktioniert

  • Codex meldet beim Start den Anbieter bf16.
  • Die Anfrage erscheint in den Konsolen-Logs.
  • curl https://api.bf16.ai/v1/models -H "Authorization: Bearer $BF16_API_KEY"

Produktions-Guardrails & Budget-Limits

  • 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.

Häufige Fehler

Symptom
Codex ignoriert das Profil.
Ursache
Start erfolgte ohne --profile bf16.
Lösung
--profile bf16 übergeben oder die Felder direkt nach ~/.codex/config.toml übernehmen.
Symptom
400 wegen nicht unterstütztem Wire-Format.
Ursache
wire_api fehlt oder steht auf chat.
Lösung
wire_api = "responses" wie im Profil oben verwenden.

Noch nicht installiert?

npm install -g @openai/codex
Offizielle Dokumentation