Q&A · Updated

How to choose an AI coding API relay

When choosing an AI coding API relay, check six things: billing, whether the balance expires, which tools and models it supports, whether setup is just a global config change, whether you can switch channels, and who supports you. Going direct suits people who can reliably use official accounts and payment; a relay suits people who want to pay per token and use one key across tools. AICodeWith is pay as you go, the balance stays valid for 12 months with no monthly reset, and the Base URL is https://api.aicodewith.ai.

Symptoms

SymptomLikely causeWhat to do
Subscription quota runs out, you wait for resetsSubscriptions cap usage per windowConsider a pay-as-you-go API key
You use Claude Code, Codex and other toolsEach tool needs its own subscriptionPick a relay where one key covers several tools
Official payment or region is restrictedOfficial payment and region limitsCheck the relay's payment options and supported regions
Worried about unused balance expiringSome services reset monthlyCheck balance validity; AICodeWith balance lasts 12 months

Official vs relay

Official directAPI relay (AICodeWith)
BillingSubscription or official API billingPay as you go, no monthly or yearly plan
BalanceOfficial rulesValid for 12 months, no monthly reset
ToolsOne account per vendorOne key for Claude Code, Codex, OpenCode, Cline, Cursor and more
SetupAccount login or official keyBase URL and key in the global config
ChannelsSingle official routeSeveral channels per model with different prices and routes

Minimal setup: point your global config at AICodeWith

Only the global config changes; project files stay as they are. Other tools: integration guides.

  1. 1. Create a key

    Sign up, open API Keys in the dashboard and create a key. See how to get an API key.

  2. 2. Edit Claude Code's global config

    Open the global config ~/.claude/settings.json, put the Base URL and key in env, save and restart Claude Code. The Base URL is the bare domain, with no /v1.

    ~/.claude/settings.json
    {
      "env": {
        "ANTHROPIC_BASE_URL": "https://api.aicodewith.ai",
        "ANTHROPIC_AUTH_TOKEN": "sk-你的Key"
      }
    }
    
  3. 3. Verify

    Run claude, then /status. If the Base URL shows https://api.aicodewith.ai, you are connected.

Channel tips

  • Pay as you go, no monthly or yearly plan: top up a balance and pay per token used. The balance stays valid for 12 months and does not reset monthly.
  • One model can run through several channels with different prices (discounts) and routes. New accounts have the recommended channels on by default.
  • If one channel errors or slows down, switch to another channel for the same model in the dashboard. See the pricing page for current prices.

Get connected now

Sign up, create a key and edit your global config as shown above.

FAQ

Are relay models the same as official ones?

Requests go to the corresponding model APIs; see the models page for names and availability.

Can a relay guarantee account safety?

We make no promises about bans or official account status; the relay never logs in to your official account.

Should the Base URL include /v1?

For Claude Code use https://api.aicodewith.ai with no /v1. A few tools need a specific path; follow their setup guide.

Does the balance expire?

The balance stays valid for 12 months and does not reset monthly.

How do I set up other tools?

See the integration guides for Codex, OpenCode, Cline, Cursor and more.

Updated: