Models, prices and what the calling account may use
const url = 'https://api.stack.foldbun.com/v1/models';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.stack.foldbun.com/v1/models \ --header 'Authorization: Bearer <token>'Free, not metered, not rate limited by pool. available and pool describe the calling account.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”All models with their prices and their availability for the calling account.
object
One entry per model.
A model with its prices and its availability for the calling account.
object
Model id, as used in the model request field.
Display name.
Kind of work the model does.
Endpoints that accept the model.
License of the model weights.
Price book of the model.
object
Priced unit: encode_image, prompt, point, box, refine, image, page or text.
Credits per unit.
Whether the calling account may use the model now.
Pool serving the account (public, free, paid); null for internal accounts or when unavailable.
Included calls per UTC day at no charge (null: none).
Calls per minute at which the included daily allowance is served (null: none). Beyond it, the public pool answers 429; with a free pool, calls are billed from the balance instead.
When not available: what unlocks it, e.g. “top-up”.
Example
{ "data": [ { "id": "sam3", "name": "SAM 3", "task": "segment", "endpoints": [ "/v1/segment", "/v1/refine" ], "license": "SAM License", "prices": [ { "unit": "encode_image", "price": 0.5 }, { "unit": "prompt", "price": 0.05 }, { "unit": "point", "price": 0.02 }, { "unit": "refine", "price": 0.02 } ], "available": true, "pool": "paid", "freeDailyCalls": null, "perMinute": null, "unlockedBy": null } ]}default
Section titled “default”The error envelope. The HTTP status follows the code; only retryable: true errors are worth repeating
unchanged. A failed call costs 0.
| Status | Codes |
|---|---|
| 400 | invalid_request, invalid_image (the image passed the upload checks but could not be decoded), unsupported |
| 401 | unauthorized |
| 402 | insufficient_balance |
| 403 | model_locked |
| 404 | not_found, image_not_found |
| 409 | idempotency_conflict, request_in_progress |
| 413 | payload_too_large |
| 429 | rate_limited, daily_limit_reached, too_many_batches (all with Retry-After) |
| 500 | internal_error |
| 502 | upstream_error, bad_model_output |
| 503 | model_unavailable, model_busy, unavailable (all with Retry-After) |
| 504 | upstream_timeout |
model_unavailable also covers a short loss of contact with the only GPU worker serving the model: for about a
minute after the loss, interactive calls answer it at once with a short Retry-After (5 s), while sync and
batch calls stay queued until their own deadline instead of failing.
Meaning and retry guidance for each code: Errors.
Body of every error response.
object
The error.
object
Stable machine-readable error code. Branch on this, not on message. Listed with the HTTP statuses under Responses.
Human-readable explanation. The wording can change.
True when repeating the same request unchanged can succeed.
Suggested wait before a retry in milliseconds; 0 when there is no hint.
Example
{ "error": { "code": "model_busy", "message": "model sam3 is busy; retry shortly", "retryable": true, "retryAfterMs": 5000 }}Headers
Section titled “Headers”Whole seconds to wait before retrying; present on 429 and 503.
Server-generated request id (16 hexadecimal characters); present on every response. Quote it when contacting support.