Skip to content
Foldbun StackDocs
中Get an API keyComing soon

Models, prices and what the calling account may use

GET
/v1/models
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.

All models with their prices and their availability for the calling account.

Media typeapplication/json
object
data
required

One entry per model.

Array<object>

A model with its prices and its availability for the calling account.

object
id
required

Model id, as used in the model request field.

string
name
required

Display name.

string
task
required

Kind of work the model does.

string
Allowed values: segment ocr parse embed remove-background
endpoints
required

Endpoints that accept the model.

Array<string>
license

License of the model weights.

string
prices
required

Price book of the model.

Array<object>
object
unit
required

Priced unit: encode_image, prompt, point, box, refine, image, page or text.

string
price
required

Credits per unit.

number
available
required

Whether the calling account may use the model now.

boolean
pool

Pool serving the account (public, free, paid); null for internal accounts or when unavailable.

string | null
freeDailyCalls

Included calls per UTC day at no charge (null: none).

integer | null
perMinute

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.

integer | null
unlockedBy

When not available: what unlocks it, e.g. “top-up”.

string | null

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
}
]
}

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.

Media typeapplication/json

Body of every error response.

object
error
required

The error.

object
code
required

Stable machine-readable error code. Branch on this, not on message. Listed with the HTTP statuses under Responses.

string
message
required

Human-readable explanation. The wording can change.

string
retryable
required

True when repeating the same request unchanged can succeed.

boolean
retryAfterMs
required

Suggested wait before a retry in milliseconds; 0 when there is no hint.

integer

Example

{
"error": {
"code": "model_busy",
"message": "model sam3 is busy; retry shortly",
"retryable": true,
"retryAfterMs": 5000
}
}
Retry-After
integer
>= 1

Whole seconds to wait before retrying; present on 429 and 503.

X-Request-Id
string
/^[0-9a-f]{16}$/

Server-generated request id (16 hexadecimal characters); present on every response. Quote it when contacting support.