Routing
Set provider requirements and bound your request’s reserve.
Set routing requirements
Keep generation settings such as temperature, top_p, tools, tool_choice, response_format, and reasoning_effort in the usual top-level fields. Put provider requirements in fossa. Unsupported fields or conflicting limits return an error before payment.
Prices use decimal strings in USDC per million tokens, with at most six decimal places. A price cap limits each agreed provider rate. It does not include the list surcharge. max_spend_usdc bounds the booking’s total usage reserve, including that surcharge; network fees remain separate.
The reserve assumes uncached input. The preferred provider is eligible to report cached-input discounts when it wins the match; another matched provider uses the uncached rate. Confirmed usage determines the final charge.
Routing fields
All fossa fields are optional. Omit a field to use its default. Requirements filter offers for the requested model; they never switch to another model.
| Field | Meaning and default |
|---|---|
routing | balanced weighs estimated cost and declared speed. cheapest prefers estimated cost. fastest prefers declared speed. Default: balanced. |
max_price.input, max_price.cached, max_price.output | Separate rate caps. Omitted caps are unset. |
required_concurrency | Positive whole number, at most 4_294_967_295. Requires sufficient global provider concurrency and unlimited or sufficient wallet concurrency. Default: 1. Each call books one slot; this does not guarantee batch or running-inference capacity. |
min_speed | Minimum declared tokens per second, as a whole number. Default: 0. It is not a measured-speed guarantee. |
checkpoint | Exact 64-character hexadecimal checkpoint hash from the model list. Default: the latest published checkpoint. |
variant | Published variant ID. It selects that variant’s generation settings. Default: the highest published reasoning effort. |
modalities.input, modalities.output | Required formats as arrays: text, image, audio, or video. Default: ["text"] on each side. Chat output must be text; these filters do not enable unsupported media bodies. |
limits.min_context_tokens | Minimum total context capacity. Default: no extra minimum. |
limits.max_input_tokens | Positive input reservation bound. The complete request must fit it. By default, the API counts the text prompt using the checkpoint’s published counter when available. Otherwise it reserves a conservative estimate. |
limits.max_output_tokens | Positive output reservation bound. Also accepts top-level max_tokens or max_completion_tokens; do not supply conflicting values. |
data_retention | zero requires an offer declaring zero data retention. Default: any. This filters provider offers; it does not bypass the hosted API. |
max_spend_usdc | Decimal-string ceiling for this booking’s usage reserve, including the list surcharge. Default: no extra ceiling. |
Input and output bounds must each fit the offer’s limits. Their sum must fit its context. Without an output bound, the API uses the model’s published default within eligible provider capacity. A larger bound can reserve more funds.
Routing preferences prepare booking limits. The program matcher checks current offers and chooses the lowest estimated charge within those limits. The final match can differ from the model-list preview. The program scans every populated offer in the selected list/model book and enforces global and wallet concurrency and quota across all of that provider’s models and lists. Each successful booking consumes one quota unit; release does not refund it.