59API

← 返回教程列表

GPT-6.1 Sol setup on 59API: a first cURL call guide

API 使用 · EN · 2026-11-18

Where first requests usually go wrong

Most API configuration failures are plumbing failures, not model failures. A base URL is missing its /v1 suffix, an endpoint belongs to a different protocol, an authentication header is present but malformed. The code itself can be perfect and you still end up staring at a 404 while you wonder whether the model name is wrong.

The quickest way past that is to send one request by hand from the command line before you touch your application. cURL is the right tool for this because it shows exactly what leaves your machine and what comes back, with no framework hiding the details. Once a single call succeeds, the same three values — host, path and key — transfer directly into any OpenAI-compatible client.

This guide walks through that first call to GPT-6.1 Sol through 59API: the exact settings, a request body you can save to a file, a command you can paste into a terminal, and a clear picture of what the call costs. It stays deliberately narrow — one model, one endpoint, one command. If you have been wondering whether a relay setup is worth the effort, this is the smallest useful test you can run.

One boundary is worth stating early. Claude models on 59API work only in the genuine Claude Code or Claude Desktop client (Claude Code 2.1.285 or newer), never through cURL. Gemini models use Google's native protocol only, through Gemini CLI. The cURL path below therefore covers GPT, DeepSeek and other non-Claude, non-Gemini models — which is exactly where GPT-6.1 Sol sits.

What 59API gives you before you write any code

59API is an independent third-party AI API relay, and the model is refreshingly plain: one account, one API key and one API host, https://api.59api.com, serving Claude, GPT, Gemini, DeepSeek and other models. You are not stitching together several vendors or maintaining several billing relationships just to test a single idea.

The billing model suits experimentation. 59API runs on a prepaid balance, charged per request according to real token usage, with no monthly fee. Your balance never expires, so an unused top-up is not a deadline you have to rush to meet. Monthly and weekly cards exist as an option if you later want a fixed allocation, but nothing about them is required to make your first request.

Top-ups are available at ¥10, ¥50, ¥100, ¥200, ¥500 and ¥1000, paid by WeChat Pay or bank card, and invoices are available. Prices are quoted per 1 million tokens and billed in CNY, with USD figures shown at ¥7.2 = $1. That means a test can start small: fund ¥10, send a request, then read actual consumption instead of guessing from a monthly subscription.

Because you pay by real token usage, that first cURL call doubles as a measurement. You can see how many tokens a prompt and an answer truly consume, compare the numbers with the published per-model rates, and decide whether 59API suits your workload before committing to anything larger.

The exact settings to copy

Three values do all the work. 59API exposes an OpenAI-compatible surface, so cURL, Codex, OpenAI SDKs and OpenAI-compatible clients such as Cursor, Cherry Studio, Cline and OpenCode share the same base URL: https://api.59api.com/v1. The chat endpoint is https://api.59api.com/v1/chat/completions. Keep the /v1 on the base URL — dropping it is a frequent reason a first request fails.

Your key travels in the Authorization header as a Bearer token, and in commands it appears as the placeholder YOUR_59API_KEY. cURL handles the header name; you supply the value. Keep the key in a shell variable or an environment file rather than pasting it into code you commit.

The full contract is short enough to memorise:

There is no SDK to install, no client configuration file, and no separate account per model family on the wallet-based path. When you are ready to move from the terminal into application code, the same base URL and the same key are what you configure in your client. That is the appeal of testing with cURL first: you establish the working combination before there is any framework to blame for a failure.

Sending the request and reading the result

To avoid fighting with shell quoting on your first attempt, save the request body as a file named body.json:

Then run the request from that same directory:

A successful call returns JSON containing the assistant message along with the usage fields for that request. Those usage numbers are the interesting part, because 59API bills on real token consumption rather than a flat subscription. If the response is valid but the wording is not what you expected, refine the prompt and send it again — each call is priced independently, and your balance simply moves with it.

When something fails, work through the three values in order. A 404 usually means the endpoint path is wrong or the /v1 prefix is missing. A 401 means the key is not being transmitted correctly, or the placeholder was never replaced with your real key. A 400 pointing at the model means the id does not match, so check gpt-6.1-sol character by character. Most failed first requests land in one of those three buckets, and both endpoint and key can be verified in seconds.

Once the call succeeds, keep the command. It becomes a smoke test you can run before a deploy, and it documents your configuration more precisely than a screenshot ever could.

What it costs and where to go next

GPT-6.1 Sol on 59API is priced per 1 million tokens at $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 of $2 / $10 for input and output. A worked example makes the difference concrete: 5M input plus 1M output tokens without cache costs $1.85 (¥13.32) on 59API, versus an official list price of $20 (about ¥144) — about 9% of list price.

You are not locked to one model. DeepSeek V4 Pro is $1.25 (¥9) input and $3.75 (¥27) output, and MiniMax M3 is $0.1389 (¥1) input and $0.5556 (¥4) output, both reachable on the same cURL path. Switching models means editing one string in body.json, which makes cost-versus-quality testing unusually cheap.

If you later want a fixed allocation rather than a wallet, monthly and weekly cards are optional. A card has its own key, can call only 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. As an example, G-PRO 入门版 (GPT, 30 days) is $83.19 (¥599), with quota $2300 and a weekly cap $880, draining at the card's metering price × 2.4. Card quota and caps are metering units written in $, not official list-price dollars, so read them as card allowances rather than price comparisons.

For a first request the prepaid balance path is simpler: top up, use the wallet key, and let real usage decide whether a card makes sense later. One successful cURL call is enough to tell you whether 59API fits the way you work.

接入文档

准备好开始了吗?

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

免费注册 价格