Skip to content

Why did some credits return after a successful chat answer?

Chat reserves a conservative maximum before generation and settles the confirmed result using measured input and output tokens. If the final charge is lower, the unused reservation can return to the wallet. That is normal successful settlement, not necessarily a failure refund, a promotional credit or evidence that the answer was free.

UNDERSTAND API CREDITS AND COSTSAISwapLab team · Editorial methodPublished 2 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval
Article workflow: Read the confirmed receipt; Compare the two amounts; Describe the outcome accurately.
Workflow diagram: Read the confirmed receipt → Compare the two amounts → Describe the outcome accurately. Read the article for evidence and limits.

Different ledger movements have different meanings

The initial reservation protects the approved spending ceiling while the final usage is unknown. A short answer can use much less than max_tokens, and the input bound can exceed the actual metered input. Keep reserved_credits and final credits together so the user can understand both the temporary balance effect and the settled amount.

What to do next

  1. 01

    Read the confirmed receipt

    Save measured prompt and completion tokens, final credits, reserved amount and job ID. Distinguish a completed response from an uncertain job that lacks confirmed metering.

  2. 02

    Compare the two amounts

    Calculate the unused reservation only from confirmed recorded values. Do not treat a displayed balance change from another concurrent task as this job's settlement.

  3. 03

    Describe the outcome accurately

    Show the final charge and returned unused amount in your app's task record. Keep failed-job returns and successful usage settlements as different reasons in reporting.

A concrete example

Illustrative case: a request reserves for a 1,000-token answer but finishes with 100 output tokens. The final measured charge can be below the ceiling, and the unused portion returns while the completed response still has a nonzero cost.

Before you call it ready

  • The task is confirmed complete.
  • Reservation and final charge are both retained.
  • The return reason is identified correctly.

When to stop or choose another method

If usage or settlement is uncertain, do not calculate a fabricated final receipt from message length. Preserve the job and resolve its accounting state first.

Sources

One task. A recoverable workflow.

Check the contract, approve the quote and retain the job.

Open API documentation