Skip to main content

Routing reference

The contract behind Routing. Start there to set the org default or give one person or agent a route.

Where routing is set​

WhereHow
Org defaultRouting page, or GET / PUT /admin/routing-config
One agent or personRouting page → People routes, Agent routes (below)
Per requestx-anyray-config header

With no org default​

A request with no x-anyray-provider or x-anyray-config routes like this:

Providers with a keyWhere it goes
OneThat provider
SeveralThe one the model id names (claude-* to Anthropic, gpt-* and o* to OpenAI, gemini-* to Google, grok-* to xAI). With no such model, the one whose API the endpoint is: /v1/messages to Anthropic, /v1/responses to OpenAI

Two providers that serve the same models (Anthropic and Bedrock, OpenAI and Azure OpenAI, Google and Vertex AI) make a model ambiguous, and a request that names neither gets 400. Setup then lists Routing as a step to finish: set an org default on the Routing page.

Model ids, aliases and retries​

SettingValue
anyray-default (sent by anyray-connect)Resolves to ANYRAY_DEFAULT_MODEL, default anthropic/claude-sonnet-5-5. With an org default config saved, when every target the request can reach (in that config, or in the person's or agent's own routing) serves that model, routing picks the provider and key as it would for the model id itself; Bedrock counts for a Claude model. Otherwise, and on a deployment with no default config, it goes to the model's provider. An alias you set for anyray-default always uses its own provider.
AliasesANYRAY_MODEL_ALIASES or PUT /admin/model-aliases
Retries502 / 503 / 504 and network errors: 2 attempts. 429: non-streaming only. retry block: { "attempts": 0 } opts out, max 5

Config modes​

ModeBehavior
singleOne target for every request.
loadbalanceSpread across targets by weight, sticky per conversation.
fallbackTry targets in order; advance on failure.
conditionalPick a target from request conditions (below).

Upstream timeouts​

Set in .env, then restart.

Env varDefaultBounds
ANYRAY_UPSTREAM_CONNECT_TIMEOUT_MS10000Connecting to the provider.
ANYRAY_UPSTREAM_HEADERS_TIMEOUT_MS60000First response byte of a streaming request.
ANYRAY_UPSTREAM_BODY_TIMEOUT_MS600000Gap between streamed chunks, and the wait for a non-streaming response's headers.

Conditional routing​

First matching conditions entry wins, else default; neither gives a 400.

{ "strategy": { "mode": "conditional",
"conditions": [ { "query": { "metadata.team": "research" }, "then": "frontier" } ],
"default": "economy" },
"targets": [ { "name": "frontier", "provider": "anthropic" },
{ "name": "economy", "provider": "openai" } ] }
Query partValues
Fieldsmetadata.<key>, params.<field>, url.pathname
Operators$eq, $ne, $gt / $gte / $lt / $lte, $in, $nin, $regex; combine with $and / $or

Regex limits​

$regex is admin config only: a client x-anyray-config carrying one gets a 400. Saving refuses a pattern over 128 characters, a backreference or lookbehind, a repeated group that itself repeats or alternates, and a pattern that could take too long to match. A pattern that starts with ^ can hold more repeats (^\d+-\d+$ saves, .*.*x does not). A $regex never matches a value over 256 characters, and a stored pattern that breaks these rules never matches.

Guardrail rules share these limits (regex rules).

Identity fields​

Identity fields read the verified key, not the x-anyray-metadata header:

FieldReads
metadata.user, metadata.userIdThe key's bound user
metadata.team, metadata.teamIdThe key's bound team
metadata.agent, metadata.agentIdThe service key's name, and its id
Identity lanes need per-person keys

On a shared org key or BYO pass-through credential, metadata.user comes from the header, so anyone can claim a user lane.

Other metadata.<key> fields are client-controlled. Team = SCIM-mapped team, else the enrollment team; a key with no team ignores a header team (SSO enrollment groupTeamMap / defaultTeam).

Targeted lanes​

Targeted lanes sit above Everyone, and the first match wins. The providers on Everyone become the default target. Press Edit on Everyone to change its providers: the + dropdown and the gear for Split by weight and Retry attempts.

1
Build the lane

Click + Add and pick the Team or Model tile. Then fill the sections: Which (type or pick the team or the exact model id) and Provider (one entry per connected provider, then a Key pick when it has more than one stored key). Click Apply, then Save N changes.

2
Order the lanes

Hover a lane for Move up / Move down and Remove. The pencil opens Which and Goes to.

