# List LLM backends through the Workspace API

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

List readable LLM backends in the current Workspace.


```http
GET https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/llm/backends
```

## Before you call this API

Set `BASE_URL` to the product API prefix `https://api.moi.matrixorigin.cn/v5`. For private deployments, use the corresponding product API URL.

[Configure identity, Workspace, and object permissions in the same environment](objects.md#prepare).

## Request

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

```bash
curl --request GET \
  "$BASE_URL/workspaces/$WORKSPACE_ID/llm/backends" \
  --header "X-API-Key: $MOI_KEY" \
  --header "X-Workspace-ID: $WORKSPACE_ID"
```

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

| Parameter | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Workspace-ID` | Headers | string | Yes | Workspace ID in the same environment. |
| `workspace_id` | Path | string | Yes | Workspace ID in the same environment. |

Unpaginated; returns backends/total. Both fields may be omitted for zero results, with SDK defaults of an empty collection/0. Lists filter by model_backend.read and are not the complete routing pool of system-default/deployment models.

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

## Successful response

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

```json
{
  "code": 0,
  "data": {
    "backends": [
      {
        "id": 12,
        "name": "临时后端",
        "timeout_seconds": 120,
        "models": [
          "chat-example"
        ],
        "created_at": 1794445200,
        "updated_at": 1794445200,
        "provider_origin": "external_provider"
      }
    ],
    "total": 1
  }
}
```

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

HTTP 200。

| Field | Type | Description |
| --- | --- | --- |
| `code` | integer | 0 on success. |
| `data` | object | [Actual objects for this protocol](objects.md#responses). |

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

## Error responses

[Errors and result confirmation](objects.md#errors) distinguishes the two protocols. Parse omitted fields, SDK zero values, and empty HTTP responses separately. Confirm writes using the corresponding read operation.
