> ## Documentation Index
> Fetch the complete documentation index at: https://veniceai-mintlify-6ce01df5.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Codex CLI

> OpenAI Codex CLI mit Venice AI-Modellen über eine lokale config.toml-Datei verwenden

Diese Anleitung zeigt, wie du OpenAI Codex CLI mit Venice betreibst, indem du die offiziellen Codex-Konfigurationspfade verwendest: `~/.codex/config.toml` (Benutzerebene) oder `.codex/config.toml` (Projektebene).

<CardGroup cols={3}>
  <Card title="Einfaches Setup" icon="gear">
    Eine Konfigurationsdatei in deinem Projekt
  </Card>

  <Card title="OpenAI-kompatibel" icon="plug">
    Verwendet Venices OpenAI-kompatible API
  </Card>

  <Card title="Modell-Flexibilität" icon="microchip">
    Tausche jedes unterstützte Venice-Textmodell ein
  </Card>
</CardGroup>

***

## Voraussetzungen

* Ein Venice API-Schlüssel von [venice.ai/settings/api](https://venice.ai/settings/api)
* Codex CLI installiert und einsatzbereit auf deinem Rechner

***

## Einrichtung

<Steps>
  <Step title="Projekt-Konfigurationspfad anlegen">
    Vom Projekt-Root aus:

    ```bash theme={"system"}
    mkdir -p .codex
    ```
  </Step>

  <Step title=".codex/config.toml erstellen">
    Erstelle die Datei und füge die folgende Konfiguration ein:

    ```toml theme={"system"}
    #:schema https://developers.openai.com/codex/config-schema.json

    model = "openai-gpt-54" # verwende ein beliebiges Venice-Modell
    model_provider = "venice"
    model_reasoning_effort = "high"
    personality = "pragmatic"
    sandbox_mode = "workspace-write"

    [model_providers.venice]
    name = "Venice"
    base_url = "https://api.venice.ai/api/v1/"
    experimental_bearer_token = "YOUR VENICE API KEY"
    wire_api = "responses"
    ```
  </Step>

  <Step title="Beide Platzhalter ersetzen">
    Aktualisiere:

    * `model` mit der Venice-Modell-ID, die du nutzen möchtest
    * `experimental_bearer_token` mit deinem echten Venice API-Schlüssel

    Verfügbare Modell-IDs findest du im [Textmodell-Katalog](/models/text).
  </Step>

  <Step title="Codex CLI ganz normal starten">
    Starte Codex CLI im selben Projekt. Es lädt `.codex/config.toml` (für vertrauenswürdige Projekte) und leitet Anfragen über Venice.
  </Step>
</Steps>

***

## Offizielle Speicherorte der Codex-Konfiguration

* **Benutzer-Defaults**: `~/.codex/config.toml`
* **Projekt-Overrides**: `.codex/config.toml` (wird nur für vertrauenswürdige Projekte geladen)

Wenn Venice-Einstellungen überall gelten sollen, lege dieselbe Konfiguration in `~/.codex/config.toml` ab.

***

## Konfigurations-Vorrang (Höchster zuerst)

1. CLI-Flags und `--config`-Overrides
2. Profilwerte (`--profile <name>`)
3. Projektkonfigurations-Ebenen (`.codex/config.toml`, das nächstgelegene Verzeichnis gewinnt)
4. Benutzerkonfiguration (`~/.codex/config.toml`)
5. System-Konfiguration (`/etc/codex/config.toml`, Unix)
6. Eingebaute Defaults

***

## Hinweise

* Halte deinen API-Schlüssel privat und committe niemals echte Schlüssel nach git.
* Codex ignoriert die Projekt-`.codex/`-Konfiguration, wenn ein Projekt als nicht vertrauenswürdig markiert ist.
* Wenn du Modelle wechselst, aktualisiere nur das Feld `model`.
* Die Einstellung `wire_api = "responses"` ist für dieses Provider-Setup erforderlich.

***

## Ressourcen

<CardGroup cols={2}>
  <Card title="Venice API-Referenz" icon="book" href="/api-reference/api-spec">
    Vollständige Endpoint- und Parameter-Dokumentation
  </Card>

  <Card title="Venice Textmodelle" icon="list" href="/models/text">
    Verfügbare Modell-IDs
  </Card>
</CardGroup>
