POST/v1/routing/{policy_id}/preview

Preview a routing decision

Return the model the policy would pick for sample text, with the score of every rule. The text is checked like one message of a request, and is not sent to any model in the policy.

Authentication: Bearer API key in the Authorization header

Path parameters

  • policy_idstringrequired

    The routing policy id.

Request body

  • inputstringrequired

    The text to check, as it would appear in one message of a request.

Responses

  • 200

    The decision.

    Response
    • decisionenumrequired

      rule when a rule matched, default when none did.

      "rule""default"
    • modelstringrequired

      The model slug the policy would send the request to.

    • tagstring | nullrequired

      The tag of the rule that matched. null on default.

    • resultsarray<object>required

      One entry per rule, in rule order.

      results
      • tagstringrequired
      • probabilitynumberrequired

        The probability, from 0 to 1, that the answer to the tag's question is yes.

      • thresholdnumberrequired
      • matchedbooleanrequired
  • 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.

  • 503

    The check could not run. Retry with backoff.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one.

Request

curl -X POST 'https://api.experientiallabs.ai/v1/routing/00000000-0000-4000-8000-000000000012/preview' \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "input": "Draft the board update. Revenue was 4.2M against a 5M plan and we are pausing the Atlas launch."
}'

Response

{
  "decision": "rule",
  "model": "my-local-model",
  "tag": "internalConfidential",
  "results": [
    {
      "tag": "internalConfidential",
      "probability": 0.96,
      "threshold": 0.5,
      "matched": true
    },
    {
      "tag": "personalData",
      "probability": 0.02,
      "threshold": 0.7,
      "matched": false
    }
  ]
}

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