API Documentation
Quick integration guide and complete API reference
Billing
Different models can bill in different ways
Not every model uses the same billing logic. Text models usually bill by tokens, while image and video models may bill per request, per image, or per duration.
If you only want the fast answer, check the model's billing_type first, then confirm the price on the model list or pricing page.
| billing_type | What it means | Common usage scenario |
|---|---|---|
| token | Input and output tokens are billed separately. Common for text and multimodal models. | Most common for text, chat, and multimodal understanding models. |
| request | Billed per successful request. | Common for request-based endpoints where one completed call maps to one charge. |
| image_count | Billed by the number of returned images. | Common for image generation models where the number of returned images affects the final charge. |
| duration_seconds | Billed by video duration in seconds. | Common for video generation models where longer output usually means higher cost. |
| token_total | Billed by total token usage without input/output split. | Used by some models that calculate cost from total consumption rather than separate input/output buckets. |
If this is your first integration
For an initial test, you do not need to memorize every billing detail. It is enough to know that different models can use different billing_type values.
Use the model list, pricing page, or model detail view to confirm how a specific model is billed.
Start with the text endpoint to validate your integration, then continue with image or video models that may have extra billing differences.
How to estimate and verify cost
Check the model before calling
Use the model list, pricing page, or model details to confirm billing_type and unit price. Do not infer cost only from capability type.
Start with small tests
Use a short text prompt, generate one image, or create a short video task to keep first validation inexpensive.
Review logs after calling
Check usage logs for model, token, request status, and cost. For video failures or cancellations, use the final settlement result.
Things to keep in mind
- Billing mode is decided by model configuration, not automatically by broad capability labels such as text, image, or video.
- Video tasks usually reserve quota first, then settle or refund after the task reaches a terminal state.
- If you care about exact cost, always use the currently displayed model price and billing_type as the source of truth.
