What happens when my AI API credit runs out?
When your AI API credit runs out on a prepaid plan, requests stop and your app gets an error instead of a response. With Dongee AI Router no debt is created, and a top-up from 3 USD gets it working again.
When your AI API credit runs out on a prepaid plan, requests stop and your app gets an error instead of a response. Dongee AI Router, a prepaid multi-model AI API, works this way: no debt is created, and a top-up from 3 USD gets it responding again. Make your app fail gracefully and see it coming.
Updated November 24, 2026 · Dongee Team
What exactly happens to your app when the credit runs out?
Your code stays the same, but every call to the model stops returning text. In practice, this is what happens:
- Calls fail with an API error. With OpenAI-compatible APIs you usually get a 4xx HTTP status code with a message about quota or balance. The exact code depends on the provider, so don't build your logic around a number you haven't verified.
- The chatbot shows an error or hangs if you don't handle the exception. The user sees a broken screen or a "typing…" indicator that never ends.
- n8n workflows stop at the AI node and the following steps don't run, unless you've set up an error path.
- Streaming gets cut off: a response that was being generated may be left half-finished.
- Your data isn't lost. Your database, users and app content stay intact. The only thing that stops is AI generation.
Prepaid or pay-as-you-go: what changes when it runs out?
The billing model decides what happens when you hit the limit. This is an honest comparison: no option is perfect.
| Model | What happens at the limit | Risk of a surprise bill | Risk of service outage | Best for |
|---|---|---|---|---|
| Prepaid (Dongee AI Router) | Requests stop when the balance hits zero; no debt is created | None: you never spend more than you loaded | High if you don't watch the balance or top up in time | Fixed-budget projects, freelancers, agencies and testing |
| Pay-as-you-go by card | Usage keeps going and you're billed at the end of the month | High: a loop or a leaked key only shows up when the bill arrives | Low, as long as the card has available credit | Companies with mature financial controls and alerts |
| Pay-as-you-go with a monthly spending cap | It cuts off when it reaches the cap you set | Medium: bounded by the cap, but you pay afterwards | Medium: it goes down when it hits the cap | Teams that want to pay later with a spending ceiling |
With prepaid, you trade the risk of an unexpected bill for the risk of your app stopping. You can control that second risk with the steps below.
How do you keep your app from going down when the credit runs out?
- Check usage by model and by key. The Dongee AI Router panel logs every request with date, model, tokens, cost, duration and result. If you're not sure where to start, follow this guide to view token usage by key and by model.
- Work out your daily spend and top up before it runs out. Divide last week's spend by seven and see how many days of balance you have left. Set a reminder for when only a few are left.
- Handle the error in your code. Use try/catch, show the user a friendly message and retry with a delay only for temporary errors, such as a server failure. Never loop a request that was rejected for lack of credit, because it will keep failing.
- Use separate keys per project and limit the models each one can use. That way one project can't eat another's balance. Here's how to limit an API key to certain AI models.
- Use cheaper models for simple tasks. You don't need the most expensive model to classify, summarize or extract data. You'll find more ideas in how to optimize token usage with AI routers.
This Node.js (ESM) example uses the openai SDK with the base URL and key in environment variables. If something fails, it returns a fallback message and logs the error:
import OpenAI from "openai";
const client = new OpenAI({
baseURL: process.env.AI_BASE_URL,
apiKey: process.env.AI_API_KEY,
});
const RESPALDO = "I can't answer right now. Please try again in a few minutes.";
const esperar = (ms) => new Promise((r) => setTimeout(r, ms));
export async function responder(pregunta, intento = 1) {
try {
const r = await client.chat.completions.create({
model: process.env.AI_MODEL,
messages: [{ role: "user", content: pregunta }],
});
return r.choices[0].message.content;
} catch (err) {
console.error("AI API error", { status: err.status, message: err.message });
// Retry only once, and only for a temporary server error
if (err.status >= 500 && intento < 2) {
await esperar(2000);
return responder(pregunta, intento + 1);
}
// 4xx errors (credit, key, permissions): don't retry, respond gracefully
return RESPALDO;
}
}If this is your first time pointing the SDK at an API other than the original, check this guide to the OpenAI SDK in Node.js with a compatible API.
How do you top up, and how fast does it work again?
In Dongee AI Router, top-ups are made in USD, from 3 USD, using the payment methods on your Dongee account. Dongee accepts payments in COP, USD, EUR, MXN, PEN, CLP or BRL. The balance you load works for all your keys, so you don't have to split it up. As soon as the balance is available, your requests are processed again without changing anything in your code. If something doesn't add up after topping up, 24/7 human support in your language (the platform translates on the fly) can help you check it by chat or WhatsApp.
What mistakes drain the credit faster than expected?
- Retry loops: a
whilethat repeats a failed request can burn through your balance in minutes. - Sending the full history with every request: each new message drags the whole conversation along and tokens keep growing. Summarize or trim the history.
- Using the most expensive model for everything: save the large models for what really needs them.
- Exposing the key in the frontend: anyone can copy it from the browser and spend your balance. Always call the API from your server.
- Bots with no per-user message limit: a single user or script can drain the balance. Set a cap per user per day.
Frequently asked questions
Do I owe money if my Dongee AI Router credit runs out?
No. It's prepaid: your balance is your limit. When it hits zero, requests stop and no debt is created.
Are my keys or settings deleted?
Your keys are yours: you create them, limit them and delete them from your account. The balance is shared across all your keys, so one top-up covers all of them.
How much does each request cost?
It depends on the model. Each model has its own price, and Dongee doesn't set its own per-token prices. The request log shows you the exact cost of each call.
Is there a monthly fee?
No. There's no monthly fee or minimum plan: you only pay for the balance you load, from 3 USD.
Do new accounts get credit to try it?
Yes. New accounts receive a welcome credit to try the models, including from the in-browser playground.
Does Dongee store my conversations?
No. Dongee AI Router doesn't store conversation content. It only logs usage data: model, tokens, cost and time of each request.
Running out of credit doesn't have to be an emergency. Handle the error in your code, use separate keys per project, review usage every week and top up before you hit zero. That way your app never stops responding.
Comenta lo que quieras
Unete a la charla
Solo ingresa tu email