Grok 4.5 API — Access via an AI API Gateway
Call xAI's Grok 4.5 through byesu — an AI API gateway with both OpenAI-compatible and Anthropic-native endpoints. One key covers Grok, Claude, GPT-5.6, Gemini and more, billed pay-as-you-go with no subscription. Because byesu speaks Anthropic's /v1/messages format, you can even run Grok 4.5 inside Claude Code by setting three environment variables.
What It Is · How Pricing Works
Grok 4.5 is xAI's coding- and agent-focused model, released on 2026-07-08. It was trained on real Cursor coding sessions, ships a 500K-token context window, and currently sits at #4 on the Artificial Analysis intelligence index. According to xAI, its list price is more than 60% lower than comparable flagship models, and on identical task batches it emits roughly 14k output tokens where Claude Opus 4.8 emits ~67k — a difference that compounds fast in agent loops, where output tokens dominate the bill.
Official xAI list pricing: $2 / million input tokens, $6 / million output tokens, $0.50 / million cached input tokens.
byesu serves the official model with no quality degradation and bills per token using group multipliers:
| Billing Item | Multiplier |
|---|---|
| Input | 1x |
| Output | 5x |
| Cache hit | 0.1x |
Multipliers are coefficients relative to the model's base price. You pay a fraction of the official list price — the console shows your live billed price next to the official list price, and it follows automatically whenever multipliers change. Tokens served from cache are billed at only 0.1x, which matters a lot with a 500K context you re-read on every agent turn.
Pick the right group when creating a token
Before calling grok-4.5, go to Console → Tokens and create a token in a group that includes Grok models. Using the wrong group triggers a "no available channel" error. See Choosing a Group for details.
Use Grok 4.5 in Claude Code
Claude Code talks to Anthropic's Messages API by default. byesu exposes an Anthropic-native /v1/messages endpoint and serves any model on the platform through it — which means Claude Code can drive Grok 4.5 directly:
# 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="grok-4.5"Start claude and the session runs on Grok 4.5 — same tools, same workflow, different engine. On Windows PowerShell use setx instead of export. Note the base URL is https://byesu.com without /v1; only the OpenAI-compatible format includes /v1. Full walkthrough: Claude Code CLI Setup.
Grok 4.5 vs Claude Opus 4.8 for coding
These two are complementary rather than interchangeable. Grok 4.5 (list price $2 in / $6 out per million tokens) is tuned for tight, economical coding sessions: according to xAI, it produces about 14k output tokens on task batches where Opus 4.8 produces ~67k, and its 500K context comfortably holds a large repo. That profile fits high-volume agent loops, refactors, and iterative edit-run-fix cycles. Claude Opus 4.8 (list price $5 in / $25 out per million tokens) supports extended thinking with Effort Control and remains the stronger pick for the hardest architectural decisions and gnarly debugging where maximum reasoning depth pays for itself. On byesu both sit behind the same key — switch by changing the model string (or ANTHROPIC_MODEL) and benchmark them on your own workload.
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": "grok-4.5",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Write a Python function that merges two sorted lists."}
]
}'Option 2: OpenAI-compatible /v1/chat/completions
curl https://byesu.com/v1/chat/completions \
-H "Authorization: Bearer sk-YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-4.5",
"messages": [
{"role": "user", "content": "Explain optimistic vs pessimistic locking in one paragraph."}
]
}'Option 3: Python (OpenAI SDK)
Existing OpenAI SDK code needs only a base_url and key swap:
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="grok-4.5",
messages=[
{"role": "user", "content": "Write a Python function that merges two sorted lists."}
],
)
print(resp.choices[0].message.content)Anthropic's official SDK works too — point base_url at https://byesu.com and pass your token as the API key.
Key Parameters
| Parameter | API | Required | Description |
|---|---|---|---|
model | Both | ✅ | Always grok-4.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 format) |
temperature | Both | Sampling temperature — lower is more deterministic | |
stream | Both | Set to true for streaming (SSE) responses |
Output tokens are billed at 5x, so Grok 4.5's terse output style directly reduces per-task spend; cached input tokens bill at only 0.1x.
Why Use byesu for Grok 4.5
- Official model, no quality degradation — requests reach the real Grok 4.5, not a reverse-engineered or mirrored stand-in.
- Transparent usage-based billing — multipliers are public (input 1x / output 5x / cache hit 0.1x), and the console shows your live billed price next to the official list price.
- One key, many models — Claude, GPT-5.6, Grok, Gemini and more behind the same token; compare models by changing one string.
- Both API formats — Anthropic-native
/v1/messagesand OpenAI-compatible/v1/chat/completions; existing code migrates with a base URL swap. - Claude Code ready — the Anthropic-native endpoint means Grok 4.5 runs inside Claude Code, Cherry Studio, and other Anthropic-format clients.
- Pay-as-you-go, no subscription — top up with USDT, Alipay or WeChat Pay and pay only for tokens you use.
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 the token group matters
- 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 Grok 4.5 API access?
Sign up at the byesu console, create a token in a group that includes Grok models, and call grok-4.5 through the OpenAI-compatible /v1/chat/completions endpoint or the Anthropic-native /v1/messages endpoint. One key also covers Claude, GPT-5.6, Gemini and more. No xAI account is required, and billing is pay-as-you-go with no subscription.
How much does the Grok 4.5 API cost?
The official xAI list price is $2 per million input tokens, $6 per million output tokens, and $0.50 per million cached input tokens. On byesu, billing is per token with transparent group multipliers (input 1x, output 5x, cache hit 0.1x, relative to the base price). You pay a fraction of the official list price — the console shows your live billed price next to the official list price.
Can I use Grok 4.5 in Claude Code?
Yes. byesu exposes an Anthropic-native /v1/messages endpoint, so Claude Code can run Grok 4.5. Set ANTHROPIC_BASE_URL to https://byesu.com (without /v1), ANTHROPIC_API_KEY to your sk- token, and ANTHROPIC_MODEL to grok-4.5, then restart your terminal.
Is Grok 4.5 on byesu the official model?
Yes. byesu routes requests to the official Grok 4.5 model with no quality degradation — not reverse-engineered, not a mirror, not a cracked client. Responses match the official service, and billing is transparent and usage-based.
What is the Grok 4.5 context window?
Grok 4.5 has a 500K-token context window, enough for large codebases, long agent transcripts, and multi-document inputs in a single request. Cached input tokens are billed at only 0.1x, which keeps repeated long contexts affordable.
What does a "no available channel" error mean when calling grok-4.5?
It usually means the token was created in the wrong group. In the byesu console, create the token in a group that includes Grok models, and confirm the model name is spelled exactly grok-4.5 as shown in the console model list.
