All articles
Guides·4 min read

Cheap AI API Setup: Your First Omnirouter Request

Get from a new account to a working AI request. Set up prepaid credit, keep your key private, discover model IDs and test the Omnirouter API with curl.

By omnirouter

A cheap AI API is useful only when you can connect it, understand the bill and repeat a working request. This guide takes you from a new Omnirouter account to a small command-line test without adding a framework or committing to a subscription.

Omnirouter is prepaid: add credit, send requests and pay the listed rate for the model you use. Start small. Confirm that the response suits your task before connecting a long-running application.

1. Create a key and add credit

Create an account, open API keys and create a key. Save the secret securely when it is shown. The documentation says the secret is displayed once and cannot be recovered later.

Add credit under Billing before the first model request. New accounts start with a zero balance; there is no trial credit. A request without sufficient credit receives a 402 response rather than waiting in a queue. See the getting-started documentation for the current account flow.

Keep your key out of browser-side JavaScript, public repositories, screenshots and support messages. In an application, make the API call from your backend. For this terminal example, set an environment variable locally. Avoid storing a real key in a shared shell-history file.

2. Discover an exact model ID

Browse the model catalog for current rates, then check which models your account can access. The examples below use Bash-compatible syntax, including Git Bash; PowerShell quoting differs.

# Set OMNIROUTER_API_KEY locally before running this command.
curl --silent --show-error --fail-with-body \
  https://omnirouter.li/v1/models \
  -H "Authorization: Bearer $OMNIROUTER_API_KEY"

Copy the exact model ID you intend to test. Do not substitute a display name or guess punctuation. A catalog listing is not a promise that every model supports every API feature.

For routine text work, begin by evaluating an available model from an open-weight family such as GLM, DeepSeek, Qwen or Kimi. These are the practical starting point for a budget workflow, not a guarantee of identical quality or uninterrupted access. Frontier-model capacity can change without warning; avoid making it your only path.

3. Send one small request

Replace YOUR_MODEL_ID with the ID you selected. This command calls the chat-completions endpoint, not the Responses API or an image endpoint.

curl --silent --show-error --fail-with-body \
  https://omnirouter.li/v1/chat/completions \
  -H "Authorization: Bearer $OMNIROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
    "model": "YOUR_MODEL_ID",
    "messages": [
      {"role": "user", "content": "Explain a prepaid API in two sentences."}
    ]
  }'

The test prompt deliberately asks for a short answer. It is not a hard token limit; check the selected model and endpoint documentation before adding an output-limit parameter. Inspect the returned response and usage fields, then compare them with the per-request usage record in your account.

Already using an API client? The documented base URL is https://omnirouter.li/v1. A client that appends /chat/completions needs that base URL, not the complete request URL. Supplying both can create a duplicated path.

4. Diagnose the first failure

The API documentation describes these useful starting points:

ResponseFirst check
402Check prepaid balance and add credit if needed.
404Verify the exact model ID and whether it is enabled for your account.
503Check the error and try again later; do not launch an unlimited retry loop.

Errors include a request_id for support. Keep that ID and a sanitized error message. Never send your API key. For a persistent problem, contact Telegram support with the model ID, endpoint and approximate request time.

5. Expand only after the basic request works

Test streaming, structured output or tool calls separately if your application needs them. Shared API formatting does not imply that every upstream feature is supported. Review the service terms before relying on a particular model, provider or response time.

If you prefer a desktop interface, use the Cherry Studio setup guide. Otherwise, keep this command as a small smoke test for future client changes.

The next step is simple: compare current model prices, fund a modest test and measure whether the answer is useful. Cheap tokens matter most when they produce work you can actually use.

cheap AI APIAPI setupcurlprepaid APIOmnirouter