# Proxy The proxy extension exposes a Chat Completions interface over saved provider profiles. It projects the conversation in each request to the selected upstream. See [authentication](auth.md) for accounts and [models](models.md) for catalog lookup. ## Endpoint The [proxy extension](../src/albedo/harness/extensions/proxy/extension.gleam) admits `GET /extensions/proxy/v1/models` and `POST /extensions/proxy/v1/chat/completions`. The default admission requires the daemon token. If `ALBEDO_PROXY_ALLOW_ANONYMOUS` is exactly `1`, these routes use local access instead, as defined by [`allow_anonymous`](../src/albedo/harness/extensions/proxy/albedo_proxy.erl). The models response names entries as `/`. A profile with a custom endpoint lists its saved model. Other profiles use the provider catalog when available and otherwise list the saved model. The response can include a nonstandard `errors` field for unusable profiles. ## Translation [`chat.from_fields`](../src/albedo/harness/extensions/proxy/chat.gleam) splits the requested model at the first slash. With no model suffix, the proxy uses the profile's saved model. The parser accepts the fields listed by `request_fields`, logs unknown fields at debug level, and validates options, tool count, and token limit. It rejects invalid input with a 400 response. The extension resolves the profile and upstream, projects the supplied history, and calls the upstream stream interface. Non-streaming upstream errors return 502. Streaming replies use server-sent events and finish with `[DONE]`. An upstream error is emitted as an error event. The client supplies the conversation on each request. ## State [`chat.carry`](../src/albedo/harness/extensions/proxy/chat.gleam) carries provider-specific turn state for replay. The extension replays carried turns verbatim only to the profile that produced them. [`albedo_proxy`](../src/albedo/harness/extensions/proxy/albedo_proxy.erl) packs state into URL-safe compressed text and bounds decompression to 4 MiB. Invalid or altered packed state takes the portable replay path. ## Related pages - [All topics](README.md) - [Change guidance](contributing.md) - [Model authentication](auth.md) - [Models catalog](models.md)