Quick Start
Create a 1zheai API key, make your first Claude / GPT call with curl or an SDK, then connect it to your favorite clients.
Goal: get an API key within 5 minutes and complete your first Claude or GPT request.
Sign up and top up
Open 1zheai.com/register to register. Calls deduct from your balance as you go, so you need to top up first. Balance is denominated in USD; WeChat Pay, Alipay, Stripe (bank card) and USDT are supported — the exact methods and amount limits are subject to the wallet order page. Within 7 days of topping up you can request a refund of unused principal to the original payment method; consumed amounts and payment processing service fees are non-refundable. See Top-ups, Refunds and Invoices for the rules.
Create an API key
Go to the Console, click “API Keys” in the left sidebar, then click “Create API Key” in the top right, give it a name and save. API keys start with
sk-— click the copy icon in the list to copy and store it. Details in Getting and Managing API Keys.Send your first request
Put the API key into an environment variable, then call the Anthropic native endpoint once with curl:
macOS / Linux export ONEZHE_API_KEY="sk-你的Key"curl https://1zheai.com/v1/messages \-H "x-api-key: $ONEZHE_API_KEY" \-H "anthropic-version: 2023-06-01" \-H "content-type: application/json" \-d '{"model": "claude-sonnet-5-5","max_tokens": 128,"messages": [{"role": "user", "content": "用一句话解释什么是 HTTP"}]}'Windows PowerShell $env:ONEZHE_API_KEY = "sk-你的Key"$body = @{model = "claude-sonnet-5-5"max_tokens = 128messages = @(@{ role = "user"; content = "用一句话解释什么是 HTTP" })} | ConvertTo-Json -Depth 5Invoke-RestMethod -Uri "https://1zheai.com/v1/messages" -Method Post `-Headers @{ "x-api-key" = $env:ONEZHE_API_KEY; "anthropic-version" = "2023-06-01" } `-ContentType "application/json; charset=utf-8" `-Body ([System.Text.Encoding]::UTF8.GetBytes($body))ONEZHE_API_KEYis just an example variable name — any name works.Inspect the response
On success you get HTTP 200 with a structure identical to the official one. Focus on two things: whether
modelis the model you requested, and the token counts inusage. Below is an actual response measured on 2026-10-15:json {"model": "claude-sonnet-5-5","id": "msg_011Cg3G8HQmyTrnqSBX6o6Pw","type": "message","role": "assistant","content": [{"type": "text","text": "HTTP(超文本传输协议)是一种基于请求-响应模式的应用层协议,用于在客户端(如浏览器)和服务器之间传输网页、图片、API 数据等内容。"}],"container": null,"stop_reason": "end_turn","stop_sequence": null,"stop_details": null,"usage": {"input_tokens": 530,"cache_creation_input_tokens": 0,"cache_read_input_tokens": 0,"cache_creation": {"ephemeral_5m_input_tokens": 0,"ephemeral_1h_input_tokens": 0},"output_tokens": 69,"output_tokens_details": {"thinking_tokens": 0},"service_tier": "standard","inference_geo": "global"},"input_transformations": [],"diagnostics": null,"context_management": {"applied_edits": []}}input_tokensis a few hundred more than the question itself — that’s the system prompt attached by this kind of client (curl, SDK, third-party tools) on every request, billed as input; Claude Code does not attach one, see Billing for System Prompts.Then go to “Call Logs” on the left of the console to see this call: time, the API key used (the “Token” column), model, input / output tokens, cache read/write and cost.
You Can Also Start with GPT
Section titled “You Can Also Start with GPT”If you use the OpenAI SDK or plan to integrate Codex, you can choose the GPT protocol directly. Set the ONEZHE_API_KEY above in the same terminal first, then run:
curl --fail-with-body https://1zheai.com/v1/chat/completions \ -H "Authorization: Bearer $ONEZHE_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gpt-5.6-sol","messages":[{"role":"user","content":"用一句话解释 HTTP。"}]}'This is a macOS / Linux shell example; on Windows you can run the cross-platform Python / Node.js example directly. Text goes in choices[0].message.content; if the model is not in your list, first query available models. Codex requires Responses — follow the Codex configuration tutorial to integrate.
Next Steps
Section titled “Next Steps”Connect it to your favorite tools:
Two environment variables are enough.
Use this if you don’t want to hand-edit config files.
How to write a custom Base URL and its restrictions.
If you already have OpenAI code, just change base_url.
If a request fails, first check Error Codes and Troubleshooting. To verify returned fields and usage, see Verifying Models and Usage.
