Skip to content

Can I preview an API request's cost without generating anything?

Yes. Submit the intended input to POST /api/v1/quotes to inspect its credit estimate without creating a generation job. Review the returned units, model and normalized settings, then obtain approval before a separate creation request. A quote is not a reservation of capacity, balance or future availability, and raising max_credits does not make an unavailable model ready.

START WITH THE APIAISwapLab team · Editorial methodUpdated 3 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval
Article workflow: Build one valid request without submitting it for generation; Review the estimate and its meaning; Create only the approved task.
Workflow diagram: Build one valid request without submitting it for generation → Review the estimate and its meaning → Create only the approved task. Read the article for evidence and limits.

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

  1. 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.

  2. 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.

  3. 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

FieldRetain
Approved inputExact model and normalized settings
EstimateCredits, version, returned price fields and time
User ceilingReviewed max_credits
Creation identityOne 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.

Sources

One task. A recoverable workflow.

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

Open API documentation