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
- When a job is created, credits are reserved based on estimated usage.
reserved_creditsin the submission response is the amount reserved. - When the job succeeds, it is settled against actual usage and any excess reservation is returned. The actual charge is given in
actual_credits. - When the job fails, the reservation is refunded in full automatically; no request is needed.
- 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:
| Capability | Price source |
|---|---|
| Image generation | Image generation settings return the rates for each model and size and the rate_version |
| Video generation | The video quote returns quote_id, the billable duration and the credits required |
| Audio composition | The composition quote returns the credits required as credits and does not create a job |
| Voice design | Voice design configuration returns the rate per generation |
| Speech synthesis | Credits are reserved from the audio duration estimated from the text; reserved_credits in the submission response is the amount reserved |
| Text models | List 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.