# Get account preferences

<span id="查询账户偏好"></span>

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

Read the display language, time zone, and last update time of the authenticated account. The response sets `Cache-Control: no-store` and does not modify account settings.

```text
GET https://api.moi.matrixorigin.cn/v5/auth/preferences
```

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

## Before you begin

Prepare a personal access token or service account access token for the current account; see [Access credentials](../../../../../guides/billing/credentials.md#choose-credential-type). This endpoint reads preferences for the current account directly and does not require a workspace ID.

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

## Request example

Replace `$AI_STUDIO_API_KEY` with your credential. Authenticate with `X-API-Key`, `Authorization: Bearer`, or a browser session; credential types are mutually exclusive in a single request, and `X-Workspace-ID` is not required.

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

```bash
curl "https://api.moi.matrixorigin.cn/v5/auth/preferences" \
  -H "X-API-Key: $AI_STUDIO_API_KEY"
```

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

This endpoint takes no path, query, or request body parameters. It resolves the target account directly from the authenticated identity.

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

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

## Successful response

Returns HTTP `200` with `Cache-Control: no-store`. The top-level response object contains only `code` and `data`, with no `msg` field. To modify these settings, call [Update account preferences](update-account-preferences.md).

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

```json
{
  "code": "OK",
  "data": {
    "locale": "zh-CN",
    "timezone": "Asia/Shanghai",
    "updated_at": "2026-10-14T08:00:00Z"
  }
}
```

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

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | Always `OK` when the request succeeds. |
| `data` | object | Preferences for the current account. |
| `data.locale` | string | Account display language tag: `zh-CN`, `en-US`, `fr-FR`, `es-ES`, `ar`, or `id-ID`. |
| `data.timezone` | string | Account time zone as an IANA time zone name, such as `Asia/Shanghai` or `UTC`. |
| `data.updated_at` | string | Last preference update timestamp in RFC 3339 format. |

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

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

## Error response

Missing or invalid credentials return HTTP `401` (`Unauthorized` or `unauthenticated`). Sending multiple authentication credentials in the same request returns HTTP `400` (`ErrMultipleAuthCredentials`). When the upstream preference service is unavailable, the endpoint returns HTTP `502` (`ErrServiceUnavailable`). Error responses contain only `code` and `msg`, with no `data` field.

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

```json
{
  "code": "Unauthorized",
  "msg": "Unauthorized"
}
```

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

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | Error code, such as `Unauthorized`, `unauthenticated`, `ErrMultipleAuthCredentials`, or `ErrServiceUnavailable`. |
| `msg` | string | Error message text. |

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