Skip to content

What happens if my integration copies the website's displayed credits into the API cost limit?

Read the current credit version and use the API's own quote units for max_credits. Website display and developer ledger are different scales, so direct copying can reject an affordable request or express the wrong ceiling.

SHIP A RELIABLE INTEGRATIONAISwapLab team · Editorial methodPublished 2 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval

Keep both numbers labeled

Display the friendly website-equivalent cost only at the UI boundary. Store the returned API quote amount separately with its credit_version.

Check precision

Round only according to the API's documented precision. Keep amount and unit next to each other so a later migration cannot mix them.

Test the outgoing limit

For one sample, compare the approved cap with the raw POST body. Compare the actual API response with the amount held on the approved attempt.

Pass condition

The server receives a same-unit ceiling, and the human-facing summary clearly identifies the displayed or ledger quantity.

Sources

One task. A recoverable workflow.

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

Open API documentation