All resources
Prompt·4 min read·Claude Code·Apinex

Run Claude Code on Free AI Models With Apinex (One Prompt)

Apinex is one API with a whole category of free models. Grab a free key, paste the prompt below into Claude Code, and it sets everything up for you.

What you get

Apinex puts a lot of AI models behind one key and one address. It has a free category, over 20 models at $0 per token right now, including GPT-6 Luna, DeepSeek V4, GLM 5.3, Kimi K3, Claude Sonnet 4.6 and Gemini 3.1 Pro.

It also works with Claude Code out of the box. So Claude Code runs on those free models with the exact same commands you already use.

Perfect for side projects and AI agents you want running all day.

Step 1: Grab your free key

⚡ Open Apinex and make your free key

  1. Tap here to open Apinex and sign up with Google or Telegram. No card needed.
  2. Go to Dashboard, then API Keys, and create a key.
  3. Copy it. It starts with sk-apx.

Step 2: Paste this into Claude Code

Open Claude Code in any folder. Paste this, put your key where it says PASTE_YOUR_KEY_HERE, and send it.

Boom. It tests your key, keeps the free models that answer, backs up your settings and wires everything up. It even tells you how many free tokens you have today.

Copy-paste this
Set up Claude Code to run on Apinex's free models for me. My Apinex key is: PASTE_YOUR_KEY_HERE

Apinex works with Claude Code directly. Its base URL is https://api.apinex.bond and it takes the key as a Bearer token. Do this one step at a time and show me what happened:

1. Test my key. Call https://api.apinex.bond/v1/models with the header "Authorization: Bearer <my key>" and list every model id that starts with free/.
2. Send a tiny test message (max_tokens 16) through https://api.apinex.bond/v1/messages to each of these and note which ones answer: free/claude-opus-4.6, free/deepseek-v4-pro-0813, free/kimi-k3, free/gpt-6-luna, free/claude-sonnet-4.6, free/glm-5.3, free/glm-5.3-flash, free/deepseek-v4.1-flash, free/gemini-3.8-flash.
3. Back up my Claude Code user settings (~/.claude/settings.json, or %USERPROFILE%\.claude\settings.json on Windows) to settings.json.bak in the same folder. Create the settings file if it doesn't exist.
4. Add these to the "env" block of that file and leave everything else in it exactly as it is:
   ANTHROPIC_BASE_URL = https://api.apinex.bond
   ANTHROPIC_AUTH_TOKEN = my key
   ANTHROPIC_DEFAULT_OPUS_MODEL = the first of free/claude-opus-4.6, free/deepseek-v4-pro-0813, free/kimi-k3 that answered
   ANTHROPIC_DEFAULT_SONNET_MODEL = the first of free/gpt-6-luna, free/claude-sonnet-4.6, free/glm-5.3 that answered
   ANTHROPIC_DEFAULT_HAIKU_MODEL = the first of free/glm-5.3-flash, free/deepseek-v4.1-flash, free/gemini-3.8-flash that answered
   Then set "model" to the Sonnet pick. Only ever use free/ model ids, never a paid one.
5. If ANTHROPIC_API_KEY is set anywhere on my system, tell me, because it can get in the way of this.
6. Call https://api.apinex.bond/v1/subscription with my key and tell me my daily free allowance, how much is left today and when it resets.
7. Tell me to restart Claude Code, how to switch between the free models with /model, and how to switch back by restoring settings.json.bak.

Never print my full key back to me, and never send it anywhere except api.apinex.bond.

Step 3: Restart and pick a model

Close Claude Code and open it again. That's it, it's running on Apinex now.

  • Type /model to switch between the free models it picked.
  • For any other free model, type its id, like /model free/kimi-k3. The full list is on Apinex's models page.
  • Your normal setup is saved in settings.json.bak, so you can always go back.

How much is actually free

The free models cost $0 per token. They run on a daily token allowance that resets every day, and Apinex sets that number.

Right now Apinex says a one-time top-up of $5 or more unlocks 25M free tokens a day, and the free allowance needs a daily check-in in your dashboard. The prompt above prints your real allowance, so you never have to guess.

Paid models like Claude Opus 5.5 bill a prepaid wallet instead. The prompt only ever sets free models, never a paid one.

Keep your private info off of it

Apinex is a third-party gateway. Every prompt and every file Claude Code sends goes through their servers, and they don't spell out how long they keep it.

  • Keep passwords, API keys, client data and private repos off of it.
  • Use it for side projects, experiments and agents that don't touch anything personal.
  • To get your normal Claude Code back, paste this and restart.

Checked against apinex.bond on November 19, 2026.

Copy-paste this
Switch my Claude Code back to normal. Restore my user settings from the settings.json.bak backup you made when you set up Apinex. If there's no backup, remove ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL and ANTHROPIC_DEFAULT_HAIKU_MODEL from the "env" block of my Claude Code settings, and the "model" line if it starts with free/. Then tell me to restart Claude Code.

Get the next one first

New prompts every week.

Free. The new drops and the tools behind them, before they hit the feed.

No spam · New issues Sunday · Unsubscribe anytime

Hire me for your business

Ready to invest in a custom build?

Implementation and custom builds start at $5,000 USD. Bring a specific business problem and an approved budget. Learning on your own? Keep exploring the free guides.

Frequently asked questions

The free models are. They cost $0 per token on a daily allowance that resets every day. Apinex sets the allowance, and right now a one-time top-up of $5 or more raises it to 25M tokens a day. Paid models bill a prepaid wallet, and the prompt never sets one of those.

No. It backs up your settings first. While the Apinex lines are in your settings, Claude Code runs on Apinex instead of your Claude account. Paste the switch-back prompt, or restore settings.json.bak, and you're back to normal.

Treat it like any third-party API. Your key stays in your own Claude Code settings file and only goes to Apinex. Your prompts and code go through their servers too, so keep private info off of it. For a router you run yourself, see the FreeLLMAPI setup.

Let the prompt pick first. It tests each one and puts the free models that answer into Claude Code's Opus, Sonnet and Haiku slots. Then try a few with /model and keep the one you like.

Yes. The prompt finds your Claude Code settings on Mac, Linux or Windows and edits the right file. For more free model options, see every AI model for free.