PATCH/v1/routing/{policy_id}

Update a routing policy

Send only the fields to change. rules replaces the whole list, so send every rule you want to keep. The alias cannot change. Send null to remove fallback_model. The change applies to new requests within a minute.

Authentication: Bearer API key in the Authorization header

Path parameters

  • policy_idstringrequired

    The routing policy id.

Request body

  • descriptionstring | null

    A note for people.

  • rulesarray<object>

    Tried in order. The first rule that matches picks the model.

    rules
    • tagstringrequired

      A tag id from GET /v1/tags.

    • thresholdnumber

      The rule matches when the tag's probability for any message in the request is at or above this value.

      Default: 0.5
    • modelstringrequired

      The model slug that serves the request when the rule matches.

  • default_modelstring

    The model slug that serves a request when the whole request was read and no rule matched.

  • fallback_modelstring | null

    The model slug that serves a request when the check does not finish in time, or the request carries content it cannot read. null refuses the request instead: 503 gateway_unavailable when the check did not finish, 400 content_filter for content it cannot read.

  • max_wait_msinteger

    The longest a request waits for the check, in milliseconds.

Responses

  • 200

    The updated routing policy.

    Response
    • idstringrequired
    • aliasstringrequired

      The model name callers send to use the policy.

    • descriptionstring | null

      A note for people.

    • rulesarray<object>required

      Tried in order. The first rule that matches picks the model.

      rules
      • tagstringrequired

        A tag id from GET /v1/tags.

      • thresholdnumber

        The rule matches when the tag's probability for any message in the request is at or above this value.

        Default: 0.5
      • modelstringrequired

        The model slug that serves the request when the rule matches.

    • default_modelstringrequired

      The model slug that serves a request when the whole request was read and no rule matched.

    • fallback_modelstring | nullrequired

      The model slug that serves a request when the check does not finish in time, or the request carries content it cannot read. null refuses the request instead: 503 gateway_unavailable when the check did not finish, 400 content_filter for content it cannot read.

    • max_wait_msintegerrequired

      The longest a request waits for the check, in milliseconds.

    • created_atstring
    • updated_atstring
  • 401

    Missing, unknown or revoked API key.

  • 403

    The key is not a provisioning key, or the resource is read-only (tag_read_only, guardrail_read_only).

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one.

  • 404

    The resource does not exist or belongs to another organization. An organization without access gets this answer on every route.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one.

  • 422

    The body failed validation, or it names something that does not exist or cannot be used (unknown_tag, unknown_model, unknown_identity, model_not_allowed).

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one.

Request

curl -X PATCH 'https://api.experientiallabs.ai/v1/routing/00000000-0000-4000-8000-000000000012' \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "rules": [
    {
      "tag": "internalConfidential",
      "threshold": 0.4,
      "model": "my-local-model"
    },
    {
      "tag": "personalData",
      "threshold": 0.7,
      "model": "my-local-model"
    }
  ]
}'

Response

{
  "id": "00000000-0000-4000-8000-000000000012",
  "alias": "acme-auto",
  "description": "Keep confidential requests on our own model",
  "rules": [
    {
      "tag": "internalConfidential",
      "threshold": 0.4,
      "model": "my-local-model"
    },
    {
      "tag": "personalData",
      "threshold": 0.7,
      "model": "my-local-model"
    }
  ],
  "default_model": "gpt-6-luna",
  "fallback_model": "my-local-model",
  "max_wait_ms": 2000,
  "created_at": "2026-11-20T00:00:00Z",
  "updated_at": "2026-11-21T00:00:00Z"
}

https://api.experientiallabs.ai/v1/routing/00000000-0000-4000-8000-000000000012