59API

← 返回教程列表

GPT-6.1 Sol setup with 59API: your first cURL request

API 使用 · EN · 2026-11-14

Why the first request feels harder than it should

Most developers do not struggle with writing a request. They struggle with everything around it: one provider for one model family, another key for another, a different host, a different SDK shape, and a billing page to check every time. The result is a folder of half-remembered environment variables and a lot of hesitation before the first token comes back.

59API removes that overhead. It is an independent third-party AI API relay built on one simple idea: one account, one API key, one API host at https://api.59api.com, and access to Claude, GPT, Gemini, DeepSeek and other models. You are not juggling credentials across vendors. You point your client at a single place and choose the model you want for the job.

The money side is just as straightforward. 59API runs on a prepaid balance, charged per request by real token usage. There is no monthly fee, and your balance never expires. Top up what you need today, keep working, and top up again when you need more.

In this guide we will make one concrete request with cURL using GPT-6.1 Sol, in the order a developer actually works: read the settings, paste the request, read the response, understand the cost. No SDK to install, no framework to configure, no environment file to maintain. Just a terminal, a key, and a working baseline you can copy into any OpenAI-compatible client later.

Step one: collect your key and the exact client settings

Everything starts with two values: your API key and the base URL. Once your 59API account is active, copy the API key from your dashboard and keep it somewhere safe. In every example below it appears as the placeholder YOUR_59API_KEY, and that placeholder is the only thing you need to replace.

For cURL, Codex, OpenAI SDKs and OpenAI-compatible clients such as Cursor, Cherry Studio, Cline and OpenCode, the base URL is https://api.59api.com/v1. The chat endpoint you actually call is https://api.59api.com/v1/chat/completions. Notice the /v1 suffix: it is part of the address, not decoration. A request that skips it will not land on the endpoint you expect.

One boundary is worth stating now so it never surprises you later: this OpenAI-compatible path serves GPT, DeepSeek and other non-Claude, non-Gemini models only. Claude models work only through the genuine Claude Code or Claude Desktop client (Claude Code 2.1.285 or newer), and Gemini models use Google's native protocol through Gemini CLI. Neither belongs in a cURL request against /v1/chat/completions.

For cURL itself, there is nothing to install. macOS and Linux ship with it, and on Windows 10 and later it is available in the terminal. If your machine does not have it, install it first, then come back. That is the whole client configuration for this tutorial: one key, one base URL, one endpoint.

Step two: send your first request

Now run it. Paste the following into your terminal, replace YOUR_59API_KEY with your real key, and press enter:

curl https://api.59api.com/v1/chat/completions -H 'Content-Type: application/json' -H 'Authorization: Bearer YOUR_59API_KEY' -d '{"model":"gpt-6.1-sol","messages":[{"role":"user","content":"Say hello in one sentence."}]}'

Read it line by line and it is easy to see what is happening. The URL is the 59API chat endpoint. The first header tells the server the body is JSON. The second header carries your key as a bearer token. The payload names the model with its exact id, gpt-6.1-sol, and sends one user message.

What comes back is a standard chat completion response, with the assistant reply in the choices array. If you get JSON on screen, the setup is done: you are talking to a model through 59API from a plain terminal.

Three quick diagnostics for the common stumbles. If you get an authentication error, the key is wrong, expired, or still the placeholder. If you get a not found error on the route, the base URL is missing /v1. If you get a bad request complaining about the model, check the id character by character, because ids such as gpt-6.1-sol are matched exactly. When a request fails, 59API does not bill you for tokens that were never processed.

Step three: know what the request costs

Because 59API charges by real token usage, it pays to know the rates before you scale up. Prices are per 1 million tokens, billing is in CNY, and USD figures are shown at ¥7.2 = $1.

For GPT-6.1 Sol, the rate is $0.1847 (¥1.33) for input, $0.9264 (¥6.67) for output, and $0.0375 (¥0.27) for cache read, against an official list price reference of $2 / $10. GPT-5.6 Sol is $0.3472 (¥2.5) input, $1.94 (¥14) output, and $0.0278 (¥0.2) cache read, against an official list price reference of $4 / $20 (OpenAI promotional price, at least through 2026-11-21). If you want a lighter option on the same endpoint, DeepSeek V4 Flash is $0.2778 (¥2) input, $1.11 (¥8) output, and $0.006944 (¥0.05) cache read.

Here is the arithmetic made concrete. A run of 5M input tokens plus 1M output tokens without cache on GPT-6.1 Sol costs $1.85 (¥13.32) on 59API. At the official list price of $20 (about ¥144), that same workload is about 9% of list price. For comparison, 2M input plus 0.5M output tokens without cache on GPT-5.6 Sol is $1.67 (¥12) on 59API, versus $18 (about ¥129.6) at official list price, also about 9% of list price.

These are worked examples, not quotes, but they show the pattern: you can estimate a run before you launch it, then check the real usage afterward.

Step four: top up once and keep working

Your first request will not get far on an empty balance, so top up before you run anything serious. 59API accepts ¥10, ¥50, ¥100, ¥200, ¥500 and ¥1000, paid by WeChat Pay or bank card, and invoices are available. There is no monthly fee, and because the balance never expires, a small top-up today stays usable tomorrow. You are never forced into a subscription just to run a script.

Optional monthly and weekly cards exist if you prefer a prepaid allowance to wallet billing. A card has its own key, can only call that family's models, and is paid only from the card: it never falls back to wallet balance, and a balance key never draws on a card. Unused quota does not roll over. For example, the weekly G-PRO $1100 card costs $40.56 (¥292) for 7 days with a quota of $1100 and a weekly cap of $1100, draining at the card's metering price × 2.4. Quota and caps are card metering units written in $, not official list-price dollars, so treat them as card allowances rather than price comparisons.

For a first cURL test, plain wallet billing is the simplest path: top up, paste the request, read the answer. When the usage pattern becomes predictable, you can decide whether a card suits you better.

Step five: move from one command to a real workflow

You now have the piece most tutorials bury: a verified request. The next move is to reuse it. The same endpoint and key work in Codex, OpenAI SDKs and OpenAI-compatible clients such as Cursor, Cherry Studio, Cline and OpenCode, so you can move from a manual terminal call into your editor or your own scripts without changing providers.

Keep three things in your notes: the base URL https://api.59api.com/v1, the endpoint https://api.59api.com/v1/chat/completions, and the model ids exactly as listed. Swap gpt-6.1-sol for gpt-5.6-sol or deepseek-v4-flash and the rest of the command stays identical. That is what makes 59API pleasant to work with: one account, one API key, one API host, and a prepaid balance that is charged per request by real token usage.

Try it once in the terminal, then move the same request into your tool of choice. If you have been putting off the first call because of setup friction, this is the smallest possible version of it, and it takes one command.

接入文档

准备好开始了吗?

一个 Key 接入 Claude、GPT 等模型,按真实 token 计费,没有月费。注册后即可创建 API 密钥,每个模型的单价都在价格页。

免费注册 价格