Claude is one of the strongest models for coding, long-document analysis and multi-step reasoning, so it is a natural choice for anything from a side project to a production agent. Getting access is the hard part for many developers. Official signup is unavailable in some regions, phone verification fails, cards issued outside supported markets get declined, and billing is in US dollars. This guide covers why direct access fails, what options you actually have, and how to connect to Claude through an API gateway using any of three protocols, with working code and fixes for the errors people hit most often.
If you want to understand how a gateway handles your requests before trusting one, start with What Is an AI API Gateway.
Why Direct Access Often Fails
The usual blockers when going straight to Anthropic's console:
- Region availability: Anthropic only serves a list of supported countries and regions. Outside that list, signup and API usage are restricted
- Phone verification: signup requires a phone number from a supported region
- Payment: API credits are prepaid with a card, and cards from unsupported markets are frequently declined. Virtual cards can trigger fraud checks
- Currency: billing is in USD, so you also pay conversion fees and take exchange-rate risk
- Account stability: accounts registered through workarounds can be suspended, taking your balance and projects with them
None of these are technical problems, but together they can cost more time than the API itself costs money. Teams have one more issue: a single official account is hard to split so each member gets their own key and their own spending report.
Your Options
| Option | Signup and payment | Effort | Best for |
|---|---|---|---|
| Direct from Anthropic | Supported-region phone and card, USD billing | High, with suspension risk | Companies with an entity in a supported region |
| Through a major cloud platform | Cloud account with a supported payment method; some models need a separate access request | Medium, you work inside the cloud's IAM and billing | Teams already deep in that cloud |
| API gateway | Email signup, local-currency top-up | Low, change base URL and key | Individual developers, startups, internal tools |
The first two both assume you already have international payment and a supported account. For most developers who are blocked, a gateway is the shortest path. A gateway like Zivv handles upstream accounts, payment and scheduling, and gives you an endpoint that speaks the official protocols plus one API key. For a broader look at how providers differ, see the API gateway comparison.
Setting Up Zivv
It takes a few minutes:
- Register with an email address
- Top up your balance. The rate is ¥1 = $1, with no monthly fee and no minimum spend, so start small
- Create an API key in the console and choose a group. Use a standard group for general API calls, or the Claude MAX group if the key is mainly for Claude Code
- Check model ids and prices in the Model Hub, or call
GET /v1/modelswith your key
The Claude MAX group is backed by a pool of Claude subscription accounts and speaks the native Anthropic protocol. It is built for heavy coding sessions in Claude Code. Details are on the Claude MAX page.
Three Ways to Connect
One Zivv key works across three protocol surfaces:
| Protocol | Base URL | Use with |
|---|---|---|
| Anthropic native | https://zivv.pro | Anthropic SDKs, Claude Code |
| OpenAI-compatible | https://zivv.pro/v1 | OpenAI SDKs, Cursor, Cline and similar tools |
| Gemini-compatible | https://zivv.pro/v1beta | Gemini models and SDKs |
For Claude, you will use the first two.
Option 1: Native Anthropic Protocol
Use this when you want everything Claude offers natively: extended thinking, tool use and image input. First, confirm your key works:
curl https://zivv.pro/v1/messages \
-H "x-api-key: sk-your-key-here" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Introduce yourself in three sentences"}]
}'In Python, the official anthropic SDK only needs a different base URL:
import os
import anthropic
client = anthropic.Anthropic(
api_key=os.environ["ZIVV_API_KEY"],
base_url="https://zivv.pro", # no /v1 here
)
message = client.messages.create(
model="claude-sonnet-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Explain Python's GIL"}],
)
print(message.content[0].text)The most common mistake here: the Anthropic SDK appends /v1/messages to the base URL. If you set https://zivv.pro/v1, requests go to /v1/v1/messages and return 404.
Option 2: OpenAI-Compatible Protocol
If your code already uses the OpenAI SDK, or you want one code path for Claude, GPT and Gemini, use the compatible endpoint:
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["ZIVV_API_KEY"],
base_url="https://zivv.pro/v1", # /v1 required here
)
resp = client.chat.completions.create(
model="claude-sonnet-5",
messages=[
{"role": "system", "content": "You are a senior backend engineer"},
{"role": "user", "content": "List three common pitfalls of Redis distributed locks"},
],
)
print(resp.choices[0].message.content)The gateway converts requests and responses between the two formats. Change model to gpt-5.5 or gemini-3.5-flash and the same code calls a different provider. Streaming, retries and environment variables are covered in the Python AI API quickstart.
Option 3: Claude Code
Claude Code uses the native protocol and needs two environment variables:
export ANTHROPIC_BASE_URL=https://zivv.pro
export ANTHROPIC_AUTH_TOKEN=sk-your-key-here
claudeAgain, the base URL is the bare domain. Windows users should follow the Claude Code Windows setup guide. The reference version lives in the Claude Code docs.
Which Claude Model to Use
| Model | Character | Good for |
|---|---|---|
claude-sonnet-5 | Balanced speed and capability, best value | Everyday coding, chat, document work, most production calls |
claude-opus-4-8 | Strongest reasoning, higher price | Architecture decisions, hard bugs, long agent runs |
A simple policy works well: default to Sonnet and escalate to Opus only when Sonnet struggles. The multi-model routing guide shows how to automate that. Model ids change between releases, so confirm them in the Model Hub or through /v1/models before you deploy.
How Billing Works
Zivv charges group multiplier × official model price × actual tokens used, and top-ups convert at ¥1 = $1. A model listed at $3 per million input tokens, in a group with a 1x multiplier, deducts the equivalent of 3 units of balance per million input tokens. Multipliers vary by group, and the console and Model Hub show the current numbers.
Ways to keep costs down:
- Use
/v1/messages/count_tokensto measure long prompts before sending them - Set a sensible
max_tokensso responses do not run longer than needed - Keep simple tasks (classification, extraction, rewriting) off Opus
For a full monthly estimate, see the token cost calculator guide.
Common Errors After Connecting
| Symptom | Likely cause | Fix |
|---|---|---|
| 404 Not Found | /v1 doubled or missing in base URL, or wrong model id | Native: bare domain. OpenAI-compatible: include /v1. Check ids in the Model Hub |
| 401 Unauthorized | Truncated key, stray whitespace, wrong header | Re-copy the key. Native uses x-api-key, compatible uses Authorization: Bearer |
| 402 Insufficient balance | Account balance or key quota exhausted | Top up or raise the key's quota |
| 429 Too Many Requests | Bursty traffic | Exponential backoff, lower concurrency |
| 529 Overloaded | Upstream temporarily overloaded | Retry later, checkpoint long jobs |
| 400 Bad Request | Missing max_tokens or system inside messages on the native API | max_tokens is required and system is a top-level field |
Deeper troubleshooting for each: 401, 402, 404 and 429.
One more thing people miss: a global proxy variable like HTTPS_PROXY routes your calls through that proxy first. If the proxy is flaky, you will see timeouts or connection resets that have nothing to do with the API. When debugging, test once without it.
Data Handling
Zivv records token usage for billing and does not store prompt or response bodies. Good habits regardless of provider:
- Use separate keys per project and environment so a leak only means revoking one key
- Keep keys in environment variables or a secrets manager, never in the repository
- For teams, give each member their own key with daily and monthly budgets. See Teams
If your workload has strict data-residency or audit requirements, check whether you need a direct enterprise agreement with the model vendor.
FAQ
Q: Can I use the Claude API if my country isn't supported by Anthropic? A: Direct signup requires a supported-region phone number and card, and workaround accounts risk suspension. An API gateway lets you sign up with email, pay in local currency and call the same Claude models.
Q: Is Claude through a gateway the same model as the official API? A: Requests are forwarded to Claude and responses keep the official structure. You can check this yourself by running a fixed set of hard prompts against both. The gateway explainer describes how.
Q: How do I pay for the Claude API without a US credit card? A: Top up your Zivv balance at ¥1 = $1. The balance works across all models and is deducted per actual token.
Q: What base URL should I use for the Claude API? A: https://zivv.pro for the Anthropic SDK and Claude Code (no /v1), and https://zivv.pro/v1 for the OpenAI SDK and tools like Cursor or Cline.
Q: Does it support embeddings? A: Zivv does not offer an embeddings endpoint. For RAG, generate vectors with another provider and send the retrieved context to Claude.
Q: Is pay-as-you-go or a subscription cheaper for Claude Code? A: It depends on volume and usage pattern. See Claude subscription vs API. Heavy Claude Code users should look at the Claude MAX group first.
Next Steps
- Create a Zivv account and add a small balance
- Create a key in the right group
- Run the curl test above to confirm the key and model id
- Connect with whichever protocol fits your code
- Run real work for a week, check token usage in the dashboard, then scale up
Full endpoint and error references are in the Zivv docs, and you can reach the team through Contact.