Billing and credits

Credits

All API usage is billed in credits. Credits are deducted from your account balance, which is shared by every API Key of the account. Each ¥0.01 paid adds 1 credit; top up in the console wallet. When credits are insufficient, submissions return 402 INSUFFICIENT_CREDITS.

Settlement of asynchronous jobs

  1. When a job is created, credits are reserved based on estimated usage. reserved_credits in the submission response is the amount reserved.
  2. When the job succeeds, it is settled against actual usage and any excess reservation is returned. The actual charge is given in actual_credits.
  3. When the job fails, the reservation is refunded in full automatically; no request is needed.
  4. When a job is stopped, whether the reservation is refunded is given in the stop job response.

Find prices

Before submitting, get rates or quotes from these endpoints:

CapabilityPrice source
Image generationImage generation settings return the rates for each model and size and the rate_version
Video generationThe video quote returns quote_id, the billable duration and the credits required
Audio compositionThe composition quote returns the credits required as credits and does not create a job
Voice designVoice design configuration returns the rate per generation
Speech synthesisCredits are reserved from the audio duration estimated from the text; reserved_credits in the submission response is the amount reserved
Text modelsList text models returns token prices for each model

Rates may change. Image and video requests must carry the rate version returned by the configuration or quote. If the rate has changed, the submission returns 409; read the rate again before resubmitting.

Text models are billed per token

Text models do not create jobs. Input tokens, cached input tokens and output tokens are priced separately. Credits are reserved from max_tokens when the request starts and settled from actual usage when it completes, with any excess returned immediately; a failed request is refunded in full. See the text model guide.

On this page