Query model configuration list

Query the agent model configuration in the workspace.

GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/model-configs

Before you call

Prepare a personal access token and target workspace ID that has access to the target workspace.

The example below uses:

  • $AI_STUDIO_API_KEY: The actual personal access token, passed through the X-API-Key Header.

  • $WORKSPACE_ID: The workspace ID to be queried, passed through the X-Workspace-ID Header, and as workspace_id in the path.

Request example

curl "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/model-configs?model_category=chat&limit=20" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Path parameters

Parameters

Type

Is it required

Description

workspace_id

string

Yes

Current workspace ID, must be consistent with X-Workspace-ID.

Query parameters

Parameters

Type

Is it required

Description

status

string

No

Filter by configuration status.

source_kind

string

No

Filter by model source type.

model_category

string

No

Filter by model category.

provider_ref

string

No

Filter by provider reference.

query

string

No

Query by name or related text.

limit

integer

No

Returns the upper limit of quantity.

offset

integer

No

Returns the offset.

Successful response

Returns 200 on success. data.items is the model configuration, data.total, data.limit and data.offset describe the list ranges.

{
  "code": 0,
  "data": {
    "items": [
      {
        "id": "mc_01",
        "name": "Sales Analysis Model",
        "status": "active",
        "source_kind": "workspace",
        "model_category": "chat",
        "model_name": "<MODEL_NAME>",
        "version": 1
      }
    ],
    "total": 1,
    "limit": 20,
    "offset": 0
  }
}

The response fields are as follows.

Field

Type

Description

code

integer

0 on success.

data.items

array of object or null

Model configuration list. The service may return null when there are no model configurations; treat this as an empty list.

data.items[].id

string

Model configuration ID.

data.items[].name

string

Configuration name.

data.items[].status

string

Configuration status.

data.items[].source_kind

string

Model source type.

data.items[].model_category

string

Model category.

data.items[].model_name

string

Model name.

data.items[].version

integer

Configuration version.

data.total

integer

The total number of filter results, the current return upper limit and offset.

data.limit

integer

The total number of filter results, the current return upper limit and offset.

data.offset

integer

The total number of filter results, the current return upper limit and offset.

[] after a type denotes an array. [] in a field path denotes each item in an array.

Error response

{
  "code": 2,
  "message": "模型配置参数无效"
}

Common HTTP errors

HTTP status code

error code

Common causes

Recommended actions

400

2INVALID_ARGUMENT

Invalid workspace or filter parameters.

Check path and query parameters.

401

6UNAUTHENTICATED

Credentials are missing or invalid.

Check API Key.

403

5PERMISSION_DENIED

The current identity does not have permission to read the workspace configuration.

Use valid credentials, or contact your administrator for authorization.

503

15UNAVAILABLE

The model configuration service is unavailable.

Try again later.

Follow-up operations

Use configuration ID Query model configuration details.

Last updated on