---
title: "Post Serving Authorize"
method: POST
path: "/api/serving/authorize"
tags: ["serving"]
---

# Post Serving Authorize

`POST /api/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.

## Request body

- ServingAuthorizeBody
  - `apiKey` string, required
  - `adapterId` string, required

## Response `200`

Successful Response

- object

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/freesolo/apis/platform-backend.md) · [All operations](https://skmtc.dev/freesolo/apis/platform-backend/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/freesolo/platform-backend/revisions/5626e92675af/schema)
