Creates a routing rule.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
polardb:CreateModelApi |
create |
*All Resource
|
None | None |
Request syntax
POST HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| GwClusterId |
string |
Yes |
The gateway instance ID. |
pg-xxxxxxxxxx |
| Name |
string |
Yes |
The model API name. |
test |
| ModelCategory |
string |
Yes |
The category. Valid values:
|
text |
| PathPrefix |
string |
Yes |
The API path prefix. |
/test |
| Protocol |
string |
Yes |
The protocol. Valid values:
|
openai |
| RecordInput |
string |
No |
The number of input points. |
10 |
| RecordOutput |
string |
No |
The number of output points. |
10 |
| RouteRules |
string |
Yes |
The list of routing rules (JSON array string). |
[ { "RuleName": "string", "FallbackMode": "failover", "MatchModelListJson": "[]", "providerBalancerAlgorithm": "round-robin", "Providers": [ { "ModelServiceName": "string", "Weight": "0", "model_protocol": "vllm" "ModelList": "[]" } ], "FallbackProviders": [ { "ModelServiceName": "string", "model_protocol": "anthropic", "Weight": "10", "ModelList": "[]" } ] } ] |
| Config |
string |
No |
The gateway retry configuration. |
{ "failover": { "enabled": true, "max_provider_retries": 2, "max_failover_providers": 1, "retryable_status_codes": [429, 500, 502, 503, 504], "retry_delay": 0.5 } } |
| ForceModel |
string |
No |
The forced model. |
xxx |
| RegionId |
string |
No |
The region ID. |
cn-beijing |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
Id of the request |
6BD9CDE4-5E7B-4BF3-9BB8-83C73E****** |
| ModelApiId |
string |
The model API ID. |
mi-xxxxxx |
| InvokeEndpoint |
string |
The request endpoint. |
xxx |
| Status |
string |
The model API status. |
Enable |
Examples
Success response
JSON format
{
"RequestId": "6BD9CDE4-5E7B-4BF3-9BB8-83C73E******",
"ModelApiId": "mi-xxxxxx",
"InvokeEndpoint": "xxx",
"Status": "Enable"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.