Ideogram API keys pause at $0 balance: Sume's 402 insufficient_credits

Ideogram's API is prepaid and its keys pause when the balance hits zero. Sume answers an empty wallet with 402 insufficient_credits. Handle both in code.

5 min readSume
All posts

Ideogram's API runs on prepaid credits and says keys pause when the balance reaches $0, with requests rejected as 402 when an account lacks a payment method or credits. Sume's wallet behaves similarly at the HTTP level: an insufficient balance returns 402 insufficient_credits, and the Image API does not bill failed generations.

Ideogram's details are from its API setup page, read 2026-10-02. Sume's are from Errors and credits and the Image API.

What does Ideogram's setup page say about credits?

The page describes a prepaid system: purchase options of $10, $20, $50, $100 or a custom amount, with a maximum balance of $300, and an auto-recharge option with a configurable threshold (from $5 to $900) and top-up (from $10 to $1,000). Subscription holders use monthly credits first and then the API balance. Requests are rejected with 402 when the account lacks a payment method or credits, and keys pause when the balance reaches $0. API keys are shown once at creation. Enterprise customers contact Ideogram for higher rate limits or invoiced billing.

What does Sume say?

Sume's error table lists 402 insufficient_credits as a balance that is not sufficient for the requested generation. Its billing section says a completed generation is billed in full, a failed or cancelled one is not billed, and a request that ends early because the client disconnected is billed as a failed generation. Sume's docs in the repo do not describe an auto-recharge feature for the API wallet, so this post makes no claim about one.

Facts read 2026-10-02
TopicIdeogram API setup pageSume docs
Funding modelPrepaid credits, $10 to $300 balance rangeWallet balance; amounts not covered here
Auto top-upAuto-recharge with thresholdsNot described in the docs read
Empty balanceKeys pause at $0; 402 on requests402 insufficient_credits
Failed generationNot stated on the pageNot billed
Key displayShown onceKeys managed in the API Keys dashboard

How should your code treat a 402?

Do not retry a 402 in a loop. Neither provider's money state changes by waiting a few seconds. Stop the batch, alert a human or a top-up job, and resume from the first unfinished item. Safe resume needs an Idempotency-Key per submission, so a request that did complete before the balance ran out is not paid for twice.

A pattern that works on Sume: submit, branch on status code, and treat 402 as a hard stop while 429 is a back-off.

import os, requests

r = requests.post(
    "https://api.sume.com/v1/images",
    headers={"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"},
    json={"model": "ideogram/ideogram-v3", "prompt": "A poster that says OPEN"},
    timeout=60,
)
if r.status_code == 402:
    raise SystemExit("insufficient_credits: top up, then resume")
r.raise_for_status()
print(r.json())

What else differs?

Ideogram says its image and video links expire and you should download results. Sume returns Sume-hosted signed URLs under data[].url. For the details of expiry on each side see Ideogram image URLs expire. For the sibling case on the tool endpoints see Ideogram 402 on tool endpoints.

Operational checklist for a prepaid wallet

Ideogram's page says all of an account's API keys share one credit balance, which means a leaked key can drain it for every integration. The same logic applies to any wallet: scope keys to the smallest set of jobs you can.

  • Check the balance before a large batch, and size the batch to the balance.
  • Treat 402 as terminal for the batch and 429 as a back-off.
  • Use one Idempotency-Key per submission so a resumed run does not repeat paid work.
  • Keep keys out of code and rotate them from the dashboard if one leaks.

Sources

Related posts

More in Comparisons

All Comparisons posts

Written by Sume