59API

← Voltar aos guias

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

API · EN · 2026-11-26

Why your first API call takes longer than it should

Most developers do not struggle with the prompt. They struggle with the plumbing: a base URL copied from the wrong screen, an endpoint that ends one path too early, an auth header the server never sees, and a client that quietly expects a different protocol.

That friction is why the first request can eat an afternoon. You configure a provider, run the command, read an error, and start guessing. The model was never the problem.

59API removes most of that guesswork by keeping the surface area deliberately small. One account, one API key, one API host at https://api.59api.com, and a single OpenAI-compatible path for the model families that speak it. You point your client at that host, paste your key, and make a request.

This guide walks through the whole first call with cURL, using GPT-6.1 Sol as the model, and gives you the exact values to copy. It also shows what a request costs, what to check when something fails, and when a card makes more sense than pay-as-you-go.

By the end, you will have a working request, a clear idea of the bill, and a setup you can reuse in Codex, the OpenAI SDKs, or OpenAI-compatible clients such as Cursor, Cherry Studio, Cline and OpenCode.

Prepare the account, key and balance

Start at https://59api.com. Create your account, then generate a single API key. That key is the only credential you need for the setup below: it identifies the account, and requests are billed against the account balance.

59API uses a prepaid balance. You top up first, then each request is charged by real token usage. There is no monthly fee, and your balance never expires, so an unused top-up is not a deadline you have to race.

Top-up options are ¥10, ¥50, ¥100, ¥200, ¥500 and ¥1000, paid by WeChat Pay or bank card. Invoices are available if you need one.

Billing is in CNY, and the price list also shows USD at ¥7.2 = $1. That makes it easy to compare a request with a provider's official list price as a reference point.

Before you send anything, copy your key into a variable in your shell rather than pasting it into scripts repeatedly. For example, export the key under a name like API_KEY, then reference that name in your commands and application code. It keeps the secret in one place, makes rotation painless, and keeps it out of version control and shared screenshots.

Set the base URL and endpoint exactly

For cURL and every OpenAI-compatible client, 59API uses base_url https://api.59api.com/v1 and the chat endpoint https://api.59api.com/v1/chat/completions. Copy both carefully: the trailing /v1 belongs to the base URL, and the endpoint is built on top of it.

This path serves GPT, DeepSeek and other non-Claude, non-Gemini models. Codex, the OpenAI SDKs, cURL, Cursor, Cherry Studio, Cline and OpenCode all use these same settings.

Two protocol boundaries are worth stating plainly, because they cause most of the confusing errors.

For this guide, stay with GPT-6.1 Sol and the /v1/chat/completions endpoint. Once that call returns, the same base URL and key carry over to your editor or agent client without further ceremony.

Send your first cURL request

Put the request body in a file so the command stays readable and your shell history stays clean. Create request.json with three fields: model set to gpt-6.1-sol, a messages array containing one user message, and stream set to false for a single complete reply.

Then run:

curl https://api.59api.com/v1/chat/completions --json @request.json -H Authorization:Bearer\ $API_KEY

The --json flag posts the file and sets the JSON content type for you. The escaped space in the Authorization header keeps the Bearer prefix and your key together as one value without any quoting.

If you prefer to watch the response arrive, add --no-buffer and set stream to true in the file. Otherwise, a successful call returns the model's reply in a single response.

A good first prompt is deliberately boring: ask the model to name three uses for a JSON API and return the answer as a short list. It exercises the endpoint, the key and the model without giving you a large bill to worry about.

Three responses matter here. A 401 means the key is wrong or the Authorization header never reached the server; check for stray spaces. A 404 on the URL usually means /v1 was dropped or duplicated. A 200 with an error inside the body usually means the model id is misspelled.

Know the cost before you scale

59API charges per request based on real token usage, so the bill follows the work your prompt actually causes. Prices are per 1 million tokens, and each model has its own input, output and cache-read rate.

For GPT-6.1 Sol, the rate is $0.1847 (¥1.33) per 1 million input tokens, $0.9264 (¥6.67) per 1 million output tokens, and $0.0375 (¥0.27) for cache reads. The official list price is $2 / $10 as a reference point.

For GPT-5.6 Sol, the rate is $0.3472 (¥2.5) input, $1.94 (¥14) output and $0.0278 (¥0.2) cache read; its official list price is $4 / $20 (OpenAI promotional price, at least through 2026-11-21).

A worked example makes the gap concrete. GPT-6.1 Sol with 5M input tokens and 1M output tokens, without cache, costs $1.85 (¥13.32) on 59API. At the official list price of $20 (about ¥144), that is about 9% of list price.

GPT-5.6 Sol with 2M input tokens and 0.5M output tokens, without cache, costs $1.67 (¥12) on 59API. At the official list price of $18 (about ¥129.6), that is about 9% of list price.

Because the balance never expires, start with a small top-up and add funds when the pattern is clear.

When to move from balance to a card

Pay-as-you-go suits irregular usage. If your team runs a predictable daily workload, a monthly or weekly card can simplify budgeting.

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.

Two examples: the G-PRO Entry card for GPT runs 30 days, costs $83.19 (¥599), carries quota $2300 with a weekly cap $880, and drains at the card's metering price × 2.4. The Weekly G-PRO $1100 card for GPT runs 7 days, costs $40.56 (¥292), and carries quota $1100 with a weekly cap $1100.

Quota and caps are card metering units written in $, not official list-price dollars, so read them as card limits rather than comparisons with list price.

If you are still deciding, keep the balance route for the first calls: it keeps the bill proportional to what you actually send, and you can top up again whenever you want.

Either way, the first step is the same: point cURL at https://api.59api.com/v1/chat/completions, send gpt-6.1-sol, and see the reply. Once that works, everything else is configuration.

Docs

Pronto para começar?

Uma só chave para Claude, GPT e outros, com cobrança por tokens reais e sem mensalidade. Cadastre-se para criar sua chave API; as tarifas de cada modelo estão na página de preços.

Cadastro grátis Preços