A key from Russia without an Anthropic card. Sign up and pay in rubles on the registration page, and find model prices in the pricing docs. Terminal setup: Claude Code in Russia.
A Claude API key is issued in two places: the Anthropic console at platform.claude.com and your codexkey account. Both keys work for direct API calls and for most IDEs and agents, but the format, the base URL and the barrier to entry differ. Below we walk through both routes and show every place the finished key goes: environment variables, the Python and Node SDKs, Claude Code and Cursor.
Route 1: a key from the Anthropic console
You create the key under "Settings → API keys". You need an account tied to an organization or a personal workspace. Click the create button and pick the key type: personal, service account or workspace. The value is shown once, right when you create it, and starts with sk-ant-api03-. Missed copying it? Create a new one.
export ANTHROPIC_API_KEY="sk-ant-api03-..."
Why the Anthropic route stalls on payment and region from Russia
Creating the key is easy. The trouble starts when you have to attach a payment method. Anthropic accepts cards from banks in a limited list of countries, and Russian cards are declined: neither Mir (Russia's domestic card network) nor Visa/Mastercard cards from banks cut off from the international payment systems go through. Until a payment method is confirmed, a new key does not work for paid requests, and the free trial quota lasts a few minutes. On top of that, registration checks your IP and phone number. We covered how the declines work and what actually helps in Claude API from Russia and Why Russian cards are declined by Anthropic.
Route 2: a codexkey key
codexkey issues its own key, compatible with the Anthropic SDK request format. No Anthropic account is needed, and neither region nor phone number is checked. There are three steps:
- Register in your account with a login and password, or through Google, GitHub or Telegram. There is no email confirmation, and access opens right away.
- Top up the balance from 1 dollar by any accepted method: a Russian card through YooKassa or Platega, SBP (the Russian Faster Payments System), or crypto through CryptoCloud, CryptoBot in Telegram or the 2328 service (USDT, BTC, ETH, TON and others). Funds arrive as soon as the payment is confirmed.
- Open the "API keys" section and create a key. It looks like this:
sk_cdx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
export ANTHROPIC_API_KEY="sk_cdx_YOUR_KEY"
export ANTHROPIC_BASE_URL="https://api.codexkey.online"
Where to put the finished key
From here on it does not matter where the key came from: it connects the same way, and only the key value and the base URL change.
Environment variables
The simplest and most portable option is to set the key and the URL once in the environment. Your code and CLI tools pick them up on their own.
# Linux / macOS
export ANTHROPIC_API_KEY="sk_cdx_YOUR_KEY"
export ANTHROPIC_BASE_URL="https://api.codexkey.online"
# Windows PowerShell
$env:ANTHROPIC_API_KEY = "sk_cdx_YOUR_KEY"
$env:ANTHROPIC_BASE_URL = "https://api.codexkey.online"
Python SDK
In the Anthropic SDK the codexkey base URL is written without /v1: the SDK appends the /v1/messages path itself.
import anthropic
client = anthropic.Anthropic(
api_key="sk_cdx_YOUR_KEY",
base_url="https://api.codexkey.online",
)
message = client.messages.create(
model="claude-sonnet-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello"}],
)
print(message.content[0].text)
Node and TypeScript SDK
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: "sk_cdx_YOUR_KEY",
baseURL: "https://api.codexkey.online",
});
const message = await client.messages.create({
model: "claude-sonnet-5",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello" }],
});
console.log(message.content[0].text);
Claude Code
Claude Code reads the URL and key from the environment variables ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN, and the URL again goes without /v1. The ANTHROPIC_DEFAULT_* lines set the models.
export ANTHROPIC_BASE_URL="https://api.codexkey.online"
export ANTHROPIC_AUTH_TOKEN="sk_cdx_YOUR_KEY"
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-5-5[1m]"
export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-5[1m]"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-sonnet-5"
claude
The ANTHROPIC_DEFAULT_* lines are required: without them Claude Code asks for its own default models and answers "There's an issue with the selected model".
To avoid exporting the variables on every launch, save them in ~/.claude/settings.json. The full instructions for Linux, macOS and Windows, including a permanent setup through the config file, are in Claude Code in Russia and in the Claude Code docs.
Cursor
In Cursor the key does not go into the Anthropic field but into the settings for a custom OpenAI-compatible connection. OpenAI Base URL takes https://api.codexkey.online/v1, and OpenAI API Key takes the same sk_cdx_... or sk-ant-... key. One important detail: a custom API endpoint in Cursor works only on the paid Pro plan or higher. The seven-day Pro trial will not do. The step-by-step setup, model choice and common connection errors are in Cursor setup with Claude and in the Cursor docs.
FAQ
Can I get an Anthropic key for free?
Anthropic gives new accounts a small trial quota, but steady work needs an attached payment method. From Russia the main obstacle is usually attaching the card, not generating the key.
How does a codexkey key differ from an Anthropic key in capabilities?
The request format is compatible with the Anthropic SDK, and a call to a Claude model looks identical. Three things differ: the base URL, the payment methods (rubles, SBP and crypto instead of an international card only) and the lack of any requirement to have an Anthropic account.
What if a tool does not accept my key format?
Check which format the tool expects. Fields built for the Anthropic API take sk-ant-..., and fields where you enter the api.codexkey.online address need sk_cdx_.... Do not mix them: each format is tied to its own server.
Where do I put the key in another SDK or language, not Python or Node?
Almost any SDK compatible with the Anthropic or OpenAI format takes the key and the base URL as client parameters at initialization, as in the examples above. The parameter names may differ (api_key/apiKey, base_url/baseURL), but the logic is the same: the URL and the key go in together.
Should I create separate keys for different projects?
Yes, a key per project makes rotation and spend tracking easier. In codexkey a key has a name, a Premium or Cheap channel, an optional Premium fallback for Cheap, and an expiry. Limits on models and spend cannot be set through the key API. More in the API key guide.
What happens if I lose the key I copied?
The full key value is shown only once, when you create it, and cannot be recovered. If you lose the key, create a new one, update it in your code and tool settings, and delete or freeze the old one.