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

    claude code integration

    How to Integrate CCAPI into Claude Code#

    This guide helps you connect Claude Code (Anthropic's official AI coding assistant) to CCAPI, allowing you to use Claude models at a lower price.
    Claude Code is Anthropic's AI coding CLI tool, supporting code generation, debugging, refactoring, Git operations, and more.

    Prerequisites#

    1.
    Claude Code installed — refer to the official docs for installation
    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 Claude Code#

    Method A: Config File (Recommended)#

    Edit ~/.claude/settings.json and add:
    {
      "env": {
        "ANTHROPIC_BASE_URL": "https://api.ccapi.ai",
        "ANTHROPIC_API_KEY": "your-ccapi-token"
      }
    }
    Note: Do not append /v1 to the Base URL. Claude Code automatically appends /v1/messages.

    Method B: Environment Variables#

    Add to ~/.bashrc or ~/.zshrc:
    Restart your terminal for changes to take effect.

    Step 3: Choose a Model (Optional)#

    CCAPI supports the following Claude models at as low as 20% of official pricing:
    ModelDescription
    claude-sonnet-4-6Latest Sonnet, balanced choice
    claude-opus-4-6Latest Opus, highest quality
    claude-haiku-4-5-20251001Haiku, fastest and cheapest
    claude-sonnet-4-5Sonnet 4.5
    claude-opus-4-5Opus 4.5
    You can specify default models in settings.json:
    {
      "env": {
        "ANTHROPIC_BASE_URL": "https://api.ccapi.ai",
        "ANTHROPIC_API_KEY": "your-ccapi-token",
        "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-6",
        "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-6",
        "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5-20251001"
      }
    }
    For the full model list and real-time pricing, visit Model Market.

    Step 4: Verify#

    Launch Claude Code:
    Test with a simple prompt:
    Hello, please introduce yourself
    If it responds normally, the setup is complete. You can check call logs at Console > Logs.

    Troubleshooting#

    ProblemSolution
    model not found errorModel names must be typed in full (e.g. claude-sonnet-4-6). Not appearing in the auto-list is normal
    Base URL path errorEnsure it's set to https://api.ccapi.ai without /v1
    Invalid tokenCheck token status at Console
    Insufficient balanceTop up at Console > Top Up

    Quick Reference#

    Base URL: https://api.ccapi.ai (without /v1)
    Auth env var: ANTHROPIC_API_KEY
    Config file: ~/.claude/settings.json
    Model Market: ccapi.ai/pricing
    Console: ccapi.ai/console
    修改于 2026-03-26 06:57:11
    上一页
    OpenClaw + CCAPI LLM Integration Guide
    下一页
    codex cli integration
    Built with