DescribeModelApis

Updated at:
Copy as MD

Model Query API

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

polardb:DescribeModelApis

none

*All Resource

*

None None

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

GwClusterId

string

Yes

The ID of the gateway instance.

pg-xxxxxxxxxx

ModelApiIds

string

No

The IDs of the model APIs. Separate multiple IDs with a comma.

mi-xxx,mi-xxxx

Name

string

No

The name of the model API.

testName

ModelCategory

string

No

The model category. Valid values:

  • text

  • embedding

  • rerank

text

PageNumber

integer

No

The page number.

1

PageSize

integer

No

The number of entries per page. Valid values:

  • 30

  • 50

  • 100 The default value is 30.

30

PathPrefix

string

No

The API path prefix.

/test

Protocol

string

No

The protocol. Valid values:

  • openai

  • anthropic

  • bailian

  • vllm

openai

Status

string

No

The model API status.

Enable

RegionId

string

No

The ID of the region.

cn-beijing

Response elements

Element

Type

Description

Example

object

The data returned.

RequestId

string

The ID of the request.

C61892A4-0850-4516-9E26-44D96C1782DE

TotalRecordCount

integer

The total number of records that match the query.

1

PageRecordCount

integer

The number of records returned on the current page.

30

PageNumber

integer

The page number.

1

PageSize

integer

The number of records to return on each page. Valid values: 30, 50, and 100.

Default value: 30.

30

Items

array<object>

A list of Model API objects.

object

A Model API object.

ModelApiId

string

The Model API ID.

mi-xxxx

Name

string

The Model API name.

testName

Category

string

The model category. Valid values:

  • text

  • embedding

  • rerank

text

Status

string

The Model API status.

Enable

Protocol

string

The protocol. Valid values:

  • openai

  • anthropic

  • bailian

  • vllm

openai

PathPrefix

string

The API path prefix.

tests/models/

RecordInput

string

The number of input records.

10

RecordOutput

string

The number of output records.

10

RouteRules

string

A JSON array of routing rules, formatted as a 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": "[]" } ] } ]

GmtCreated

string

The creation time.

2024-10-16 16:46:20

Examples

Success response

JSON format

{
  "RequestId": "C61892A4-0850-4516-9E26-44D96C1782DE",
  "TotalRecordCount": 1,
  "PageRecordCount": 30,
  "PageNumber": 1,
  "PageSize": 30,
  "Items": [
    {
      "ModelApiId": "mi-xxxx",
      "Name": "testName",
      "Category": "text",
      "Status": "Enable",
      "Protocol": "openai",
      "PathPrefix": "tests/models/",
      "RecordInput": "10",
      "RecordOutput": "10",
      "RouteRules": "[\n  {\n    \"RuleName\": \"string\",\n    \"FallbackMode\": \"failover\",\n    \"MatchModelListJson\": \"[]\",\n    \"providerBalancerAlgorithm\": \"round-robin\",\n    \"Providers\": [\n      {\n        \"ModelServiceName\": \"string\",\n        \"Weight\": \"0\",\n        \"model_protocol\": \"vllm\"\n        \"ModelList\": \"[]\"\n      }\n    ],\n    \"FallbackProviders\": [\n      {\n        \"ModelServiceName\": \"string\",\n        \"model_protocol\": \"anthropic\",\n        \"Weight\": \"10\",\n        \"ModelList\": \"[]\"\n      }\n    ]\n  }\n]",
      "GmtCreated": "2024-10-16 16:46:20\n"
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.