---
title: "Quick Start"
description: "Create a 1zheai API key, make your first Claude / GPT call with curl or an SDK, then connect it to your favorite clients."
headingIds: {"You Can Also Start with GPT":"section-1","Next Steps":"section-2"}
---

<aside className="docs-publication" data-pagefind-ignore>

Documentation maintained by [1ZheAI](https://1zheai.com/en/editorial/#publisher). [Sources and corrections](https://1zheai.com/en/editorial/).

Found an error? [Contact support](mailto:support@1zheai.com) with the page address and a description. Do not send API keys or account credentials.

</aside>
Goal: get an API key within 5 minutes and complete your first Claude or GPT request.

<Steps>
<Step title="Sign up and top up">

Open [1zheai.com/register](https://1zheai.com/register?lng=en) 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](/en/docs/billing/) for the rules.

</Step>
<Step title="Create an API key">

Go to the [Console](https://1zheai.com/console?lng=en), 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](/en/docs/api-keys/).

</Step>
<Step title="Send your first request">

Put the API key into an environment variable, then call the Anthropic native endpoint once with curl:

<CodeGroup>
```bash title="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"}]
  }'
```
```powershell title="Windows PowerShell"
$env:ONEZHE_API_KEY = "sk-你的Key"

$body = @{
  model      = "claude-sonnet-5-5"
  max_tokens = 128
  messages   = @(@{ role = "user"; content = "用一句话解释什么是 HTTP" })
} | ConvertTo-Json -Depth 5

Invoke-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))
```
</CodeGroup>

`ONEZHE_API_KEY` is just an example variable name — any name works.

</Step>
<Step title="Inspect the response">

On success you get HTTP 200 with a structure identical to the official one. Focus on two things: whether `model` is the model you requested, and the token counts in `usage`. 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_tokens` is 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](/en/docs/pricing-explained/#section-3).

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.

</Step>
</Steps>

## 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:

```bash
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](/en/docs/code-examples/) directly. Text goes in `choices[0].message.content`; if the model is not in your list, first [query available models](/en/docs/api-models/). Codex requires Responses — follow the [Codex configuration tutorial](/en/docs/quickstart-codex/) to integrate.

## Next Steps

Connect it to your favorite tools:

<CardGroup cols={2}>
 <Card title="Claude Code" href="/en/docs/quickstart-claude-code/">

    Two environment variables are enough.
  </Card>
 <Card title="CC Switch" href="/en/docs/quickstart-cc-switch/">

    Use this if you don't want to hand-edit config files.
  </Card>
 <Card title="Cursor" href="/en/docs/quickstart-cursor/">

    How to write a custom Base URL and its restrictions.
  </Card>
 <Card title="OpenAI SDK" href="/en/docs/quickstart-openai-sdk/">

    If you already have OpenAI code, just change base_url.
  </Card>
</CardGroup>

If a request fails, first check [Error Codes and Troubleshooting](/en/docs/troubleshooting/). To verify returned fields and usage, see [Verifying Models and Usage](/en/docs/verify-model/).
