<span id="读取账号级对话模型策略"></span>

# Get account-level chat model policy

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

Read allowed model names and the default model for product agent_chat selection and account-level client discovery. This uses APIs distinct from workspace custom model lists and Genesis administrator service slot configuration.

```text
GET https://api.moi.matrixorigin.cn/v5/aistudio/model-policy
```

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

## Before you call this API

Set `MOI_ENDPOINT` to the product API prefix `https://api.moi.matrixorigin.cn/v5`; use the corresponding product API URL for a dedicated deployment.

Requires product identity, without a workspace header or Genesis administrator scope.

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

## Request

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

```bash
curl --fail-with-body "$MOI_ENDPOINT/aistudio/model-policy" \
  -H "X-API-Key: $AI_STUDIO_API_KEY"
```

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

No business parameters, request body, or pagination.

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

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

## Successful response

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

```json
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "default_model": "model-example",
    "models": [
      "model-example",
      "second-example"
    ]
  }
}
```

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

| Field | Type | Description |
| --- | --- | --- |
| data.default_model | string | Default model name, not model ID. |
| data.models | string[] | Currently allowed model names in configured order, nonempty and unique. |

The default name must belong to models. The service reads the current process's agent_chat configuration each time. It neither lists all workspace/Genesis models nor performs inference.

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

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

## Error responses

| HTTP | code | Condition |
| --- | --- | --- |
| 503 | ErrLLMServiceSlotNotConfigured | agent_chat is not configured. |
| 503 | ErrLLMServiceSlotUnavailable | Invalid current selection, name, or default, or a read failure. |
| 500 | ErrServer | Message localization failed. |

Product authentication errors follow the general entry point. This page does not enumerate every identity failure.
