ospalabs

Request and response headers

Optional request headers

  • x-fuse-user: your customer's id (1-128 characters: letters, digits and . _ : @ = / + -). Turns on per-customer caps and the top-spenders table. Without it, Fuse uses the body's user field if it fits the same rules. Use an opaque id, not an email address.
  • x-fuse-tag: a label for cost reporting, such as feature=search (1-64 characters, same alphabet).
  • x-fuse-plan: your customer's plan, such as free or pro (1-64 characters, same alphabet). Team plan. Picks the cap you set for that plan on the Customers page. A cap set for that one customer wins over it, and it wins over the default per-customer cap. An unknown plan name gets the default.

An invalid value is refused with 400 invalid_customer_id or 400 invalid_tag, so typos never split your data silently.

Response headers

  • x-fuse-request-id matches the row in the project log.
  • x-fuse-reserved-usd is the worst-case hold taken before the provider was called.
  • x-fuse-cost-usd is set when the final cost is known.
  • x-fuse-model and x-fuse-downgraded-from appear when soft landing sent a cheaper model than the one requested.
  • x-fuse-shadow-would-block appears in shadow mode on a request that would have been refused (fuse_blown, key_ceiling or customer_ceiling).

After a request is forwarded, the provider status and body are returned as the provider sent them.

Refusals from Fuse use the same x-fuse-request-id. Look that id up in the project log. x-fuse-reserved-usd is present on the way out, before usage is known. x-fuse-cost-usd replaces the estimate when the provider usage has been read. On a refusal before any provider call, there is no cost header, because nothing was reserved or the reservation was not a completed call.

Do not parse the provider body to discover the Fuse decision. Use the HTTP status and the error field. Provider errors keep the provider's own JSON shape.