support

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/messages themselves.
  • 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.

bash
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/messagesx-api-keyzk_...
/v1/messagesanthropic-version2023-06-01
/v1/chat/completionsAuthorizationBearer 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-7flagship200KStrongest reasoning, tool use, vision
claude-opus-4-7-1mflagship · 1M1,000KSame model, extended input, same per-token rate
claude-haiku-4-5fast200K1/5 the price of Sonnet — great for classifiers
claude-opus-4-6flagship200KPrevious-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

CLI Anthropic format Free plan OK

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

bash
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.

~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.zentherixapi.xyz",
    "ANTHROPIC_AUTH_TOKEN": "zk_...",
    "ANTHROPIC_MODEL": "claude-opus-4-7"
  }
}

Cursor

Editor OpenAI format Requires Pro plan

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

  1. Open SettingsModels.
  2. Scroll to OpenAI API section.
  3. Enable Override OpenAI Base URL, paste https://api.zentherixapi.xyz/v1/v1 is required here.
  4. Paste your key in OpenAI API Key, click Verify.
  5. Disable built-in Cursor models — otherwise they'll try to route through your endpoint and fail on unknown IDs.
  6. Click + Add custom model and add a Claude ID — e.g. claude-opus-4-7. Save.

Cline / Roo Code

Plugin OpenAI format Free plan OK

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

  1. Click ⚙ in the Cline (or Roo Code) panel.
  2. In API Provider, select OpenAI Compatible.
  3. Fill in:
    • Base URL: https://api.zentherixapi.xyz/v1
    • API Key: zk_...
    • Model ID: claude-opus-4-7
  4. Save and run a task.

Anthropic SDK

Library Anthropic format

Pass the bare host in base_url — the SDK appends /v1/messages automatically. Including /v1 will cause a 404.

Python

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

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

CLI Both formats

Handy for smoke-testing your key, debugging headers, or scripting without an SDK.

Anthropic format

curl
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
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

NameRequiredValue
x-api-keyyes
anthropic-versionyes2023-06-01
content-typeyesapplication/json

Body

FieldTypeNotes
modelstringrequired
messagesMessage[]required
max_tokensintrequired
systemstring · Block[]optional
toolsTool[]optional
temperature0..1optional, default 1
streambooloptional — emit SSE

POST /v1/chat/completions

OpenAI-compatible Chat Completions mirror. Same models; request/response form matches api.openai.com.

FieldTypeNotes
modelstringrequired
messagesMessage[]required
max_tokensintoptional
temperature0..2optional
streambooloptional — SSE with data: [DONE]
toolsTool[]optional
response_formatobjectoptional

GET /v1/whoami

Wallet introspection for the authenticated bearer. Requires a key; this is what the dashboard renders.

response
{
  "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.

response
{
  "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
401authentication_errorMissing or invalid bearer
402insufficient_creditsWallet balance hit zero
404not_foundTypically: wrong base URL
429rate_limit_exceededPer-key RPM limit reached
502upstream_errorUpstream returned 5xx
504upstream_timeoutSSE 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.