Tasks

Quote a task before reserving funds

Validates the same model input and admission rules as task creation, without creating a task, reserving funds or starting generation. The signed quote is bound to this account, API key and request and is valid for five minutes. Pass quoteId and expectedCost with the same request to createTask or jobs/stream. New acceptance rejects an expired or changed quote with business code 40901. A replay of an already accepted Idempotency-Key still returns the original task. A quote does not reserve capacity or guarantee future availability.

post/api/v1/jobs/quote

Request

  • Base URL: https://api.spicyapi.ai
  • URL: https://api.spicyapi.ai/api/v1/jobs/quote
  • Auth: HTTP bearer

Request body

modelstring required

Exact model value from the model catalog.

inputobject required

Validated against the selected model's inputSchema. Declared image fields accept public HTTPS URLs, committed spicy:// file URIs, legacy persona image references spicy://p/<id> (personas became characters in your personal asset library on 2026-10-12; these references keep resolving to the same images, only in your personal library and only with API keys you created in your personal workspace, so team workspace keys, another account's id and an unknown id all get the same rejection, and they are refused in video, audio and file fields), saved assets as spicy://a/<id> in the media field of the matching kind (the asset must be in the library of the key's workspace: a personal key uses your personal library, a team key uses that team's library; any other asset gets the same rejection as an unknown id), or standard Base64 Data URIs (image/jpeg, image/png, image/webp, image/gif). Inline images are limited to 1048576 decoded bytes and 8388608 pixels each, 8192 pixels per side, and 16 images / 16777216 pixels in total. The complete JSON request must fit within 2097152 bytes. Model-specific limits still apply. Bare Base64, SVG and inline audio/video are not accepted; use HTTPS or file uploads instead. Inline images are stored as account-bound uploaded files; returned input contains file URIs, never the original Base64 bytes. Quote validation does not upload or reserve funds. If the model's inputSchema declares seed and you omit it, we pick a random seed for this task, so two identical requests do not come back with the same output. The chosen seed is returned in the task's input; pass it back to hold the draw steady (a fixed seed keeps runs comparable, it does not guarantee an identical result). On the few models that cannot honour seed on every request, we still vary it where it applies but do not echo it. A seed you send yourself is always used as given. Models that offer an economy route declare the boolean official_fallback (default true): the request runs on the economy route first and, if that fails and the field is true, is retried once on the official route. The hold is the highest price the request can be billed at (the official price while the fallback is allowed); you are billed the price of the route that actually produced the result and the rest of the hold is released. With false, only the economy route is tried and the hold is the economy price.

callBackUrlstring uri

Optional public HTTPS endpoint for terminal task delivery. http:// URLs are rejected: the delivery carries the prompt and signed result links. Explicit ports other than 443 and 80 are rejected, and URL credentials are rejected. The hostname must resolve to public IP addresses and is checked again when connecting. Invalid values return HTTP 400 with code 400, msg "Invalid callback URL", and request_id.

quoteIdstring

Signed quote returned by jobs/quote for this same account, API key and request. Does not replace Idempotency-Key.

expectedCoststring

Decimal USD amount encoded as a string to avoid binary floating-point loss.

Response

Customer price and maximum charge; no funds were reserved.

codeinteger required
msgstring required
request_idstring required

Correlation identifier. Include it in support requests.

Changes

No recorded changes to this operation across all 1 revision of this API.