Keep estimation, spending approval and creation separate
The quote route uses the documented input structure for the intended operation, including max_credits. Image, video and text calculations have different bases; for chat, the estimate is a maximum reservation ceiling that can differ from final measured usage. A displayed USD list value is not automatically your bulk-pack cash allocation. Account balance, key allowance, concurrent jobs or service readiness can change between quoting and creation, so retain the observation time and recheck when the approved task changes.
What to do next
- 01
Build one valid request without submitting it for generation
Choose an exact supported alias and fields from the current contract. Include required durations, image size or chat messages as appropriate. Use only owned file IDs for documented reference fields. Send that body to /quotes, not to the media or chat creation path.
- 02
Review the estimate and its meaning
Read credits, credit_version and other returned pricing fields without inventing absent values. Compare the amount with the user's intended spending ceiling. For chat, explain reservation versus settlement; for video, confirm both reference and requested output durations. Record the quoted input so a later change cannot silently spend under an earlier approval.
- 03
Create only the approved task
Check current availability, sufficient balance and key limits. Use the approved body with a durable idempotency key on the appropriate creation route. If the quote exceeds max_credits or the setup changes, return to approval rather than automatically increasing the ceiling. Do not call repeated creation a way of refreshing a quote.
A concrete example
Illustrative approval: a user agrees to a quote for one image at a stated size and quality. Before submission, the interface switches to a larger size. The earlier approval does not cover that new request even if both use the same model name. The application requests a fresh quote, shows the changed credit amount and waits for approval. If the model becomes unavailable, it preserves the prepared input instead of interpreting the quote as a guarantee of capacity.
Quote-to-create record
| Field | Retain |
|---|---|
| Approved input | Exact model and normalized settings |
| Estimate | Credits, version, returned price fields and time |
| User ceiling | Reviewed max_credits |
| Creation identity | One idempotency key for this approved task |
Before you call it ready
- The estimate comes from /quotes, with the exact intended input.
- Reservation ceilings and final usage are explained where relevant.
- Creation uses a separately approved body and spending cap.
When to stop or choose another method
Stop when the price, input or availability differs from what was approved. Do not treat estimation as a hold on credits or automatically enlarge max_credits to make a request pass.
