multi-router.aidocs

Prompts

Prompt Binding

Attaching a prompt to a router, choosing its revision, and composing it with the caller's messages.

A prompt binding attaches one prompt to a static router, so every request through the router carries that prompt. The binding names the prompt, chooses whether the router follows the prompt's latest revision or a pinned revision, and works together with Prompt composition, the router setting that decides how a text prompt combines with a system message the caller sends. A router has at most one binding, and one prompt can be bound to many routers.

Router types

Prompt bindings belong to static routers. Each router type uses them as follows:

Router typePrompt binding
Static routerHas its own binding.
Fallback routerUses the binding of the member that serves the request.
Weighted routerUses the binding of the member that serves the request.
Claude ProxyHas no binding. The coding agent's own prompts are forwarded as sent.
Adaptive RouterHolds named bindings. A rule or the default applies one, or the request chooses one with X-MR-Prompt. See Adaptive Router.
Codex Proxy, Gemini ProxyHas no binding. The coding agent's own prompts are forwarded as sent.

A request through an alias uses the binding of the router the alias points to. Because fallback and weighted routers use their members' bindings, members can carry different prompts, for example a prompt tuned for each model. When a fallback member's prompt cannot be loaded, the fallback router moves on to the next member.

Latest or pinned

The revision mode decides which version of the prompt the router uses. Tracking latest suits prompts under active development; pinning suits production routers, where a prompt change is released by moving the pin.

ModeValueDashboard labelRouter uses
LatestlatestTrack latestThe newest revision of an inline prompt, or the newest synced commit of a GitHub prompt. A new revision applies from the next request.
PinnedpinnedPin to a specific revisionOne revision number of an inline prompt, or one commit SHA of a GitHub prompt, until the pin is changed.

A common release flow is to keep a staging router on latest and the production router pinned: a new revision is tested through the staging router, and the production router's pin is then moved to it. Pinning back to the previous revision rolls the change back.

Prompt composition

Prompt composition is the router setting that decides how a bound text prompt combines with a system message the caller sends. When the caller sends no system message, the router's prompt is used in every mode.

ModeValueDashboard descriptionBehavior
MergemergeBoth router and caller system apply (default)The router's prompt comes first, followed by the caller's system message.
OverrideoverrideOnly the router's prompt applies; caller's system is droppedThe router's prompt replaces the caller's system message.
FallbackfallbackCaller's system wins when present; router's is the defaultThe caller's system message is used, and the router's prompt applies only when the caller sends none.

Merge suits a router that sets shared rules, such as tone or safety instructions, while callers add their own context. Override suits a router where the prompt must be exactly what is reviewed, regardless of callers. Fallback suits a router that supplies a sensible default for callers that have no prompt of their own.

On each endpoint

Prompt composition applies the same way on both endpoints, with one difference in how the result is shaped:

EndpointCaller system messageMerge result
POST /v1/chat/completionsThe first message, when its role is system.One system message: the router's prompt, a blank line, then the caller's system message.
POST /v1/messagesThe system field.The router's prompt as the first system block, followed by the caller's blocks unchanged.

On Messages, the caller's system blocks keep their own settings, including prompt caching marks, so a caller's cached system prompt stays cached when a router prompt is added in front of it.

Chat prompts

A bound chat prompt is placed in front of the caller's messages, and the caller's system message is replaced by the chat prompt. Prompt composition applies only to text prompts, and the Prompt panel shows Not applicable in its place when a chat prompt is bound. See Prompt Type.

Binding in the dashboard

Back to Routers

Support bot

enabledstatic
productionsupportAdd tag

Answers customer questions in the help center chat widget.

rt_9Hk3Ws7PzQ·created Mar 4, 2026·updated Sep 30, 2026
Disable
OverviewTrafficActivity

Aliases

Add
production

Model

Edit
Provideranthropic
Modelanthropic/claude-sonnet-4.5
Variantstandard
Provider keyAnthropic productionllpk_8Rn3Kx5WbT
Model source
Use request modelUse the caller's model with this router's provider, credential & preset

Prompt

Edit
SourceInline
Promptsupport-triage(ip_6Rt2Kw9QmD)
Revision@3(pinned)
Prompt composition
MergeBoth router and caller system apply (default)

Request Logging

What this router records about its requests. Capped by the administrator's Storage Policy.

Edit
Request metadataFull Metadata
Request payloadsFailures only

Settings

Per-router configuration. Persisted in the router's versioned config blob.

A static router's Prompt panel with an inline prompt pinned to revision 3 and Prompt composition set to Merge. Select to enlarge.

