# List your assistants

Source: [List your assistants](<https://docs.gptunnel.ru/en/api/assistants/list/>)

<a id="_top"></a>
Authenticate requests with your [API key](<https://docs.gptunnel.ru/en/#get-an-api-key>).

<a id="request"></a>
## Request

`GET https://gptunnel.ru/v1/assistant/list`

Returns the key owner’s assistants, including private assistants, from newest to oldest. This endpoint is free.

To find assistants in the public catalog, use [catalog search](<https://docs.gptunnel.ru/en/api/assistants/search/>).

### Request headers

| Parameter | Type | Description |
| --- | --- | --- |
| `Authorization` (required) | `string` | API key |

### Query parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `query` | `string` | Case-insensitive substring filter on the assistant name or code |
| `limit` | `number` | Page size from 1 to 100. Defaults to 25. |
| `offset` | `number` | Pagination offset. Defaults to 0. |

<a id="example-request"></a>
### Example request

Set `GPTUNNEL_API_KEY`. The request returns the first page of the key holder’s list.

<a id="tab-panel-0-0"></a>
**Python**

```python
import json
import os
from urllib.request import Request, urlopen

request = Request(
    'https://gptunnel.ru/v1/assistant/list?limit=25&offset=0',
    headers={
        'Authorization': os.environ['GPTUNNEL_API_KEY'],
    },
)
with urlopen(request, timeout=60) as response:
    print(json.load(response))
```

<a id="tab-panel-0-1"></a>
**cURL**

```bash
curl --request GET \
  --url 'https://gptunnel.ru/v1/assistant/list?limit=25&offset=0' \
  --header "Authorization: ${GPTUNNEL_API_KEY:?Set GPTUNNEL_API_KEY}"
```

<a id="tab-panel-0-2"></a>
**JavaScript (Node.js)**

```javascript
const response = await fetch('https://gptunnel.ru/v1/assistant/list?limit=25&offset=0', {
  method: 'GET',
  headers: {
    Authorization: process.env.GPTUNNEL_API_KEY,
  },
})
if (!response.ok) throw new Error(await response.text())
console.log(await response.json())
```

To get the next page, keep `query` and `limit` unchanged and increase `offset` by `limit`. For example, with `limit=1`, the first two results are at offsets 0 and 1. A request with `limit=101` returns HTTP `400`.

<a id="example-response"></a>
### Example response

<a id="tab-panel-1-0"></a>
**200 OK**

The list response below omits `instruction` and `apiFunctions`. These fields are available when you [create an assistant](<https://docs.gptunnel.ru/en/api/assistants/create/>) or [update an assistant](<https://docs.gptunnel.ru/en/api/assistants/update/>).

```json
{
  "object": "list",
  "total": 1,
  "limit": 25,
  "offset": 0,
  "data": [
    {
      "object": "assistant",
      "id": "68c9b2d1e4b0a2d3c4f5e6b8",
      "mention": "example-assistant",
      "title": "Помощник",
      "modelId": "gpt-6-luna"
    }
  ]
}
```

<a id="tab-panel-1-1"></a>
**400 Bad Request**

```json
{
  "error": {
    "message": "limit: Number must be less than or equal to 100",
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }
}
```