A hand-written org config shows a Hand written config pill and locks the Everyone row; the other rows stay editable. With routing off, the Everyone row reads "Off — requests go direct to the provider the client picked."

A new lane matches one of these:

MatchCondition it writesMatched against
teammetadata.teamThe verified key-bound team
modelparams.modelThe model named in the request

A lane saved on agent name (metadata.agent), agent id (metadata.agentId) or user (metadata.user) still applies and saves unchanged. To route one person or agent, give them their own route instead (Routes for people and agents); it wins over every lane.

  • Values match whatever their letter case. A $regex on the model also tests the id in lowercase, so ^grok- catches Grok-4.7. To leave a model out of a $regex lane, add a $nin test (it ignores letter case); a lookahead can still pass on the id as sent. Any other $regex matches as written.
  • Name lanes stop matching on rename (traffic falls to the default); match on id instead. Revoked agents are flagged, not blocked.
  • Hand-written conditions, a third test, or a $regex other than a model family lane show read-only; use PUT /admin/routing-config.
  • A $regex lane lists every current priced model it matches in GET /v1/me/models.
Narrowing a lane with a second test

And also adds a second test on a different dimension (one query object = AND). Here Grok goes to each agent's own xAI key, everything else to a shared Bedrock account:

{ "strategy": { "mode": "conditional",
"conditions": [
{ "query": { "metadata.agentId": "svc_a", "params.model": "grok-4.6" },
"then": "agentId:svc_a+model:grok-4.6" },
{ "query": { "metadata.agentId": "svc_b", "params.model": "grok-4.6" },
"then": "agentId:svc_b+model:grok-4.6" }
],
"default": "default" },
"targets": [
{ "name": "agentId:svc_a+model:grok-4.6", "provider": "x-ai", "provider_key_id": "xai-agent-a" },
{ "name": "agentId:svc_b+model:grok-4.6", "provider": "x-ai", "provider_key_id": "xai-agent-b" },
{ "name": "default", "provider": "bedrock", "provider_key_id": "shared" } ] }

In the console, give each agent its own route with a model rule instead (Routes for people and agents). A family lane, which also catches models released later, uses $regex:

{ "query": { "metadata.agentId": "svc_a", "params.model": { "$regex": "^grok-" } },
"then": "agentId:svc_a+model~^grok-" }

A lane for one model of the same agent goes above its family lane, so grok-4.7 can bill another key while the other Grok models use the family lane's key.

Routes for people and agents​

Give one person or one agent its own route. The Routing page is a board. Rows run top to bottom in the order they win: People routes, Agent routes, Targeted lanes, then Everyone (the org default). Each row reads: who, the model rule, where it goes.

On a multi-tenant deployment, the Routing page says routes for people and agents are unavailable and refuses to save them. You can still remove a saved route. Until the page has checked, routes for people and agents can't be added or changed. An edit made before routes became unavailable stays on the board, and Save lists it instead of sending it.

+ Add asks what to route, then opens the route builder, a dialog of stacked sections.

1
Pick what to route

Pick a tile: Person, Agent, Team, Model, or Rule for several. The builder opens on that kind. Change in its first section switches kinds.

2
Pick who

A person or an agent is one dropdown in the Who section. A rule for several has a + that opens a checklist with a search box: tick people and agents, and each becomes a chip. Each pick adds the next section to the stack.

3
Fill each section

