Search docs

Search the TryOnCloud API docs

API reference

Check credits

GET /api/v1/credits: try-ons left on your account.

GET https://www.tryoncloud.com/api/v1/credits

Returns how many try-ons your account can still run, from the same pool POST /generate spends from.

Request

bash
curl https://www.tryoncloud.com/api/v1/credits -H "X-API-KEY: $TRYONCLOUD_API_KEY"

Response

json
{
  "credits_remaining": 4870,
  "purchased_remaining": 4870,
  "purchased_total": 5000,
  "free_remaining": 0,
  "spends_from": "purchased"
}
FieldMeaning
credits_remainingTry-ons you can run right now. Use this one
purchased_remainingPurchased credits left (they never expire)
purchased_totalAll credits ever purchased
free_remainingFree allowance left (only used before your first purchase)
spends_frompurchased once you have bought credits, otherwise free_allowance

Tips

  • Check before a big batch, and alert yourself when credits_remaining drops below a few days of usage.
  • Rate limit: 60 requests per minute per key. Do not call it before every try-on; a 402 from /generate already tells you when you have run out.
  • Buy credits from the dashboard Billing page.

Errors

HTTPcodeMeaning
401NO_KEY, INVALID_KEYMissing or wrong key
429RATE_LIMITEDOver 60 requests per minute
500CREDITS_UNAVAILABLETemporary problem, retry