ZenthrexApi at a glance
A unified proxy to the Claude model family from Anthropic with a dollar-based wallet. One API key serves both the native Anthropic Messages API and the OpenAI-compatible Chat Completions mirror — pick whichever format your tool already speaks.
The most common 404 across all integrations below is an incorrect base URL. The rule:
- Anthropic clients (Claude Code, anthropic-py, @anthropic-ai/sdk) want the bare host:
https://api.zentherixapi.xyz. They append/v1/messagesthemselves. - OpenAI clients (Cursor, Cline, openai-py) want the base with /v1:
https://api.zentherixapi.xyz/v1. They append/chat/completions.
Quick Start
Three minutes from key to first token.
1. Get your key
Open the dashboard and paste your key. The dashboard calls /v1/whoami and shows your dollar balance, request history and per-model spend.
2. Pick a format
Both formats work on the same key and share one wallet. Use whichever your tool already understands — conversion between them is free.
curl https://api.zentherixapi.xyz/v1/messages \
-H "x-api-key: $ZENTHREX_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-opus-4-7",
"max_tokens": 1024,
"messages": [{"role":"user","content":"hello"}]
}'
3. Connect your tool
Jump to the integration you need: Claude Code, Cursor, Cline. Or use the SDK directly: Anthropic.
Authentication
One bearer token, two header names — depending on which format you call.
| Format | Header | Value |
|---|---|---|
| /v1/messages | x-api-key | zk_... |
| /v1/messages | anthropic-version | 2023-06-01 |
| /v1/chat/completions | Authorization | Bearer zk_... |
Treat your keys like passwords. The dashboard stores the pasted key in cookies for convenience — on a shared device, clear it before leaving.
Models
All Claude models from Anthropic, available in both API formats.
| ID | Tier | Context | Notes |
|---|---|---|---|
| claude-opus-4-7 | flagship | 200K | Strongest reasoning, tool use, vision |
| claude-opus-4-7-1m | flagship · 1M | 1,000K | Same model, extended input, same per-token rate |
| claude-haiku-4-5 | fast | 200K | 1/5 the price of Sonnet — great for classifiers |
| claude-opus-4-6 | flagship | 200K | Previous-gen Opus, same pricing |
OpenAI-style aliases
The Chat Completions endpoint accepts OpenAI aliases so existing clients work without changes. gpt-4o / gpt-4 map to claude-opus-4-7; gpt-4o-mini / gpt-3.5-turbo map to claude-haiku-4-5. In new code, use the canonical Claude ID.
Streaming
Both formats support SSE. Each format mirrors its parent API exactly — no ZenthrexApi-specific frames.
Anthropic format
Set "stream": true in the body and read the response as Server-Sent Events. Frame types: message_start, content_block_start, content_block_delta, content_block_stop, message_delta, message_stop plus periodic ping. Final usage arrives in message_delta.
OpenAI format
Set "stream": true and read SSE chunks like data: {"choices":[{"delta":{"content":"..."}}]}. Terminal frame: data: [DONE]. Optionally request "stream_options": {"include_usage": true} for final usage before [DONE].
Long SSE streams may go silent for tens of seconds between deltas during heavy reasoning — this is normal. If your client disconnects on silence, raise its timeout to at least 120s.
Claude Code
Anthropic's first-class CLI. Out of the box it knows ANTHROPIC_BASE_URL — point it to the bare host, the SDK appends /v1/messages itself.
Option A — env variables
export ANTHROPIC_BASE_URL="https://api.zentherixapi.xyz"
export ANTHROPIC_API_KEY="zk_..."
export ANTHROPIC_MODEL="claude-opus-4-7"
claude
Option B — settings.json
Cross-platform, survives terminal restart. Path: ~/.claude/settings.json on macOS/Linux, %USERPROFILE%\.claude\settings.json on Windows.
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.zentherixapi.xyz",
"ANTHROPIC_AUTH_TOKEN": "zk_...",
"ANTHROPIC_MODEL": "claude-opus-4-7"
}
}
Cursor
The "Override OpenAI Base URL" setting in Cursor sends Chat-format traffic to your endpoint. Tab autocomplete and Cursor's own foundation models are not affected.
Custom endpoints are not supported on the free plan. Override is locked behind Cursor Pro ($20/mo). Tab autocomplete always runs on Cursor's proprietary stack — it cannot be redirected.
Setup
- Open Settings → Models.
- Scroll to OpenAI API section.
- Enable Override OpenAI Base URL, paste
https://api.zentherixapi.xyz/v1—/v1is required here. - Paste your key in OpenAI API Key, click Verify.
- Disable built-in Cursor models — otherwise they'll try to route through your endpoint and fail on unknown IDs.
- Click + Add custom model and add a Claude ID — e.g.
claude-opus-4-7. Save.
Cline / Roo Code
Both Cline and Roo Code provide an "OpenAI Compatible" provider; setup is identical. Use "OpenAI Compatible", not "OpenAI" — the latter lacks a Base URL field.
Setup
- Click ⚙ in the Cline (or Roo Code) panel.
- In API Provider, select OpenAI Compatible.
-
Fill in:
- Base URL:
https://api.zentherixapi.xyz/v1 - API Key:
zk_... - Model ID:
claude-opus-4-7
- Base URL:
- Save and run a task.
Anthropic SDK
Pass the bare host in base_url — the SDK appends /v1/messages automatically. Including /v1 will cause a 404.
Python
import anthropic
client = anthropic.Anthropic(
base_url="https://api.zentherixapi.xyz",
api_key="zk_...",
)
msg = client.messages.create(
model="claude-opus-4-7",
max_tokens=1024,
messages=[{"role": "user", "content": "hi"}],
)
print(msg.content[0].text)
TypeScript
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: "https://api.zentherixapi.xyz",
apiKey: process.env.ANTHROPIC_API_KEY!,
});
const msg = await client.messages.create({
model: "claude-opus-4-7",
max_tokens: 1024,
messages: [{ role: "user", content: "hi" }],
});
curl
Handy for smoke-testing your key, debugging headers, or scripting without an SDK.
Anthropic format
curl https://api.zentherixapi.xyz/v1/messages \
-H "x-api-key: $ZENTHREX_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-opus-4-7",
"max_tokens": 1024,
"messages": [{"role":"user","content":"hi"}]
}'
OpenAI format
curl https://api.zentherixapi.xyz/v1/chat/completions \
-H "Authorization: Bearer $ZENTHREX_KEY" \
-H "content-type: application/json" \
-d '{
"model": "claude-opus-4-7",
"messages": [{"role":"user","content":"hi"}]
}'
POST /v1/messages
Anthropic-format Messages API. Identical request/response schemas to api.anthropic.com.
Headers
| Name | Required | Value |
|---|---|---|
| x-api-key | yes | — |
| anthropic-version | yes | 2023-06-01 |
| content-type | yes | application/json |
Body
| Field | Type | Notes |
|---|---|---|
| model | string | required |
| messages | Message[] | required |
| max_tokens | int | required |
| system | string · Block[] | optional |
| tools | Tool[] | optional |
| temperature | 0..1 | optional, default 1 |
| stream | bool | optional — emit SSE |
POST /v1/chat/completions
OpenAI-compatible Chat Completions mirror. Same models; request/response form matches api.openai.com.
| Field | Type | Notes |
|---|---|---|
| model | string | required |
| messages | Message[] | required |
| max_tokens | int | optional |
| temperature | 0..2 | optional |
| stream | bool | optional — SSE with data: [DONE] |
| tools | Tool[] | optional |
| response_format | object | optional |
GET /v1/whoami
Wallet introspection for the authenticated bearer. Requires a key; this is what the dashboard renders.
{
"token": "zk_...",
"balance_usd": 12.45,
"total_spent_usd": 3.12,
"total_input_tokens": 412903,
"total_output_tokens": 29110,
"per_model": {
"claude-opus-4-7": { "input_tokens": 390210, "output_tokens": 22011, "spent_usd": 2.41 },
"claude-haiku-4-5": { "input_tokens": 22693, "output_tokens": 7099, "spent_usd": 0.07 }
}
}
GET /v1/models
Public list of available models. No auth required.
{
"data": [
{"id": "claude-opus-4-7", "display_name": "Claude Opus 4.7"},
{"id": "claude-opus-4-7", "display_name": "Claude Sonnet 4.6"},
{"id": "claude-haiku-4-5", "display_name": "Claude Haiku 4.5"}
]
}
Error Reference
| Status | Type | Cause |
|---|---|---|
| 401 | authentication_error | Missing or invalid bearer |
| 402 | insufficient_credits | Wallet balance hit zero |
| 404 | not_found | Typically: wrong base URL |
| 429 | rate_limit_exceeded | Per-key RPM limit reached |
| 502 | upstream_error | Upstream returned 5xx |
| 504 | upstream_timeout | SSE stream stalled past 600s |
Rate Limits
Per-key, sliding window. Defaults are generous for interactive coding loops.
- RPM — 600 requests/min/key on Sonnet and Haiku, 200 on Opus.
- Concurrency — no hard ceiling; the edge holds ~10K simultaneous TLS sessions across all keys.
- 1-min token quota — 1 million input tokens/min/key, smoothed with a leaky bucket — short bursts don't trigger.
On rejection: HTTP 429 with a retry-after header in seconds.