A section whose choice is a list is a dropdown:

  • Default: Their subscription, Org routing, or one of the connected providers. Agents have no subscription.
  • Which (a lane's value): type or pick a team or an exact model id.
  • Provider (a lane's provider): one entry per connected provider. A Key pick follows when that provider has more than one stored key.
  • Models and Goes to of a rule for several.

Providers appears once a provider is the default. It is a row of chips, the picked provider first. Press + to add another provider; each pick adds a chip, in order. A provider with another stored key is offered again as another key, so two accounts at one provider can share a fallback. A chip whose provider has more than one stored key carries a key dropdown. Hover a chip for Move up / Move down / Remove. One chip is a single provider; two or more are a fallback, tried in that order. The gear button opens Weights and retries: Split by weight makes it a load balance with a weight per key, and Retry attempts takes 0 to 5.

Model rules are inline rows. + adds a row with two dropdowns, Model and Goes to. An exact model beats its family, and other models take the default. A rule that goes to a provider gets its own + for more providers right in the row.

Keys appears when a provider has more than one stored key, and lists only those providers. Pick a named key for each (needs Manage provider keys). With one key per provider there is no Keys section and the default key pays. A route that already names a key keeps the section, so a key that was deleted can be set back to Org default key.

4
Apply and save

Apply puts the row on the board as an unsaved change. Save N changes writes the org config first, then each changed route.

The sections depend on what you route:

You routeChain
Person or AgentWho, Default, Providers (when the default is a provider), Model rules (optional)
Team or ModelWhich, Provider
Rule for severalWho, Models, Goes to, Providers (when it goes to a provider)

To change a saved row, hover it and press the pencil at its right end. The same dialog opens, prefilled, titled Edit route (person or agent), Edit lane (team or model) or Org default (Everyone). Who is fixed. Apply replaces the row on the board; Save N changes writes it. A stored lane on a dimension + Add no longer offers (user, agent name, agent id) opens as Edit lane too, with its value fixed: only its provider and key change.

The other icons on a hovered row:

RowIcons
LaneMove up, Move down, Remove
Person or agent routeRemove
Unreadable routeReplace (needs providerkeys:manage), or Remove where routes are not available

A removed row stays on the board, crossed out, with Undo until you save. Bands with nothing in them are not shown.

A person on their subscription has Only for some models…: it keeps the subscription for the models you pick and sends the rest to org routing. To add one rule to several people or agents, pick Rule for several in + Add.

A person's Routing tab under Users and an agent's Routing part on Agents open the same route in an editor that saves on its own. If someone else saved a route since the page loaded, Save stops at that route, shows what they saved on its node, and names what saved and what was not sent. Make your change again, then save. A blocked save opens Can't save routing; click an item to select the node it names.

Route status​

Success

The status pill on the person's or agent's node reads Waiting for a request, then Applied once a request after the save goes where the route says. Status reads the last 20 requests of the past 30 days (GET /admin/v1/routing/served). After a save it reads them again every 10 seconds while it says Waiting or Moving, for up to 15 minutes after the save or after their machine switches lanes.

StatusWhat it means
Checking…Reading where the last requests went.
Waiting for a requestSaved. No request since the save yet.
AppliedThe last request went where this route says.
Moving off subscriptionTheir machine switches at its next sync, within 30 minutes. Claude Code already follows the route.
Moving to subscriptionTheir machine returns to the subscription at its next sync, within 30 minutes.
Partly appliedThe last request went somewhere this route does not send it, or Codex or Copilot stayed on the subscription (why).
Session routeThe last request followed the person's /route choice for that Claude Code session. Their other sessions use this route.
Launch routeThe last request followed the x-anyray-route header its Claude Code session started with. Their other sessions use this route.
Requests failA key in the route is gone, a provider has no stored key, or the last request failed (its status code is shown). Requests never move to another account.
Needs gateway upgradeThe gateway is too old for routes for people, or to report where requests went. Or a newer gateway saved this person's route: Replace writes a new one, and needs providerkeys:manage.
Status unavailableRecent requests could not be read, or do not say where they went. The route still applies.
Not visible to youYou can see only your own requests and your agents'. The route still applies.

Below the status, Session routes lists the sessions the person moved with /route: the choice, when it was set, and when it expires (GET /admin/v1/routing/sessions).

How a route applies​

The order is on Routing. A session route (Claude Code's /route) replaces the person's whole route for that session. Agents never take one. Own routes apply even when org routing is off. A delegating agent uses its own route, never the end user's. A provider picked by x-anyray-provider (or a model alias) still takes its key from the route when the route names one account for that provider, else from Keys, else the default key.

A person route has a default, optional model rules, and optional providerKeys. Agents use their binding as the default and routingRules for model rules. Destinations are org, a single / loadbalance / fallback config, or subscription (people only). An exact model rule wins over a family rule; among families, the longest prefix wins. Otherwise the default applies. Model rules apply to JSON-bodied chat, messages, responses, and embeddings requests. Multipart uploads follow the route's default. Model matching normalizes provider prefixes and dated ids.

A key-signed request that matches subscription uses the person's non-subscription default, else the org route, with their provider-key map. /v1/me/models lists each destination's models only where the model rules send them there.

Claude Code on a subscription​

A person running Claude Code on their own subscription keeps signing in to it, and the gateway decides per request. When their route sends the request's model to org or a provider config (by a model rule or by the default), the request moves there. A model the route sends to subscription stays on it, forwarded unchanged.

Keep Opus on the subscription, send the rest to Bedrock
curl -X PUT https://<your-anyray-gateway>/admin/v1/routing/users/dev@example.com \
-H "Authorization: Bearer $ADMIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"route": {
"default": {"mode": "single", "targets": [{"provider": "bedrock", "providerKeyId": "team-bedrock"}]},
"rules": [{"match": {"family": "claude-opus"}, "dest": {"mode": "subscription"}}]}}'

A moved request goes out on the route's key instead of the subscription sign-in. It bills as org API-key usage, and the person's caps and budget apply to it as to any key-signed request. The seat's limits and throttling don't. Claude Code's token counts for that model go to the same place.

A Claude Code session started without the subscription sign-in has no seat credential to forward, so it never reaches a subscription. Its requests are signed by the person's Anyray key alone and route like any key-signed request, even when the route or /route says subscription. They bill as org API-key usage. Without a verified Anyray key, on a passthrough-only key, or with a custom upstream host, the request still gets a 400.

Codex and Copilot requests don't move one at a time; the whole route sets the machine's lane. A route with any subscription destination keeps them on the subscription, and a route with none switches the machine to org routing. A passthrough-only key never moves, and other pass-through traffic keeps its provider and credential.

Fix a session's route at launch​

A launcher that starts Claude Code can fix the session's route with one header. Every request then takes it, and /route can't change it. Add it as one more line of the ANTHROPIC_CUSTOM_HEADERS value the session starts with:

A launcher's --settings file
{
"env": {
"ANTHROPIC_CUSTOM_HEADERS": "<the headers Connect wrote, one per line>\nx-anyray-route: org"
}
}

Claude Code takes that value whole from the last place that sets it: a --settings file, then your Claude Code settings, then the shell. Keep the headers Connect wrote in the same value. On a machine Connect set up, a header set only in the shell is replaced and never sent. Those headers carry the person's Anyray key, so the file must be readable by that person only, and deleted after launch.

ValueWhere the session's requests go
orgThe org's routing, as /route org sends them. A session started without the subscription sign-in runs on the Anyray key alone.
subThe person's own subscription. The session must be signed in to it. If the subscription runs out, the org's subscription fallback decides, as for claude sub.

The header outranks a /route choice and the person's route. It writes nothing, so it lasts as long as the launcher sends it. /route names the launch route and says it was fixed at launch, and a change returns 409 session_route_pinned_at_launch. Requests it routed carry routeSource: launch, and Route status reads Launch route.

These requests get a 400 and reach no provider:

RequestWhy
A value other than org or subOnly those two exist.
An agent key, or no Anyray keyOnly a person's key takes a session route.
A multi-tenant gatewaySession routes don't exist there.
org on a passthrough-only keyThat key never leaves its subscription.
sub without the subscription sign-inThere is no seat to forward to.

Keys and permissions​

A key picked on a target wins over Keys. If a key is deleted, requests that need it fail with 424 instead of billing another account. Changing a route needs routing:write; an agent's route also needs clientkeys:manage. Changing Keys also needs providerkeys:manage (providers:write for API keys), because a route's key goes to every host the org config sends that provider's default key to. Without it the save returns 403 (user_provider_keys_requires_providerkeys_manage for a person, agent_provider_keys_requires_providerkeys_manage for an agent) and nothing changes.

Moving Split lanes into a route​

An agent that still has Split lanes in the org config shows them with Move them into this route, also when it has no route of its own yet. Save then writes the lanes as model rules on the route and removes them from org routing. Move waits until org routing has no unsaved changes. A lane that also sets a custom host, guardrails or override params cannot move, since a route cannot hold them; change it under Targeted lanes. If a lane changed in org routing after you clicked Move, nothing is saved.

Agent lanes in the org config​

An org-config lane can also match an agent. Only service keys match agent lanes:

{ "strategy": { "mode": "conditional",
"conditions": [ { "query": { "metadata.agent": "release-bot" }, "then": "ci-lane" } ],
"default": "org" },
"targets": [ { "name": "ci-lane", "provider": "bedrock", "provider_key_id": "ci-account" },
{ "name": "org", "provider": "openai" } ] }
Route API
GET /admin/v1/routing/users → { "routes": [ { "user", "route", "revision" } ] }
PUT /admin/v1/routing/users/:user { "route": {...}, "expectedRevision": "..." }
DELETE /admin/v1/routing/users/:user
PATCH /admin/v1/keys/:id { "routingRules": [...] } (an agent's rules; null clears)
{ "default": { "mode": "subscription" },
"rules": [
{ "match": { "family": "claude-sonnet" },
"dest": { "mode": "single", "targets": [ { "provider": "bedrock", "providerKeyId": "ci-prod" } ] } },
{ "match": { "model": "claude-opus-4-1" }, "dest": { "mode": "org" } } ],
"providerKeys": { "bedrock": "ci-prod" } }

An agent's default stays in routingProvider / routingConfig and its keys in routingProviderKeys (reference). A stale expectedRevision gets 409.

Pinning a target to a named provider key​

Any target may carry provider_key_id naming one of the provider's named keys (the id only, never a credential):

{ "strategy": { "mode": "conditional",
"conditions": [ { "query": { "metadata.team": "ml" }, "then": "ml-lane" } ],
"default": "org" },
"targets": [ { "name": "ml-lane", "provider": "openai", "provider_key_id": "team-ml" },
{ "name": "org", "provider": "openai" } ] }

Admin config only (ignored in a client x-anyray-config). Unknown ids are rejected on save; a later-deleted key fails pinned requests with 424, with no fallback.

Forwarded headers​

A target's forward_headers list, or the x-anyray-forward-headers request header (comma separated), names request headers to copy upstream. The value comes from the request.

A forwarded header never replaces the provider credential (Authorization, x-api-key, api-key) or a provider key's Custom headers. When the request runs on a key the gateway holds, it also never replaces any other header the gateway sets for that key: OpenAI-Organization and OpenAI-Project from the target's openai_organization and openai_project, Oracle's CompartmentId, or the signed headers of a SigV4 or OCI request. The gateway drops that copy and logs only the header's name, at debug level.

Beside a key the gateway holds, these account headers never forward, even if the gateway set none: OpenAI-Organization, OpenAI-Project, x-goog-user-project, x-goog-project-id, CompartmentId, and the x-anyray-* account headers.

On litellm, truefoundry and anyray-upstream, two configured values are not sent: a custom header the gateway drops (such as Connection), and a custom_body field the caller replaces with its own body or override_params. Such a value stops counting as a held credential only when it appears nowhere else in the request (body, headers or URL). A common value such as Connection: keep-alive usually matches the client's own headers, so it still counts.

Still forwardedWhy
content-type, openai-beta, anthropic-beta, anthropic-version, x-grok-conv-idThe gateway builds them from the caller's request
Other headers the gateway did not setThere is nothing to replace

passthrough traffic, and a request served on the caller's own credentials, forward as before: the caller's copy wins over everything except the credential and Custom headers.

On a key the gateway holds, a caller's account fields in x-anyray-config (openai_organization, openai_project, resource_name, vertex_project_id, oracle_compartment_id, and the Bedrock role's aws_role_arn and aws_external_id) and the matching x-anyray-* headers are ignored. Account headers inside the caller's custom_headers are dropped too. The admin's routing target or provider key decides, else the key's default. On Vertex, a request on any route naming another project in its path or a $userProject / userProject parameter gets a 400 on a key the gateway holds.

A caller's auth_passthrough in x-anyray-config is ignored. Only x-anyray-auth-mode: passthrough selects pass-through.

Credentials on pass-through traffic​

A passthrough request is signed with the caller's own credential. From the provider's stored key it keeps the base URL and endpoint paths for every provider, plus these addressing fields:

ProviderTaken from the stored keyNever taken
bedrockRegion, the Claude over InvokeModel switchesAccess key pair, session token, role, external id, auth type
azure-openaiResource name, deployment id, API versionAPI key, AD token, auth mode, Entra, managed and workload identity fields
vertex-aiProject id, regionService account JSON
oracleRegion, compartmentAPI key, the IAM signing fields

Any other field on a stored key is never taken either.

On Bedrock the caller names its own credential: a Bedrock API key as the bearer with x-anyray-aws-auth-type: apiKey, or x-anyray-aws-access-key-id and x-anyray-aws-secret-access-key. A request with neither, or with x-anyray-aws-auth-type: assumedRole, gets a 400. The gateway would assume that role with its own AWS credentials.

On Azure, auth mode managed or workload gets a 400 on every route that reaches Azure OpenAI, because it uses the gateway's own Azure identity (Azure). The caller's API key, AD token or Entra client credentials work.

In pass-through, /v1/messages always uses the Anthropic seat lane or the request's custom host. The Bedrock and Azure rules apply to the other routes.

Saving the config​

Who can add a host​

A new node-written origin, or a new pairing of credentials with a base URL or custom_endpoints, needs providerkeys:manage (providers:write for API keys) as well as routing:write. This covers roots, groups and every branch, including nodes without a provider. A host injected from the node's own provider key needs no extra grant. Copying that URL into routing, or inheriting it for another node's credential, is node-written.

If the provider keys can't be read, the save returns 503 provider_keys_authority_unavailable. Without the permission, a save that adds such a pairing returns 403 outbound_host_requires_providerkeys_manage, and the audit records only the actor, code and route. Existing pairings can stay as they are.

Credential references​

Routing reads mask inline provider credentials and customBody (snake-case spellings too) as {"$anyrayCredentialRef":"<64 lowercase hex HMAC>"}. inlineCredentials: {present, targets} reports whether any are present and on how many nodes. The stored config and dispatch are unchanged.

Guardrail checks are masked the same way: every field under a check's credentials except addresses and modes (resourceName, customHost, azureAuthMode, base URLs, domains, regions), plus a top-level apiKey, a webhook or log sink's headers, and every URL a check sends data to (webhookURL, logURL, jwksUri): an incoming-webhook URL is itself a credential. An address that embeds userinfo, a query or a fragment is masked whole. A reference stays on the check it came from, in the same guardrail field and spelling. Changing that check's plugin, any of its parameters or their key order is refused, and so is a reference placed anywhere the read did not put one. You can remove, reorder or disable (is_enabled) checks. New literal guardrail credentials are still accepted.

Echo references unchanged. A reference binds the node's raw fields, spellings and types, except weight and request_timeout. Ancestors bind the fields they pass down; a group's own strategy and on_status_codes stay editable. You can reorder or remove targets and edit independent siblings. No routing save, even a security admin's, can change a reference's addressing. A target with its own credential and no provider_key_id still takes the fields it leaves unset, Base URL included, from the provider's default key, which only providerkeys:manage can change. New literal customBody values remain writable; new credentials must use Provider keys and provider_key_id. A save replies with the config as stored, read like a GET, so the reply saves back unchanged. If that read fails, the save still happened and the reply is 503 routing_config_saved_unreadable; reload before saving again.

A read can also put a reference on an absent or empty root api_key, and, when guardrail credentials are masked, on the first unused root credential spelling. Older releases then refuse a projected save.

Save refusalCode
New literal credentials400 inline_credentials_refused
A sealed value: a string starting rsec:v<n>:, or an anyray_sealed object400 routing_sealed_value_refused
Unknown or stale reference400 routing_credential_reference_invalid
Changed bound fields400 routing_credential_address_changed
Changed guardrail check under a reference400 guardrail_credential_check_changed
Conflicting aliases400 routing_field_alias_conflict
Config would change or disappear on reload400 routing_config_load_mismatch
Saved, but reading it back failed (reload)503 routing_config_saved_unreadable
No database, and the routing file can't be read or parsed (GET too)500 routing_config_unreadable

The key behind references and revisions lives in the shared database (a file in the data dir when there is no database). Rotating the admin token does not change them. If the key is unavailable, reads and saves return 503 routing_credential_key_unavailable without a revision; requests keep using cached routing. A read the store could not serve returns the cached copy with fromCache: true. Restore the shared spend database or writable ANYRAY_DATA_DIR, then reload.

Stored routing credentials can be sealed with a key derived from ANYRAY_ADMIN_TOKEN. One this token cannot open fails only its own target with 424, never another key, and /admin/health reports routingCredentials: unreadable. Replace that target's credential with a provider key.

Saving safely from two places​

Send GET's revision back as expectedRevision; a stale one gets 409 with the winning revision.

Revision details
GET /admin/v1/routing → { "config": {...}, "revision": "a1b2c3d4e5f60718" }
PUT /admin/v1/routing { "config": {...}, "expectedRevision": "a1b2c3d4e5f60718" }

Without expectedRevision, the save retries concurrent changes up to three times, resolving references and checking permissions against the latest config each time. Repeated races return 409 with a retry message. The revision is an opaque keyed token: key order and no-op saves do not change it. The console reloads on 409 and asks you to reapply.

Without a database, a routing file that exists but can't be read or parsed gets no revision. GET and any save with expectedRevision return 500 routing_config_unreadable and leave the file as it is. Restore the file or remove it (a missing file means no routing config), then reload.