serving

Post Serving Authorize

Authorize an external serving chat request: the user's API key's org must own the adapter.

Auth model: a user authenticates the serving endpoint with THEIR OWN Freesolo API key and may only reach adapters their org owns. The shared internal key is a separate master credential that can reach ANY adapter — trusted server-to-server callers (the control plane, the /api/sample proxy) present it and bypass this route entirely at the serving layer. This endpoint exists only for the user-key path.

Machine-to-machine: the serving layer calls this (authenticated with the internal key) before generating, passing the caller's Freesolo API key and the requested adapter id. We resolve the key's org and the adapter's owning org and require they match.

The adapter→org mapping (hosted_lora_adapters.org_id) is the AUTHORITATIVE source of the owning tenant — the same source /billing/serving-usage bills against, so an authorized chat is always attributable. A multi-LoRA endpoint serves adapters owned by different orgs on shared capacity, routed by the model field, so a valid key is not enough — its org must own that specific adapter.

Base models: a served base-model id (token_pricing.is_priced_base_model) is a no-LoRA serve reachable by ANY valid key — no ownership check — and the returned orgId is the CALLER's org so the serving layer bills the caller (there is no adapter owner).

Returns 200 {orgId} on success; 401 for an invalid key, 404 for an unknown/unattributed adapter, 403 when the key's org does not own the (non-base) adapter.

post/api/serving/authorize

Request body

apiKeystring required
adapterIdstring required

Response

Successful Response

object required

Changes