Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.apiyi.com/llms.txt

Use this file to discover all available pages before exploring further.

Channel and billing highlights:
  • Default channel: AWS Claude (AWS Bedrock official) — high stability, strong cache hit rates.
  • Backup channel: Claude Official (direct Anthropic API with official keys) — auto-failover when the AWS channel has issues.
  • Both channels are pure official passthrough. Pay-as-you-go, no rate limiting, all-in cost ≈ 85% of list price (79%–86% range after stacking deposit bonuses).
We don’t do low-cost reverse-engineered access — only reliable, stable quality and service.

Get an API Key

Create or manage tokens in the dashboard: https://api.apiyi.com/token
  • The default token works out of the box.
  • If you create a new token under the ClaudeCode group, you get 5% off (95% of list).
  • That group discount stacks with deposit bonuses of 10%–20%, bringing the all-in cost down to roughly 79%–86% of list (the ”≈ 85%” headline).
  • No rate limiting, cheaper than the official site, easy to use.
API is billed per usage (not a monthly subscription) — fees are deducted in real time from your prepaid balance.

Endpoints

ItemValue
Base URLhttps://api.apiyi.com
Anthropic native endpointhttps://api.apiyi.com/v1/messages
OpenAI-compatible endpointhttps://api.apiyi.com/v1/chat/completions

Available Models

These three are the latest in each family — recommended for direct use:
FamilyModelBest for
Opusclaude-opus-4-7Complex coding, deep reasoning
Sonnetclaude-sonnet-4-6General intelligence, daily code
Haikuclaude-haiku-4-5-20251001Fast responses, high concurrency

Calling format: native vs OpenAI-compatible

We support both the Anthropic native format and the OpenAI-compatible format — but pick the right one for your case:

✅ Strongly recommended: Anthropic native

Endpoint: /v1/messagesIf you use Claude Code, Cline, Cursor, or any Claude-heavy client, you must use the native format.Only the native format properly triggers Prompt Cache (cached billing), which dramatically lowers cost for long context / repeated system prompts.

⚙️ Universal: OpenAI-compatible

Endpoint: /v1/chat/completionsIf your project is already on the OpenAI SDK and you don’t care about cache billing, you can switch to Claude with near-zero migration cost.Best for one-off scripts, light workloads, and legacy projects locked to the OpenAI SDK.
Cache billing only works in the Anthropic native format. In Claude Code-style high-frequency, long-context use, the OpenAI-compatible format can lead to materially higher bills — that’s an upstream protocol limitation, not an API易 issue.
For details on how prompt caching works and how to verify it, see Claude Prompt Caching Guide.

Examples

curl https://api.apiyi.com/v1/messages \
  -H "x-api-key: your-apiyi-key" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-sonnet-4-6",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Hello, please introduce yourself."}
    ]
  }'
import anthropic

client = anthropic.Anthropic(
    api_key="your-apiyi-key",
    base_url="https://api.apiyi.com"
)

message = client.messages.create(
    model="claude-opus-4-7",
    max_tokens=1024,
    messages=[
        {"role": "user", "content": "Write a Python quicksort example."}
    ]
)

print(message.content[0].text)

OpenAI-compatible format (for generic migrations)

from openai import OpenAI

client = OpenAI(
    api_key="your-apiyi-key",
    base_url="https://api.apiyi.com/v1"
)

response = client.chat.completions.create(
    model="claude-sonnet-4-6",
    messages=[
        {"role": "user", "content": "Hello, please introduce yourself."}
    ]
)

print(response.choices[0].message.content)

A note on Opus pricing

Opus is comparatively expensive. Day-to-day chat usage is modest, but in coding scenarios with heavy token input/output, the bill adds up quickly. We suggest starting with a $10 test budget to gauge real-world consumption before committing.
Daily-use guidance:
  • Most scenarios: prefer claude-sonnet-4-6 — best price/performance.
  • Simple / high-volume tasks: use claude-haiku-4-5-20251001 — fast and cheap.
  • Hard coding / reasoning: escalate to claude-opus-4-7.