The Prompt panel on a static router's page shows the binding's Source, Prompt, Revision and Prompt composition, or No prompt bound when the router has none, in which case the router forwards the caller's system message unchanged. To bind a prompt:

  1. On the router's page, select Bind in the Prompt panel, or Edit to change an existing binding.
  2. In 1. Source, choose Inline or a connected GitHub prompt repo.
  3. In 2. Prompt, choose the prompt or file.
  4. In 3. Revision, choose Track latest or Pin to a specific revision, and select Bind. Pinned revisions are listed by number with their title, author and date, or by short commit SHA.
  5. For a text prompt, choose Merge, Override or Fallback in the Prompt composition dropdown of the Prompt panel. The choice saves on its own.
Back to Routers

Support bot

enabledstatic
productionsupportAdd tag

Answers customer questions in the help center chat widget.

rt_9Hk3Ws7PzQ·created Mar 4, 2026·updated Sep 30, 2026
Disable
OverviewTrafficActivity

Bind a prompt

Pick where the prompt lives, then drill in.

Unbind Cancel
1. SourceInlinesupport-triage
Revision
BindBack
The Bind a prompt editor at the revision step, pinning support-triage to revision 3. Select to enlarge.

Unbind removes the binding. When creating a static router, the Bound prompt field on the New Router page binds an inline prompt at its latest revision; the binding can be changed on the router's page afterwards.

Binding with the API

A binding is set with the prompt.binding field when a static router is created with POST /v1/routers or changed with PATCH /v1/routers/{id}, and Prompt composition is prompt.system_message_mode. A change that leaves out prompt.binding keeps the existing binding, and "prompt": { "binding": null } removes it. The routers bound to a prompt are listed with GET /v1/prompts/{id}/routers.

FieldValue
sourceinline or github
Where the prompt lives.
prompt_idAn ip_ id
The inline prompt. Used when source is inline.
prompt_repo_idA pr_ id
The prompt repo. Used when source is github.
file_pathA tracked file path
The file in the prompt repo, such as prompts/support-triage.md. Used when source is github.
version_modelatest or pinned
Whether the router follows the newest revision or a pinned one.
pinned_valueA revision number or commit SHA
The pinned revision. A positive whole number for an inline prompt, or a commit SHA of 7 to 40 hexadecimal characters for a GitHub prompt. Used when version_mode is pinned.
Bind an inline prompt pinned to revision 3bash
curl -X PATCH https://api.multi-router.ai/v1/routers/rt_9Hk3Ws7PzQ \
  -H "Authorization: Bearer $MR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": {
      "binding": {
        "source": "inline",
        "prompt_id": "ip_6Rt2Kw9QmD",
        "version_mode": "pinned",
        "pinned_value": "3"
      },
      "system_message_mode": "merge"
    }
  }'
GitHub prompt binding tracking latestjson
{
  "prompt": {
    "binding": {
      "source": "github",
      "prompt_repo_id": "pr_Xb5Nq2Lw8T",
      "file_path": "prompts/support-triage.md",
      "version_mode": "latest"
    }
  }
}

Multi-Router checks the binding when it is saved: the prompt or tracked file must exist in the organization, and a pinned revision or commit must exist for that prompt.

Errors

Saving a binding returns the following errors:

ErrorStatusCause
prompt_not_found400The prompt, prompt repo or tracked file does not exist in the organization.
invalid_pinned_value400The pinned value is not a positive whole number for an inline prompt, or not a 7 to 40 character commit SHA for a GitHub prompt.
pinned_value_not_found400The prompt has no such revision, or the file does not exist at that commit.
github_not_connected400The prompt repo's GitHub organization is no longer connected.
field_not_supported_for_kind400A binding is set on a router type that has none, such as a Claude Proxy.
unknown_field400The binding uses rev_mode; the API takes version_mode.
prompt_validation_rate_limited429The organization made more than 60 requests in a minute that check GitHub. See Limits on Managing Prompts.
prompt_upstream502GitHub could not be reached to check a commit.
github_not_configured503The GitHub integration is not set up for this Multi-Router installation.

Requests through a router with a binding return the following errors. Each has an error code, on Chat Completions and on Messages. Apart from missing_prompt_variables, they have the error type upstream_error:

StatusCodeCause
400missing_prompt_variablesThe request leaves out a variable the prompt uses. See Prompt Variables.
502prompt_unavailableThe router's prompt was deleted, its GitHub file was removed from the branch or failed to sync, or a pinned commit could not be read from GitHub.
502prompt_malformedThe chat prompt breaks the chat rules.
429github_rate_limitedGitHub limited requests while Multi-Router read a pinned commit from GitHub. The Retry-After header gives the seconds to wait.
503github_not_configuredA GitHub prompt is bound and the GitHub integration is not set up for this Multi-Router installation.
Prompt VariablesManaging Prompts
Was this helpful?