How to Use Claude Code with Apertis AI (Step-by-Step Setup)

Why Developers Love Claude Code (And Why It's Limited)

Claude Code is arguably the best AI-powered coding assistant available. It's fast, accurate, understands context deeply, and can handle entire codebases. If you've used it, you get it — it fundamentally changes how you write code.

But there's a catch: by default, Claude Code only uses Claude models. You're locked into Anthropic's infrastructure, one model tier at a time, with no flexibility.

What if you want to:

  • Use GPT-4o for certain tasks (it's better at some things)
  • Try Gemini for multimodal code with images
  • Fall back to DeepSeek V3.2 when Claude is rate-limited
  • Switch between models without leaving the IDE
  • Stay within a monthly budget on coding costs

This is where Apertis changes the game. You can configure Claude Code to route through Apertis's API gateway, giving you access to 500+ models from 30+ providers — all while keeping the same Claude Code interface you love.

Here's how to set it up in 5 minutes.

What You'll Need

  • An Apertis AI account (free to create at apertis.ai)
  • One API key (works for all 500+ models)
  • Claude Code installed (in Cursor, VSCode, or another IDE)
  • 5 minutes

That's it. No credit card required to get started.

Step 1: Sign Up and Get Your Apertis API Key

  1. Go to apertis.ai and sign up (GitHub login recommended)
  2. Navigate to Dashboard → API Keys
  3. Click "Create New API Key"
  4. Copy the key (it starts with sk-)

Your key will look like this:

sk-proj-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Important: This single key works for all 500+ models on Apertis. You don't need separate keys for OpenAI, Google, Anthropic, etc. — one key, unlimited providers.

Step 2: Configure Claude Code

The setup differs slightly depending on which IDE you're using. Here are the three most common:

Option A: Cursor (Recommended)

Cursor has built-in support for custom API endpoints:

  1. Open Settings (Mac: Cmd+, | Windows/Linux: Ctrl+,)
  2. Search for "API Key" and look for the Models section
  3. Set:
    • Base URL: https://api.apertis.ai/v1
    • API Key: Your Apertis API key (starts with sk-)
  4. Restart Cursor

Done. All your models are now available.

Option B: VSCode + Claude Code Extension

  1. Install the Claude Code extension from the VSCode marketplace
  2. Open Settings (Mac: Cmd+, | Windows/Linux: Ctrl+,)
  3. Search for "Claude" and find the Claude Code API section
  4. Set:
    • API Endpoint: https://api.apertis.ai/v1
    • API Key: Your Apertis API key
  5. Restart VSCode

Option C: Command Line / Environment Variables

If you prefer environment variables (works for any IDE or CLI tool):

# Add to your shell profile (~/.zshrc, ~/.bashrc, or ~/.profile)
export ANTHROPIC_API_KEY="sk-your-apertis-key-here"
export ANTHROPIC_BASE_URL="https://api.apertis.ai/v1"

Then restart your terminal or IDE.

Step 3: Select Your Model

Now that Claude Code is connected to Apertis, you can choose which model to use.

In Cursor, click the Model dropdown (usually shows "Claude 3.5 Sonnet" by default). You'll now see all 500+ models available on Apertis:

Claude Models:
  - claude-opus-4-6-20250514         (Most capable, slower)
  - claude-sonnet-4-5-20250514       (Best balance)
  - claude-3-5-haiku-20241022        (Fastest, cheapest)

OpenAI Models:
  - gpt-4o                           (Best reasoning)
  - gpt-4o-mini                      (Fast, cheap)
  - o1                               (Pure reasoning)

Google Models:
  - gemini-2-flash                   (Multimodal)
  - gemini-pro                       (General purpose)

Others:
  - deepseek-v3-2                    (Free, strong)
  - grok-3                           (Web knowledge)
  - [and 490+ more...]

For coding tasks, we recommend:

  • Claude Sonnet 4.5 — Best balance of speed and capability. Use this as your default.
  • Claude Opus 4.6 — When you need maximum reasoning power (debugging complex problems, architecture design)
  • GPT-4o — When Claude is rate-limited or you want a second opinion
  • DeepSeek V3.2 — Free. Use for simple completions, refactoring, formatting
  • Claude Haiku — When you need instant feedback (lightweight linting, formatting suggestions)

Step 4: Test It Works

Create a simple test file to verify everything is connected:

# test.py
def fibonacci(n):
    """Generate the first n Fibonacci numbers."""
    # Ask Claude Code to complete this function

Open the file in your IDE and ask Claude Code to complete the function. If it works, you're golden. If not, check:

  1. Is your API key correct? (Copy-paste from dashboard, no extra spaces)
  2. Is the base URL exactly https://api.apertis.ai/v1? (No trailing slash)
  3. Have you restarted your IDE after setting the key?

Step 5: Pro Configuration (Optional but Recommended)

Enable Caching for Faster, Cheaper Requests

If you're using Claude Sonnet or Opus, enable prompt caching. This drastically reduces costs for repeated analysis of the same codebase:

In Cursor preferences, add:

{
  "claude": {
    "enableCaching": true,
    "cacheControlHeaders": true
  }
}

Use Coding Plan Subscriptions

If Claude Code is your main tool, get a Coding Plan on Apertis for 50% cost savings:

  • Lite: $12/month — 100M input tokens (covers ~8000 typical coding requests)
  • Pro: $25/month — Unlimited tokens + priority support
  • Max: $200/month — For teams or power users

To enable a plan:

  1. Sign in at apertis.ai
  2. Go to Billing → Subscriptions
  3. Choose your plan
  4. All coding requests automatically use the plan's discounted rates

Set a Monthly Budget

Prevent surprise bills:

  1. In Apertis dashboard, go to Settings → Billing
  2. Set your Monthly Budget Limit (e.g., $50)
  3. When you hit the limit, Apertis switches you to free models
  4. You'll get an email alert at 75% of budget

Pro Tips: Getting the Most Out of Claude Code + Apertis

Tip 1: Use Model Suffixes for Advanced Features

Apertis supports special suffixes that modify model behavior:

claude-sonnet-4-5-20250514:web

Add :web to enable web search. Claude Code will research the latest libraries, APIs, and security updates before generating code.

# Claude Code with :web will check the latest React docs
def create_react_component():
    # Uses latest best practices from current React documentation

Tip 2: Switch Models Per-File or Per-Task

You don't have to lock into one model. Switch per file depending on the task:

  • Configuration files → GPT-4o mini (fast, cheap)
  • Complex algorithms → Claude Opus (max reasoning)
  • Quick refactoring → DeepSeek V3.2 (free)
  • Multimodal tasks (code + images) → Gemini 2 Flash

Just click the model dropdown and switch. Your previous context stays loaded.

Tip 3: Monitor Token Usage

In Apertis dashboard, Analytics shows your exact token usage per model:

This week:
- Claude Sonnet: 2.3M input tokens, 450K output tokens
- GPT-4o mini:  1.1M input tokens, 280K output tokens
- DeepSeek:     800K input tokens, 150K output tokens (free)

Use this to optimize: if you're spending 80% on Sonnet but only need 60% of its capability, switch some tasks to mini.

Tip 4: Use Code: Prefix for Cache Billing Optimization

When requesting code generation or analysis, include code: in your prompts. On Apertis, this unlocks special cache billing rules that further reduce costs:

"Analyze this code: ..."  # Regular billing
"code: Analyze this code: ..."  # Cache billing (cheaper for repeated requests)

Sonnet and Opus support code-specific billing. Check your model's specs in the Apertis dashboard.

Common Issues and Fixes

Issue 1: "Invalid API Key"

Solution:

  • Copy your key directly from the Apertis dashboard (don't type it)
  • Make sure there are no leading/trailing spaces
  • Restart your IDE completely (not just close and reopen)

Issue 2: "Connection refused" or "Invalid endpoint"

Solution:

  • Check the base URL is exactly: https://api.apertis.ai/v1
  • Make sure there's NO trailing slash
  • Verify you have internet connectivity (try pinging api.apertis.ai)

Issue 3: Claude Code is slow or timing out

Solution:

  • Switch to a faster model: Claude Sonnet or GPT-4o mini
  • Check your internet connection (Apertis is blazing fast, but network latency matters)
  • If the upstream provider is slow, Apertis automatically fails over — just try again

Issue 4: "Rate limit exceeded"

Solution:

  • This means you've hit your rate limits for that model. Switch to a different model temporarily.
  • With a Coding Plan, you get much higher rate limits. Consider upgrading.
  • Check your usage in Apertis dashboard → Analytics

What Models Work Best with Claude Code

For Speed (Instant Feedback)

  • Claude Haiku (~0.5s response time)
  • GPT-4o mini (~1s)
  • DeepSeek V3.2 (~2s, free)

Best for: Quick linting, formatting, simple completions

For Balanced Performance (Most Use Cases)

  • Claude Sonnet 4.5 (~2-4s, best for coding)
  • GPT-4o (~3-5s)
  • Gemini Flash (~2-3s)

Best for: Code generation, debugging, refactoring, code review

For Maximum Capability (Complex Tasks)

  • Claude Opus 4.6 (~5-10s, most capable)
  • o1 (~10-20s, pure reasoning)

Best for: Complex architecture design, algorithmic problem-solving, multi-file refactoring, security review

Real Example: A Typical Coding Session

Here's how you might use Claude Code + Apertis in practice:

9:00 AM - Start new feature
  Model: Claude Sonnet 4.5
  Task: Scaffold new React component
  Time: 3 seconds, ~2K tokens, $0.03

9:05 AM - Hit a tricky bug
  Model: Claude Opus 4.6 (switched for this task)
  Task: Debug concurrency issue
  Time: 8 seconds, ~15K tokens, $0.25

9:20 AM - Refactor old code
  Model: DeepSeek V3.2 (free)
  Task: Clean up technical debt
  Time: 4 seconds, ~8K tokens, $0.00

9:45 AM - Write unit tests
  Model: Claude Sonnet (back to default)
  Task: Generate test cases
  Time: 5 seconds, ~12K tokens, $0.04

Daily total: ~37K tokens, ~$0.32 (or free with Lite plan)

Compare to direct Claude API:

Direct Anthropic API: $0.32
Apertis PAYG: $0.32
Apertis Lite Plan: Free (covered by $12/month)
Savings with plan: $9.68/day = $290/month

Next Steps

  1. Sign up at apertis.ai (takes 2 minutes)
  2. Get your API key from the dashboard
  3. Configure your IDE (5 minutes)
  4. Test with a simple code task
  5. (Optional) Subscribe to a Coding Plan for maximum savings

You'll immediately have access to 500+ models, while keeping the Claude Code experience you love. No lock-in. No complexity. Just better flexibility and lower costs.

The best part? Start free. No credit card required. Try it with free models (DeepSeek, Gemini Flash) for as long as you want before committing to a paid plan.

Ready to unlock Claude Code's full potential? Get started with Apertis AI today.