Skip to content

Endpoint: Routing Advisory ​

Get routing recommendations without executing a prompt. Use this to preview which provider would be selected for a given request.

Endpoint ​

http
POST /api/gateway/routing-advisory

Request Body ​

json
{
  "input": "Your prompt text here",
  "routingPolicy": {
    "strategy": "LOWEST_COST"
  },
  "policyId": "clxyz123..."
}

Parameters ​

FieldTypeRequiredDescription
inputstringYesThe prompt text to evaluate
routingPolicyobjectNoInline policy configuration
policyIdstringNoID of a saved routing policy

Either routingPolicy or policyId should be provided. If both are provided, policyId takes precedence.

Response ​

json
{
  "success": true,
  "recommendation": {
    "primary": {
      "provider": "openai",
      "model": "gpt-4-turbo",
      "estimatedLatency": 520,
      "estimatedCost": 0.00002,
      "qualityScore": 0.94,
      "reasoning": "Best match for cost-optimized routing"
    },
    "fallbacks": [
      {
        "provider": "anthropic",
        "model": "claude-3-haiku",
        "estimatedLatency": 380,
        "estimatedCost": 0.000025,
        "qualityScore": 0.88
      }
    ],
    "policyApplied": "Cost Optimized Default"
  }
}

Example: Cost-Optimized Advisory ​

bash
curl https://app.veriprompt.tech/api/gateway/routing-advisory \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "Summarize this customer feedback in one sentence.",
    "routingPolicy": {
      "strategy": "LOWEST_COST",
      "preferences": {
        "weights": {
          "cost": 0.6,
          "latency": 0.2,
          "quality": 0.2
        }
      }
    }
  }'

Example: Using Saved Policy ​

bash
curl https://app.veriprompt.tech/api/gateway/routing-advisory \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "Process this healthcare form.",
    "policyId": "clxyz123-hipaa-policy"
  }'

Strategy Values ​

StrategyDescription
BALANCEDEqual weight to all factors
LOWEST_COSTPrioritize cheapest providers
LOWEST_LATENCYPrioritize fastest providers
HIGHEST_QUALITYPrioritize best quality
ROUND_ROBINRotate between providers

Task-aware evidence (subscriber advisory) ​

The subscriber advisory endpoint /api/v1/routing-advisory (API-key authenticated, rate limited) accepts optional task fields and returns benchmark evidence per model for that task. Both fields are additive: without them the response is unchanged, and they never reorder recommendations.

http
GET  /api/v1/routing-advisory?taskCodes=coding,legal
POST /api/v1/routing-advisory
FieldWhereTypeDescription
taskCodesquery (comma-separated) or bodystring or string[]Task codes or their aliases, for example coding, legal, translation. Unknown terms are ignored
contentbody onlystring (max 20,000 characters)Sample request text. It is classified with the rule-based classifier only; no model is called and nothing is stored. Keep personal data out of it

The POST body also accepts regions, providerTypes, complianceFrameworks (string arrays), maxCost, minPerformance (numbers) and useCase (string), as the GET query does.

bash
curl https://app.veriprompt.tech/api/v1/routing-advisory \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "taskCodes": ["coding"], "regions": ["EU"] }'

When taskCodes or content is sent, two top-level fields are added to the response:

json
{
  "recommendations": [ "..." ],
  "taskProfile": {
    "codes": ["coding"],
    "dimensions": ["coding"],
    "confidence": 1,
    "source": "EXPLICIT",
    "applied": true,
    "classifierVersion": "explicit"
  },
  "taskFit": {
    "evidence": [
      {
        "providerId": "anthropic",
        "model": "example-model",
        "taskFit": {
          "blendedQualityScore": 0.87,
          "legacyQualityScore": 0.7,
          "perDimension": { "coding": { "dimension": "coding", "score": 0.87, "source": "external" } },
          "provenance": [
            {
              "dimension": "coding",
              "score": 0.87,
              "source": "external",
              "asOf": "2026-09-28T00:00:00.000Z",
              "benchmarks": ["livebench:coding"],
              "weight": 1
            }
          ]
        },
        "explanations": [
          { "key": "taskFitExplainDimExternal", "vars": { "dimension": "coding", "value": 82, "benchmarks": "livebench:coding", "asOf": "2026-09-28" } }
        ]
      }
    ],
    "explanations": [
      { "key": "taskFitExplainApplied", "vars": { "tasks": "coding", "confidence": 100 } }
    ]
  }
}
  • taskProfile.source is one of EXPLICIT (you sent codes) or CLASSIFIED (detected from content), or NONE. classifierVersion is explicit or the rule-based classifier's version, never a model.
  • taskFit.evidence lists up to ten provider models that have benchmark or own-data evidence for the task, best first. Models without evidence are left out.
  • provenance[].source is external (third-party benchmark), internal (company evidence, never returned to API-key subscribers; only global benchmark rows are read here), manual (specialization tag) or tier (static quality tier). benchmarks lists source:benchmark identifiers; asOf is the newest evidence date.
  • explanations are { key, vars } pairs: key is a stable message key and vars its values, so a client can render its own wording. The English text of each key is shown in the product's policy preview.
  • An invalid taskCodes or content type returns 400 with an error message.