<span id="查询槽位可分配模型"></span>

# List models assignable to a slot

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

Read model IDs and types from the deployment's TaaS public catalog snapshot. Select according to the target slot's allowed_model_types. A candidate's existence does not make it usable in every slot.

```text
GET https://api.moi.matrixorigin.cn/v5/admin/aistudio/service-slots/candidates
```

<span id="调用前准备"></span>

## Before you call this API

Prepare a Genesis administrator Bearer token valid in this environment. Regular personal access tokens, X-API-Key, and Workspace Owner privileges do not substitute for it. Session mode also requires the corresponding CSRF protection. See [AI Studio](../../../../../developer/api/ai-studio/index.md). These account-level administrative operations do not require a workspace ID.

<span id="请求参数"></span>

## Request parameters

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Request example

```bash
curl --get "https://api.moi.matrixorigin.cn/v5/admin/aistudio/service-slots/candidates" \
  -H "Authorization: Bearer $GENESIS_ADMIN_TOKEN"
```

:::::
:::::{tab-item} Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `Authorization` | string | Yes for Bearer example | Bearer followed by the administrator token for the current environment. Do not also send X-API-Key. |

:::::
::::::
:::::::

<span id="成功响应"></span>

## Successful response

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "models": [
    {
      "id": "model-example",
      "name": "model-example",
      "type": "chat_text"
    }
  ]
}
```

:::::
:::::{tab-item} Fields

| Field | Type | Description |
| --- | --- | --- |
| `models` | object (array of objects) | Catalog candidates; may be empty if the catalog is disabled. |
| `models[].id` | string | ID used for model_ids and default_model_id. |
| `models[].name` | string | Name, currently identical to the ID. |
| `models[].type` | string | Compare with types allowed by the target slot. |

:::::
::::::
:::::::

<span id="错误响应"></span>

## Error response

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "code": "ErrForbidden",
  "msg": "Forbidden"
}
```

:::::
:::::{tab-item} Fields

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | Current error code. |
| `msg` | string | Explanation of the failure stage; this example uses HTTP Forbidden text. |

| HTTP / code | Conditions and recovery |
| --- | --- |
| 400 / ErrParamInvalid | Invalid slot, model, default, JSON text, or log count parameter. |
| 401 / Unauthorized | Invalid identity or inapplicable authentication such as X-API-Key. |
| 403 / ErrForbidden | No Genesis administrator fact. |
| 503 / ErrServiceUnavailable | Classified required identity or configuration dependency unavailable. |
| 500 / ErrServer or InternalServerError | Internal or identity-stage failure. Read again after a write error rather than assuming rollback. |

Errors use code/msg, whereas success returns a raw object. Different failure stages may use different string codes. Do not invent a distinct machine reason for every validation error.

:::::
::::::
:::::::
