$0 monthly fee: your first curl chat request
01 / $0 monthly fee does not mean free requests
You can test an AI API without installing an SDK or paying for a subscription. This walkthrough uses curl, a terminal tool that sends HTTP requests. Start with one short prompt, limit the output to 32 tokens, and inspect the receipt before sending anything larger.
CheapRelay is a low-priced, pay-as-you-go AI API relay with no monthly fee and no subscription. Billing is per real token, including cache reads and writes. That makes small experiments possible, but generated text still costs money. Check the current model prices before funding an account; this article does not assume a particular token rate or minimum deposit.
02 / Prepare one key and one exact model ID
Sign up for CheapRelay, create an API key, and check the available funding options and current prices in your account. Choose a model that supports OpenAI-compatible chat completions. Gemini 2.5 Flash is one option to investigate; verify its current rate rather than assuming it is cheapest.
Copy the exact API model ID shown by the service. A display name is not necessarily a valid request value. The commands below use MODEL_ID as a placeholder, not as a real model name.
Use Bash or a compatible shell on Linux, macOS, or Windows through WSL. First check that curl is installed:
curl --version
Then set these variables, replacing both placeholder values locally:
export CHEAPRELAY_API_KEY='YOUR_API_KEY'; export MODEL_ID='EXACT_MODEL_ID'
Environment variables keep the key out of the request example, but they are not a secret vault. The export command can remain in shell history. Never paste a real key into a public issue, screenshot, or shared script.
03 / Send a 32-token chat request to /v1/chat/completions
The API base is https://api.cheapapirelay.com. OpenAI-compatible routes live under /v1, so the complete chat endpoint is https://api.cheapapirelay.com/v1/chat/completions. Run this as one command:
curl -sS --fail-with-body 'https://api.cheapapirelay.com/v1/chat/completions' -H "Authorization: Bearer $CHEAPRELAY_API_KEY" -H 'Content-Type: application/json' --data "{\"model\":\"$MODEL_ID\",\"messages\":[{\"role\":\"user\",\"content\":\"Reply with one short greeting.\"}],\"max_tokens\":32}"
The Authorization header identifies your account. Content-Type declares a JSON body. The messages array supplies the conversation, and max_tokens asks the API to cap the generated output. That cap is not a dollar limit and does not limit input tokens. Parameter support can vary by model; check the documented equivalent if the selected model rejects max_tokens.
The --fail-with-body option requires curl 7.76.0 or newer. On an older installation, remove that option and inspect the returned JSON for errors. The -sS flags suppress the progress meter while retaining connection error messages.
04 / Read the reply and the token receipt
A successful non-streaming response normally contains the answer at choices[0].message.content. Look for usage as well: common fields include prompt_tokens, completion_tokens, and total_tokens. Available usage details can differ by model.
For a simple uncached request with prices quoted per million tokens, estimated cost equals input tokens multiplied by the input rate, plus output tokens multiplied by the output rate, divided by 1,000,000. For example, a receipt showing 1,000 input tokens and 100 output tokens would cost (1,000 × input rate + 100 × output rate) / 1,000,000. Those are example counts, not measured results.
Cache reads and writes may have separate rates and accounting fields. Do not blindly add cached tokens twice. Reconcile your response usage with the account's billing record.
05 / Keep the next two tests small
- ■ Repeat once with a different short prompt. Avoid loops until you understand the charges.
- ■ Keep conversation history short: previous messages sent again become input again.
- ■ For authentication errors, check the key; for model errors, check the exact ID; for rate or balance errors, inspect the account before retrying.
- ■ Do not automatically retry every failure. Repeated requests can create additional charges.
After two or three deliberate tests, compare your balance and usage records. A working request and a readable receipt are enough for a first session; larger prompts and automation can wait.
Sign up Try the prices yourself, sign-up credit included.
More reading
| Date | Aisle | Written in | Title |
|---|---|---|---|
| 2026-10-27 | Cheap how-tos | EN | A $140 API Bill Cut to $40 by Sending Less An illustrative token receipt shows how removing unnecessary user data saves $100 across 10,000 requests without shrinking useful answers. |
| 2026-10-27 | Cheap how-tos | EN | $660.27 for a Prompt Style Guide: The Receipt A six-person team's illustrative prompt style guide budget, token bill, maintenance cost, and break-even math—with assumptions exposed. |
| 2026-10-27 | Cheap how-tos | EN | $8.46 a Month to Retire a Hobby App’s Free Tiers A worked hobby-app budget covering compute, storage, traffic and AI tokens, with clear assumptions and practical spending controls. |
| 2026-10-27 | Cheap how-tos | EN | A $8.40 Receipt for One Developer's AI Notebook A realistic receipt-style budget for building a personal knowledge chatbot with token-level billing and no monthly subscription. |
| 2026-10-27 | Cheap how-tos | EN | $0.04 for 100 AI calls: an illustrative receipt A beginner’s AI API guide with an illustrative four-cent receipt, token math, setup steps, and practical spending controls. |
| 2026-10-27 | Cheap how-tos | EN | $0.036 for 200 Textbook Flashcards: A Sample Receipt A transparent token budget for turning textbook excerpts into 200 flashcards, with review costs, pricing assumptions, and quality checks. |