ccapi
🇺🇸English
  • 🇨🇳简体中文
  • 🇺🇸English
Home
Home
🇺🇸English
  • 🇨🇳简体中文
  • 🇺🇸English
🇺🇸English
  • 🇨🇳简体中文
  • 🇺🇸English
    • OpenClaw + CCAPI LLM Integration Guide
    • claude code integration
    • codex cli integration
    • gemini cli integration
    • Chat
      • OpenAI
        • Create Chat Completion
        • Create Response
      • Google
        • Generate Content
        • Stream Generate Content
      • Anthropic
        • Create Message
      • DeepSeek
        • Create Chat Completion
      • MiniMax
        • Create Chat Completion
    • Image
      • nano banana
        • Generate Image
      • z-image-turbo
        • integration docs
      • seedream
        • integration doc
    • Video
      • seedance
      • vidu
    • Audio
      • Producer
        • Generate Music
        • Generate Lyrics
        • Extend Music
        • Create Cover
        • Create Variation
        • Replace Segment
        • Vocals Swap
        • Instrumentals Swap
        • Stem Separation
        • Download Audio
        • Upload Audio
        • Generate Video
        • Fetch Task Status
        • Batch Fetch Tasks
      • Suno
        • Generate Music
        • Fetch Task Status
        • Generate Lyrics
        • Extend Music
        • Create Cover
        • Extract Stems
        • Extract All Stems
        • Add Vocals
        • Add Instrumental
        • Replace Section
        • Remaster Song
        • Mashup
        • Sample Section
        • Generate Sounds
        • Generate MIDI
        • Upload Audio
        • Concatenate Music
        • Get Aligned Lyrics
        • Generate Music Video
        • Export as WAV
        • Create Voice Persona(unavailable)
        • Detect BPM
        • Extract Vocals
        • Upsample Tags
        • Batch Fetch Tasks

    codex cli integration

    How to Integrate CCAPI into Codex CLI#

    This guide helps you connect OpenAI Codex CLI to CCAPI, allowing you to use OpenAI models at a lower price.
    Codex CLI is OpenAI's open-source AI coding CLI tool, supporting code generation, debugging, shell operations, file management, and more.

    Prerequisites#

    1.
    Codex CLI installed — npm install -g @openai/codex
    2.
    CCAPI account — sign up at ccapi.ai (Google login supported)
    3.
    CCAPI token — create one at Console > Tokens

    Step 1: Get Your CCAPI Token#

    1.
    Go to ccapi.ai and sign up / log in
    2.
    Navigate to Console > Tokens
    3.
    Click Create Token, copy the key (shown only once)

    Step 2: Configure Codex CLI#

    Method A: Environment Variables (Quickest)#

    Set one environment variable to point Codex to CCAPI:
    Add to ~/.bashrc or ~/.zshrc and restart your terminal.

    Method B: Config File (Recommended)#

    Edit ~/.codex/config.toml:
    model = "gpt-4o"
    model_provider = "ccapi"
    
    [model_providers.ccapi]
    name = "CCAPI Gateway"
    base_url = "https://api.ccapi.ai/v1"
    env_key = "CCAPI_API_KEY"
    wire_api = "responses"
    Then set the environment variable:

    Step 3: Choose a Model#

    CCAPI supports the following OpenAI models at as low as 10% of official pricing:
    ModelDescription
    gpt-4oMultimodal flagship, proven quality
    gpt-4.11M context window
    gpt-5-miniGPT-5 family, balanced
    gpt-5-nanoUltra-low cost
    gpt-4o-miniBest value
    gpt-5.4Latest and strongest
    Switch models:
    For the full model list and real-time pricing, visit Model Market.

    Step 4: Verify#

    If it responds normally, the setup is complete. You can check call logs at Console > Logs.

    Troubleshooting#

    ProblemSolution
    Connection timeoutConfirm OPENAI_BASE_URL is set to https://api.ccapi.ai/v1 (note the /v1)
    Invalid tokenCheck token status at Console
    Insufficient balanceTop up at Console > Top Up
    Model not foundCheck model name spelling. View available models at Model Market

    Quick Reference#

    Base URL: https://api.ccapi.ai/v1
    Auth env var: OPENAI_API_KEY or custom env_key
    Config file: ~/.codex/config.toml
    Model Market: ccapi.ai/pricing
    Console: ccapi.ai/console
    修改于 2026-03-26 06:57:34
    上一页
    claude code integration
    下一页
    gemini cli integration
    Built with