Claude Sonnet 5 API — Access via an AI API Gateway
Call Anthropic's claude-sonnet-5 through byesu — an AI API gateway with both Anthropic-native and OpenAI-compatible endpoints. One key covers Claude, GPT-5.6, Grok, Gemini and more, billed pay-as-you-go with no subscription and transparent multipliers. Requests run through official routing (not reverse-engineered, not a mirror, not cracked), and you can wire it into Claude Code with a single environment variable.
What It Is · How Pricing Works
claude-sonnet-5 is a model in Anthropic's Sonnet family, balancing reasoning quality, speed, and cost. It's a good fit for most everyday scenarios — coding, agents, long-context processing, and more.
byesu serves the official model with no quality degradation, billed using group multipliers:
| Billing Item | Multiplier |
|---|---|
| Input | 1x |
| Output | 5x |
| Cache hit | 0.1x |
Multipliers are coefficients relative to the base price. The actual billing price per 1,000 tokens is whatever the console shows in real time (the console displays your live billed price next to Anthropic's official list price, and it follows automatically when multipliers change). Tokens served from cache are billed at only 0.1x, which cuts costs significantly when you repeatedly read the same context.
Pick the right group when creating a token
Before calling claude-sonnet-5, go to Console → Tokens and create a token in a Claude group. Using the wrong group triggers a "no available channel" error. See Choosing a Group for details.
How to Call It
The Base URL depends on the API format:
- Anthropic native (
/v1/messages) →https://byesu.com - OpenAI-compatible (
/v1/chat/completions) →https://byesu.com/v1
The auth header is always Authorization: Bearer sk-your-token.
Option 1: Anthropic native /v1/messages
curl https://byesu.com/v1/messages \
-H "Authorization: Bearer sk-YOUR_TOKEN" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Explain what an API gateway does in one sentence."}
]
}'Option 2: OpenAI-compatible /v1/chat/completions
Already have OpenAI SDK code? Just change the base_url and key and it runs:
from openai import OpenAI
client = OpenAI(
api_key="sk-YOUR_TOKEN",
base_url="https://byesu.com/v1", # OpenAI-compatible format includes /v1
)
resp = client.chat.completions.create(
model="claude-sonnet-5",
messages=[
{"role": "user", "content": "Explain what an API gateway does in one sentence."}
],
)
print(resp.choices[0].message.content)Anthropic's official SDK works the same way — point base_url at https://byesu.com and swap api_key for your token.
Use it inside Claude Code (the key part)
Claude Code connects to Anthropic by default. Two environment variables redirect it to byesu's gateway endpoint, so your sessions run on claude-sonnet-5 through your byesu key:
# Add to ~/.zshrc or ~/.bashrc; reopen the terminal to apply
export ANTHROPIC_BASE_URL="https://byesu.com"
export ANTHROPIC_API_KEY="sk-YOUR_TOKEN"
export ANTHROPIC_MODEL="claude-sonnet-5" # optional: set the default modelOn Windows PowerShell, use setx; there's also a one-click script that skips the manual setup. For the full walkthrough, see Claude Code CLI Setup. Clients like Codex and Cherry Studio connect just as easily.
Don't get the base_url wrong
Anthropic format (/v1/messages, Claude Code) uses https://byesu.com, without /v1; only the OpenAI-compatible format includes /v1.
Key Parameters
| Parameter | API | Required | Description |
|---|---|---|---|
model | Both | ✅ | Always claude-sonnet-5; spell it exactly as in the console, or you'll get a "model not found" error |
messages | Both | ✅ | Array of conversation messages, each with role and content |
max_tokens | /v1/messages | ✅ | Maximum output tokens per reply (required by Anthropic's native API) |
max_tokens | /v1/chat/completions | Optional; if omitted, the OpenAI-compatible API lets the model decide | |
system | /v1/messages | System prompt (Anthropic native); in OpenAI format, use a role: system message instead | |
temperature | Both | Sampling temperature — lower is more deterministic | |
stream | Both | Set to true for streaming (SSE) responses |
Output tokens are billed at 5x, so the larger you set
max_tokensand the longer the model actually replies, the higher the cost; cached input tokens are billed at only 0.1x.
Why Use byesu for claude-sonnet-5
- Official model, no quality degradation — requests run through official routing, not a reverse-engineered, mirrored, or cracked stand-in, so response quality matches the official service and stays stable.
- Transparent pricing — group multipliers are public (input 1x / output 5x / cache 0.1x), and the console shows your live billed price in real time next to Anthropic's official list price, so you can see exactly what you're spending.
- Cache savings — cached tokens are billed at only 0.1x, dramatically lowering costs for agents, long contexts, and workloads that repeatedly read the same material.
- Both API formats — choose either Anthropic's native
/v1/messagesor the OpenAI-compatible/v1/chat/completions; existing code migrates with almost no changes. - One key, many models — Claude, GPT-5.6, Grok, Gemini and more behind the same token; compare models by changing one string.
- Claude Code / Codex ready — set a single
ANTHROPIC_BASE_URLto use it in Claude Code; Codex, Cherry Studio, and other mainstream clients connect with one click. Pay-as-you-go with no subscription — top up with USDT, Alipay or WeChat Pay.
Related Links
- Quick Start (3 steps) — create a token · set the address · pick a model
- Claude Code CLI Setup — environment variables and one-click script
- Choosing a Group — why you need the Claude group
- Console Sign-up / Create Token — get an
sk-token and see live pricing - Full Documentation — 6 languages, covering text / image / video access
FAQ
How do I get Claude Sonnet 5 API access?
Sign up at the byesu console, create a token in a Claude group, and call claude-sonnet-5 through the Anthropic-native /v1/messages endpoint or the OpenAI-compatible /v1/chat/completions endpoint. One key also covers GPT-5.6, Grok, Gemini and more. Billing is pay-as-you-go with no subscription, and you can top up with USDT, Alipay or WeChat Pay.
How much does the Claude Sonnet 5 API cost?
Billing is per token with transparent group multipliers: input 1x, output 5x, cache hit 0.1x, relative to the base price. The actual billing price per 1,000 tokens is whatever the console shows in real time, displayed next to Anthropic's official list price for comparison. Cached input tokens are billed at only 0.1x, which noticeably lowers costs.
How do I use Claude Sonnet 5 in Claude Code?
Set two environment variables: export ANTHROPIC_BASE_URL="https://byesu.com" (without /v1) and export ANTHROPIC_API_KEY="sk-your-token", and optionally ANTHROPIC_MODEL="claude-sonnet-5". You can also use the one-click script for automatic setup — see the Claude Code CLI setup docs for details.
Is Claude Sonnet 5 on byesu the official model?
Yes. byesu routes requests to the official claude-sonnet-5 model with no quality degradation — not reverse-engineered, not a mirror, not a cracked client. Response quality matches the official service, and it's stable enough for production use.
Can I call Claude Sonnet 5 with the OpenAI SDK?
Yes. byesu offers an OpenAI-compatible API — change your SDK's base_url to https://byesu.com/v1, use your sk- token as the api_key, and set model to claude-sonnet-5. Existing code needs almost no changes. Anthropic's native /v1/messages is also supported.
What does a "no available channel" error mean when calling claude-sonnet-5?
It usually means the token was created in the wrong group. claude-sonnet-5 requires a token in a Claude group, so in the byesu console select a Claude-related group from the "Group" dropdown when creating the token, and confirm the model name is spelled exactly claude-sonnet-5 as shown in the console model list.
