Skip to content
Niu DocsNiu 牛元文档
Dashboard控制台

Dry-run routing preview for a model route pool

Generated from the checked-in source. Do not edit this reference by hand.

POST /api/v1/pools/{reference}/preview

Evaluates a pool’s ordered routing rules, candidate eligibility, priority tiers, and normalized traffic weights for a simulated request without dispatching upstream traffic.

Operation: previewPool.

Use the credential and permission scope described above. Each object below is an alternative; schemes within one object are required together.

JSON
[
{
"bearerAuth": []
}
]

Set NIU_ORIGIN to your installation origin (without /v1). Replace path, query and header placeholders with the required values. Query examples use curl 7.87 or newer to encode values with --url-query. Use the credential scope described above; a bearer token must have the authority required by this operation.

Shell
curl --fail-with-body -X POST "$NIU_ORIGIN/api/v1/pools/{reference}/preview" \
-H "Authorization: Bearer $NIU_BEARER_TOKEN" \
-H 'Content-Type: application/json' \
--data @request.json

Location: path. Required. Unpadded base64url encoding of the exact ASCII pool alias.

JSON
{
"type": "string",
"minLength": 2,
"maxLength": 267,
"pattern": "^[A-Za-z0-9_-]+$"
}

Required.

JSON
{
"type": "object",
"additionalProperties": false,
"properties": {
"protocol": {
"type": "string",
"enum": [
"chat",
"responses",
"messages"
]
},
"streaming": {
"type": "boolean"
},
"vision": {
"type": "boolean"
},
"tools": {
"type": "boolean"
},
"structured_output": {
"type": "boolean"
},
"reasoning": {
"type": "boolean"
},
"input_tokens": {
"type": [
"integer",
"null"
],
"minimum": 1
},
"output_tokens": {
"type": [
"integer",
"null"
],
"minimum": 1
},
"candidates": {
"type": "array",
"items": {
"type": "object"
}
},
"rules": {
"type": "array",
"items": {
"type": "object"
}
},
"default_action": {
"type": "string",
"enum": [
"candidates",
"reject"
]
}
}
}

Dry-run routing preview result

Content type: application/json.

JSON
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "object"
}
}
}

Invalid reference or preview parameters

Authentication required

Platform administration required

Pool not found

Evaluates a pool’s ordered routing rules, candidate eligibility, priority tiers, and normalized traffic weights for a simulated request without dispatching upstream traffic.

Supported scope: implemented