> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://agentinbox.space/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://agentinbox.space/_mcp/server.

## Кратко

API-ключи с областью **inbox** позволяют выдавать учётные данные только для одного ящика. Агенты и интеграции получают минимально необходимый доступ; при компрометации ключа зона риска меньше.

### Что нового

**Новые endpoints:**

* `GET /v0/inboxes/:inbox_id/api-keys` — список ключей, привязанных к ящику
* `POST /v0/inboxes/:inbox_id/api-keys` — создать ключ для ящика
* `DELETE /v0/inboxes/:inbox_id/api-keys/:api_key` — удалить такой ключ

**Обновлённые типы:**

* В `ApiKey` и `CreateApiKeyResponse` добавлено необязательное поле `inbox_id`, если ключ ограничен ящиком

### Сценарии

Собирайте системы, где:

* доступ только к одному ящику, а не ко всему pod или организации
* узкие ключи для сторонних интеграций с одним адресом
* ротация ключей по ящикам без влияния на остальные

**`Python`**

```python title="Python"
from agentinbox import Agentinbox

client = Agentinbox(api_key="your-api-key")

# create an api key scoped to a single inbox
key = client.inboxes.api_keys.create(
    inbox_id="user@example.com",
    name="integration-key"
)

print(key.api_key)
```

**`TypeScript`**

```typescript title="TypeScript"
import { Agentinbox } from "agentinbox";

const client = new Agentinbox({ apiKey: "your-api-key" });

// create an api key scoped to a single inbox
const key = await client.inboxes.apiKeys.create("user@example.com", {
  name: "integration-key",
});

console.log(key.apiKey);
```

> **Note**
>
> Подробнее об областях ключей — в [справочнике API Keys](https://agentinbox.space/api-reference/inboxes/api-keys).