# Quickstart API

Panduan singkat untuk mulai mengakses OmniStream secara programatik.

## 1. Buat API key

Buka **Developer → API Keys** di aplikasi (butuh izin `developer.access`), lalu
**Create API Key** bertipe `rest`. Key hanya ditampilkan **sekali** — simpan
dengan aman. Formatnya:

```
os_xxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

:::tip Kunci key ke IP Anda
Untuk integrasi server-to-server, isi **Allowed IPs** pada key (satu IP atau
CIDR, mis. `203.0.113.10` / `203.0.113.0/24`). Request dari luar daftar ditolak,
sehingga key yang bocor tidak bisa dipakai dari mana pun. Lihat
[dokumentasi allow list](/api).
:::

## 2. Autentikasi

Kirim key pada header `X-API-Key` di setiap request. Base URL adalah host API
gateway Anda (mis. `https://api.omnistream.example`).

```bash
curl https://api.omnistream.example/api/conversations \
  -H "X-API-Key: os_xxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
```

Request mewarisi RBAC dari agent pemilik key — API key tidak bisa melakukan
hal yang tidak bisa dilakukan pemiliknya di UI.

## 3. Request pertama

Kirim pesan teks ke sebuah percakapan:

```bash
curl -X POST \
  https://api.omnistream.example/api/conversations/CONVERSATION_ID/messages \
  -H "X-API-Key: os_..." \
  -H "Content-Type: application/json" \
  -d '{ "type": "text", "content": { "text": "Halo dari API!" } }'
```

## Langkah berikutnya

- [Pagination & rate limit](/developer/pagination-rate-limit)
- [TypeScript SDK](/developer/typescript-sdk) — client typed dengan retry & pagination
- [MCP server](/developer/mcp-server) — hubungkan ke Claude / Cursor
- [Verifikasi webhook](/developer/verifikasi-webhook)
- [API Reference lengkap](/api)
