Repository navigation
Releases
v0.1.7
Claude Code can show its usage through the gateway, and a per-model reasoning option translates Claude Code's adaptive
thinking and effort for upstreams that take reasoning settings in their own terms. The Claude Code bridge now passes
Claude Code's effort. No migrations. One new configuration key, gateway.usage_headers, off by default. Models without
the new option behave as before.
Gateway
- Usage in Claude Code (D-048). With the new
gateway.usage_headers: autosetting (HP_GATEWAY_USAGE_HEADERS),
Anthropic Messages responses carry the caller's usage in theanthropic-ratelimit-unified-*headers Claude Code
shows in/usage, its status line and its near-limit notice. A request served by a Claude subscription seat
reports the seat's 5-hour and 7-day windows from the quota board (the account that answered, after a failover).
Other requests report the budget closest to its limit that covers them, or nothing when no budget applies. Claude
Code reads these headers only when the token is passed asCLAUDE_CODE_OAUTH_TOKEN; the Claude Code guide shows
how. The default isoff, which leaves responses exactly as before. Upstream rate-limit headers are never passed
on. - OAuth beta flag not forwarded. The
oauth-…flag Claude Code adds toanthropic-betawhen it uses
CLAUDE_CODE_OAUTH_TOKENis now dropped before a request goes to an Anthropic upstream; other flags are forwarded as
before.
Providers
- Claude Code bridge passes Claude Code's effort. A request's top-level
output_config.effort, which Claude Code
sends alongside adaptive thinking, now reaches the CLI as--effort. Before, only the level athinkingbudget
maps to was passed, and the compatibility matrix overstated this. - Adaptive thinking and output effort are understood. The Messages parser now reads
thinking: {type: adaptive}
and the top-leveloutput_config.effortinstead of treating them as unknown fields. Native Anthropic requests are
sent byte for byte as before, and nothing changes for other upstreams until a model is configured to translate
them. - Reasoning option per model (D-047). A provider's model can carry a
reasoningoption:mode(auto,
client,fixed,off), astylenaming the upstream's parameter (openrouter_reasoning,deepseek_thinking,
openai_reasoning_effort,openai_responses_reasoning,anthropic_thinking,gemini_thinking_config,none), a
default or fixed effort or budget, the acceptedefforts, a budget cap, and whether earlier reasoning is sent back in
a Chat history field. Claude Code's adaptive thinking andoutput_config.effortthen reach, for example, an
OpenRouter-style router asreasoning: {effort}instead of being dropped. Every clamp or override is recorded as a
translation loss. Models without the option are unchanged. - Reasoning in the model dialog. The provider's model dialog has a Reasoning section for the option, and models
that set it show a badge in the model list. The Terraform guide shows the option in a providerspec. - Clearer losses. A dropped
context_management,thinkingoroutput_confignow says why, and the request-field
refusal ofreasoning/thinkingpoints at the new option. The Claude Code bridge now records that it does not pass
the client's thinking mode (thinking) or a top-leveloutput_config.format.
Upgrading
- No migrations. One new optional configuration key,
gateway.usage_headers(HP_GATEWAY_USAGE_HEADERS), whose
defaultoffleaves responses as before. To see usage in Claude Code, set it toautoand have Claude Code users
pass their gateway token asCLAUDE_CODE_OAUTH_TOKEN; the Claude Code guide shows how. oauth-…beta flags are no longer forwarded. Theoauth-…flag inanthropic-betais dropped before a request
goes to an Anthropic upstream; other flags pass as before.- Reasoning option.
spec.models[].reasoningis optional; a model without it sends the same upstream request as
before.PUT /providers/{id}replaces the whole spec, so an API client or Terraform configuration that writes
providers must sendreasoningback, or a value set in the UI is cleared. - Loss changes. Dropped
context_management,thinkingandoutput_configlosses have new wording. Claude Code
bridge requests record two new losses:thinking(approximate) and a top-leveloutput_config.format(dropped).
Alerts or reports that count or match losses will see them. - Bridge effort. The Claude Code bridge now passes a request's top-level
output_config.effortto the CLI as
--effort, so bridge turns may run at a different effort than before.
v0.1.6
Per-model upstream request fields: pin the upstream provider behind an OpenAI-compatible router for clients that
cannot choose one, and set allowlisted sampling and tagging options on the model instead of in every client. No
migrations and no new configuration keys. Models that configure nothing behave exactly as before.
Providers
- Upstream request fields per model (D-046). A model in a provider's catalog can carry extra upstream request
body fields, so a client no longer has to send them. Two shapes: pin the upstream provider, a typed block sent
as the request'sprovider(order, only, ignore, sort, fallbacks, data collection, zero data retention,
quantizations, max price) onopenai_compatibleproviders only, so a client with no such option (Claude Code, for
one) still reaches the provider you chose; and request fields, a JSON object of other options. Both appear under
Upstream request fields in a model's dialog, and a model that uses them shows an Upstream fields badge. - An allowlist per provider type. Request fields accept only sampling, routing and tagging options from the
provider type's allowlist (the table is in the operator guide and the config contract), in any spelling (top_p=
topP). Output limits, extra candidates, model lists, tools, plugins, stored state,cache_control, streaming and
structural fields are never configurable, and an unknown name is refused at save time with the allowed names.
GeminigenerationConfigtakes only its sampling keys and is merged into the request's own; another spelling of
it in the same request (generation_config) is dropped, so it cannot raise the budgeted output cap. - Conflict rule. When the client already sends one of these chooses between Send mine and replace theirs
(request_field_policy: "configured", the default), Keep theirs, only fill missing ones ("client") and
Refuse requests that set them ("reject"). Only the client's own request counts, never a value the gateway
filled in. A refusal is decided before any candidate is tried, over all candidates (the strictest wins), and answered
with 400. An override or a kept client value is recorded as an approximate translation lossrequest_field:<name>
and shows on the request page. - Where it applies. Translated, native and passthrough requests for Anthropic, OpenAI, OpenAI-compatible, Gemini
and Ollama providers, including the classifier and probe calls. CLI bridge providers refuse the fields. A model that
configures nothing leaves the request body byte-for-byte unchanged. The three new spec fields are in
api/openapi.yaml; no migration is needed. Updating a provider replaces its spec, so an API client or Terraform
configuration must include the fields to keep them.
Upgrading
- No migrations, no new configuration keys. The new provider spec fields are optional; a model without them
sends exactly the request it sent before. - API and Terraform clients.
PUT /providers/{id}replaces the whole spec, so a client that writes providers must
sendprovider_routing,request_fieldsandrequest_field_policyback, or values set in the UI are cleared.
v0.1.5
Claude Code bridge: a fix for the 400 that broke every turn after the first, session retention so a paused
conversation reads the prompt cache instead of writing it again, and fewer translation losses. Failed requests are
attributed to the account they reached, and attempts are numbered in the order they ran. No migrations. New options:
bridges.claude_code.shelf_max_per_account and shelf_max_bytes. See the upgrade notes below: the privacy rule for
bridge sessions changes, and three behaviours change.
Claude Code bridge
- Sessions kept up to the cache TTL (D-045). When a bridge process ends between turns (idle timeout, eviction,
tool timeout or a crash), its CLI session is kept on disk for up to the conversation's prompt-cache TTL (5 minutes
or 1 hour) and the next turn resumes it with--resume, so the prompt prefix is the CLI's own and the cache is
read rather than written again. A conversation waiting for tool results resumes with the results added to the
session. Bounded bybridges.claude_code.shelf_max_per_account(default 16) andshelf_max_bytes(default 256 MiB),
oldest first; deleted at expiry, on account removal and at shutdown. An entry expires the TTL after the
conversation's last turn, and a conversation whose cache has already expired is not kept. Tool results are written
into a kept session only for CLI versions whose session format was verified (2.1.318, 2.1.319, 2.1.321, 2.1.322). This
changes the privacy rule that conversation files are removed when the process ends: content may now stay up to
1 hour after the conversation's last turn. - CLI leftovers removed. The CLI's per-process files (
config/sessions/<pid>.jsonand.key, holding a peer
token, the session id and the working directory) were left behind when a process was killed. They are removed with
the process and swept when no live process owns them. - Which session served a turn is recorded in the ledger provenance (
bridge_session:live_process,
shelved_session,transcript,new_session) and shown on the request page next to the cache figures. - Output settings are passed.
max_tokensgoes to the CLI (CLAUDE_CODE_MAX_OUTPUT_TOKENS, up to the model's
limit) instead of being amax_output_tokensloss. An effort-onlyoutput_configon a mid-conversation system entry
sets the CLI's--effortand no longer recordssystem_message_field:…:output_config. System entries without text
no longer recordmid_conversation_system. Effort and the output limit are now part of the process match (a parked
process started at another effort used to be reused). scripts/live/claude-code-bridge-cache.shchecks cache reads and writes per turn on a deployment.
Fixed
- Claude Code bridge: 400 on every turn after the first. A client that marks message blocks with
cache_control: {"ttl": "1h"}(as Claude Code on a subscription does) had those markers copied into the bridge's
transcript and stdin turn. The CLI puts its own breakpoints on the system prompt and tools it adds ahead of the
conversation, so the client's markers could follow a 5m one or push the total past four, and the upstream refused
the request ("a ttl='1h' cache_control block must not come after a ttl='5m' cache_control block"). The bridge now
removes every clientcache_control(message blocks and blocks inside tool results) and records acache_control
loss (approximate): the CLI's own breakpoints replace the client's. The client's TTL is kept: the CLI runs with
CLAUDE_CODE_PROMPT_CACHE_TTLset to1hif any client breakpoint asks for1h, to5mif they all ask for
5m, and to1hwhen the client set none. The TTL is part of the parked-process match, so a process is reused
only for a conversation with the same TTL. The CLI also runs withCLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS=1, keeping
repository status out of its prompt. - Claude Code bridge: an upstream 400 is no longer failed over. The CLI reports the upstream's 400 without an
error type, so the bridge passed it on as a generic upstream error, and the gateway retried it on the next
subscription account, which refused it the same way. It is nowinvalid_request: one attempt, and the client gets
a 400. Rate limits, overload and server errors are still retried, and so are the documented account-level 400s
(credit balance, billing, a disabled organization). - Prompt-cache rules on Anthropic requests. The request builder now enforces the Messages API's breakpoint rules on
the body it sends, since merging, inlining or dropping blocks can break a request the client sent correctly. At most
four breakpoints (a top-level automatic one counts): the earliest are removed and the last four kept
(cache_control_limit, drop). TTLs must not increase across tools, system and messages, tool-result content
included, and a top-level automatic breakpoint last: a1hbreakpoint after a5mone is lowered to5m
(cache_control_ttl, approximate). A request that
already follows the rules is sent unchanged.cache_controlon blocks inside a tool result is now kept; it used to
be dropped silently. - Failed requests are attributed. A request that failed after reaching an account used to be recorded and logged
with emptyfinal_model,account_id,provider_idandmode. It now carries the last attempt's account,
provider, model and mode, for HTTP upstreams and CLI bridges alike, and the translation losses of the request as
built for that attempt (they used to be recorded for successful requests only). The request page says Failed on
that account and labels the route step Last tried instead of Served by. - Skipped candidates are not shown as fallbacks. A candidate passed over at dispatch (concurrency limit reached,
local rate limit, open compatibility breaker, budget) used to take an attempt number and make the next attempt look
like a fallback ("#2 … Fell back to another account" with no #1). Attempts are now numbered in the order they ran,
a failover reason is recorded only after a real failed attempt, and skipped candidates are listed with the request's
excluded candidates (stagedispatch, with the reason). - The request page's cost line shows cache writes next to cache reads (both were already recorded, for the CLI
bridges too).
Upgrading
- Privacy rule change (D-045). Claude Code bridge sessions are no longer removed as soon as their CLI process
ends: they may stay on disk until the conversation's prompt-cache TTL (5 minutes or 1 hour) has passed since its
last use. They are deleted at expiry, on account removal and at shutdown, and retention cannot be turned off.
Review any retention commitments that relied on the old rule. - New configuration keys, both optional:
bridges.claude_code.shelf_max_per_account(default16) and
bridges.claude_code.shelf_max_bytes(default268435456, 256 MiB). - Behaviour changes. The Claude Code bridge strips client
cache_controlmarkers and records acache_control
loss (approximate) on every such request. A 400 reported by the CLI is no longer failed over to the next account:
the client gets the 400 after one attempt. Attempts are renumbered in the order they ran, and candidates skipped at
dispatch no longer take a number; dashboards or scripts that read attempt numbers or failover reasons may see
different values.
v0.1.4
One-time budgets, a spend cache that makes budget checks fast for every period, a system information endpoint and
budget status filters. One migration (20261108100000000_add_budget_state_limits) adds two nullable columns to
budget_state; no configuration changes. See the upgrade note below: some budget alerts are sent once more.
Budgets
- One-time budgets (D-044).
period: "once"is a total limit that never resets, with optionalstarts_at
(empty: from the budget's creation) andends_at(empty: never). Beforestarts_ata budget isscheduled, after
ends_atit isexpiredand no longer blocks or warns.timezonemust be empty for them. In the UI: Repeats:
One time, Count spend from and Ends, "$x left", Never / Ends in…, and Scheduled / Ended
badges. - Start over.
POST /api/v1/budgets/{id}/reset(config.write,If-Match) sets a one-time budget's
starts_atto now, truncated to the second; Start over… in the budget's row menu does the same (not on an
ended budget). - Re-armed alerts. Raising a budget's limit lets
budget.threshold.warningand.exceededfire again in the
same period, for recurring budgets too. - Status.
GET /api/v1/budgets/statusitems gainremaining_e10;period_endisnullfor a one-time budget
without an end, andstatecan bescheduledorexpired. Clients that readperiod_endas always set need to
handlenull. New filters:project_id(optionally withbinding_id) for the budgets that cover a project, and
scope+scope_idfor budgets defined on exactly one object. - Spend cache. Budgets of every period keep their settled spend in memory and read only new ledger rows per
request, so a budget check no longer grows with its window (for a one-time budget, about 0.4 ms instead of 165 to
300 ms per budget over 200,000 rows in a year). A background primer sums each window once after start-up and each
configuration change, and refreshes every budget every 30 s; see the limitations.
System
GET /api/v1/systemreturnsversion,commit,started_atandschema_versionto any principal with
config.read, including service-principal tokens. Builds record the commit (-X main.commit=…): release
binaries, the release and CI images, andmake docker.
Upgrading
- Budgets that already sent
budget.threshold.warningor.exceededin the current period send it once more after
the upgrade: the new limit columns start empty, which counts as a raised limit.
v0.1.3
An optional budget check when minting run tokens, per-model handling of system messages inside /v1/messages,
reference filters on the spend chart, and release images built natively for both architectures. No upgrade
actions beyond those for 0.1.2: there are no migrations or configuration changes.
Gateway
- Run tokens can be refused before a run starts:
POST /v1/harbor/credentialstakes an optionalcheck_budget.
When it istrueand an enabled blocking budget on the client, the run's project, that project's workspace, or a
global budget is used up, the mint is refused with429and codebudget_exceeded, naming the budget. The default
(false) keeps today's behaviour. Provider account budgets aren't checked at mint (decision D-043). The check
is skipped when the client's routing plan can only reach local or free accounts, which budgets ignore. If budgets
can't be read, the mint fails with a502(could not check budgets). system-role entries inside/v1/messagesmessages[]are sent as user text, with amid_conversation_system
loss, when the target Anthropic model is known not to support mid-conversation system messages (Claude Sonnet 5,
and older models up to Claude Opus 4.7, per Anthropic's public docs, including theclaude-opus-4-0and
claude-sonnet-4-0aliases and Vertex-v2versions). They used to get the provider's 400. Every other model,
including unknown ones, still gets them unchanged (decision D-042).
Activity and spend
GET /api/v1/usage/seriestakes the sameref=<key>:<value>filters andbinding_idas the usage summary, and
its buckets add up to the summary's totals under the same filters. Spend keeps its chart over time while a
reference filter is on.
Release images
- Both images are built for linux/amd64 and linux/arm64 with the web and Go stages on the build machine's own
architecture; the Go binary is cross-compiled, so arm64 builds no longer runpnpm installunder emulation. The
runtime images are unchanged. Release image builds share a build cache with CI and time out after 30 minutes, and
CI now builds both images for both architectures on every pull request.
Fixed
- A run-token mint that fails for an internal reason (other than validation, permission or budget) answers a
502
with the generic messagecould not mint the credentialand logs the cause on the server. It used to answer
403with the raw error text. - End-to-end tests: the accessibility checks wait for the app shell before pressing keys or running axe, and the axe
scans retry until the page settles, which removes a flaky failure of the skip-link test.
v0.1.2
Trusted-reference filters for usage and activity, system messages inside /v1/messages, and fixes found
while running agent orchestrators against 0.1.1. Read the upgrade notes first: one behaviour change can affect
alert rules, and the first start runs a one-off index migration.
Gateway
/v1/messagesacceptssystem-role entries insidemessages[], as Claude Code sends them on models that support
mid-conversation system messages. They used to be rejected with a 400. They now reach Anthropic upstreams
unchanged. For OpenAI upstreams they become in-place system messages, and for Gemini they become user text. Each
loss is recorded.
Activity and spend
- Filter usage and activity by trusted reference:
ref=<key>:<value>on/api/v1/usage/summary,
/api/v1/activity/requestsand/api/v1/activity/sessions, andgroup_by=ref:<key>on the usage summary, so an
orchestrator gets per-run totals (for examplegroup_by=ref:spaceman.run) and finds a bound session's id. Reference
groups are paged withcursorandlimit. The usage summary also takesbinding_id. Existing history is indexed
when the database is upgraded. - The UI filters and groups by trusted reference too. Requests → More filters → Filter by reference lists one
run's requests (for example Run: run_42, up to four references at once), and a request's verified context links
to all requests with the same reference. Spend has Filter by reference and Group by → Run (or any other
reference key), with Load more for long lists. Filters and groupings are kept in the page address. The demo's
orchestrator client now makes its requests with two run tokens.
Fixed
- Run tokens record the parent token that created them (
created_byand the audit log) instead ofanonymous. - A request refused by a blocking budget shows as Blocked and emits
access.request.blocked, as the operator
docs describe.budget.threshold.exceededis still sent once per period. This is a behaviour change: see the
upgrade notes. - The demo's
spaceman-runsclient pins onlyspaceman.fleetand allows the demo projects, so run tokens can bind
their ownspaceman.spaceandproject_id. - Docs: the agent orchestrators page now describes how client and run-token references combine, and the
access.credential.issueddata fields match what is sent (prefix,scopes,child).
Upgrade notes
- Behaviour change: budget refusals emit
access.request.blocked. A request that blocking budgets refuse is now
recorded as Blocked (errorbudget_exceeded, HTTP 429) and sendsaccess.request.blockedfor every refused
request, with the budget inreason. In 0.1.1 it was recorded as an error and sent no event. Alert rules, webhooks
and Pulse consumers that subscribe toaccess.request.blockedwill see one event per refused request while a budget
is used up.budget.threshold.exceededis unchanged and is still sent once per period (decision D-040). - The first start after the upgrade indexes existing history in one migration, before the server listens. Its time
and disk use grow with the number of requests and ledger rows times their trusted references: as a guide, 1M
requests plus 1M ledger rows with 3 references each took about 27 s and added about 530 MB. Leave room for that
next to the database and its pre-upgrade copy. Rows whose stored references aren't a JSON object are skipped.
v0.1.1
The first release. A v0.1.0 tag exists, but its release build stopped on a flaky test and nothing was
published from it.
Gateway
- One base URL and gateway token per client for OpenAI Chat Completions and Responses, Anthropic Messages and Gemini,
with translation between them where a model needs it, streaming with keepalives, token counting, and native
passthrough when a provider's protocol changes. - Subscriptions through the vendors' own CLIs: a Claude Code bridge and a Codex bridge, with isolated per-account
configuration, their built-in tools turned off and the client's tools bridged. - Local and OpenAI-compatible endpoints (Ollama, vLLM, LM Studio and others).
Routing
- Routing plans: model names, ordered fallback groups, hard restrictions, rules and decision tables, with drafts that
are validated, compared with the live version and checked for whether they would block traffic. - Failover between accounts before the first byte reaches the tool.
- "Why this route?": every request records the matched rule, each candidate and why it was skipped, every attempt,
usage and cost.
Limits and spend
- Quota tracking for subscriptions and provider accounts, budgets enforced in the transaction that reserves a request,
and spend kept in separate categories (estimates, provider bills and subscription fees).
Privacy
- Masking of credentials, configured values and optional personal data before a provider sees them, restored in
replies. - Optional encrypted captured content, kept for 24 hours to 30 days, crypto-erased on expiry and readable only with an
audited grant.
Operations
- Alerts to Telegram, Slack, Discord and webhooks; a durable event outbox to Pulse (NATS JetStream) and signed
webhooks. - Local accounts with step-up re-authentication, OIDC single sign-on, automation accounts with API tokens, and a
readable audit log. - Online backups and verified restore, a Quota Harbor importer, Prometheus metrics, and
harbor-pilot doctor. - One Go binary with the web UI embedded and SQLite storage; release archives for Linux and macOS on amd64 and arm64,
and container images (harbor-pilot, andharbor-pilot-bridgewith the Claude Code and Codex CLIs) for
linux/amd64 and linux/arm64. - Tested reverse proxy configurations for nginx, Apache httpd, Caddy, Traefik and HAProxy.
- A Terraform provider released alongside, as 0.1.0.
How it was tested
Every capability is covered by automated tests against fixtures, synthetic upstreams and fake binaries. The reverse
proxy configurations are verified against the real proxies. Nothing has been verified against live provider accounts
yet: the compatibility matrix and
known limitations say exactly what is and
isn't covered.