# Search the assistant catalog

Source: [Search the assistant catalog](<https://docs.gptunnel.ru/en/api/assistants/search/>)

<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/search`

Search the same catalog shown on the website. A free search combines matches on the assistant’s name or code with semantic matches based on the meaning of the query.

Results reflect the key owner’s access. Owners can find their own private assistant by its exact `@mention`. Organization and team restrictions apply to organization assistants. You can also [list your own assistants](<https://docs.gptunnel.ru/en/api/assistants/list/>).

### Request headers

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

### Query parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `query` | `string` | Search text. An empty query lists the catalog. To search by exact assistant code, start the query with @. |
| `sortBy` | `string` | Use popular to sort by popularity (default), or newest to show the latest assistants first. |
| `limit` | `number` | Page size, 1–30. By default 25 |
| `offset` | `number` | Pagination offset. Defaults to 0. |

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

Set `GPTUNNEL_API_KEY`. The example retrieves the first assistant visible in the catalog. For an exact match, add the `query` parameter with the assistant’s `@mention`.

<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/search?sortBy=popular&limit=1',
    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/search?sortBy=popular&limit=1' \
  --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/search?sortBy=popular&limit=1', {
  method: 'GET',
  headers: {
    Authorization: process.env.GPTUNNEL_API_KEY,
  },
})
if (!response.ok) throw new Error(await response.text())
console.log(await response.json())
```

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

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

Example response for an assistant visible to the key owner.

Results expose only public fields. Another user’s instructions, functions, and MCP settings are omitted.

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

<a id="tab-panel-1-1"></a>
**503 Service Unavailable**

Semantic search is temporarily unavailable. Retry later. The API does not substitute a list sorted by popularity.

```json
{
  "error": {
    "message": "Assistant search is temporarily unavailable",
    "type": "service_unavailable",
    "param": null,
    "code": "search_unavailable"
  }
}
```

> **Tip: How to Start Dialogue**
>
> To [chat with an assistant](<https://docs.gptunnel.ru/en/api/assistants/chat/>) from the results, pass its `mention` in the `assistantCode` field.
