# Wakili documentation

Wakili lets you compose a production voice AI agent from your own STT, LLM, and TTS provider choices, then call it over a REST API and a WebSocket — no telephony infra, no streaming pipeline, no per-provider SDKs to wire up yourself.

You configure an **agent** (a system prompt + a provider/model choice for each of speech-to-text, the LLM, and text-to-speech) in the [Wakili dashboard](https://app.wakili.dev), generate an **API key**, and your app talks to two endpoints for a live call:

- `POST /agents/{agent_id}/calls` — start a call, get back a one-time WebSocket URL.
- `WS /calls/{call_id}/talk` — stream mic audio in, get transcript/reply-text/reply-audio events back.

The same API key and the same balance also cover **non-realtime** work — one-shot LLM completions, file transcription, and speech synthesis — plus `call.ended` webhooks, so you can run an entire voice product on Wakili without wiring up a second provider for the text-only steps around a call.

Everything else (billing, usage, recordings, per-call cost breakdowns and metrics) is queryable from the same API.

## Where to start

- **[Quickstart](/docs/quickstart)** — create an agent, get an API key, make your first call. ~5 minutes.
- **[Authentication](/docs/authentication)** — API keys vs. dashboard login tokens, and how to keep keys server-side.
- **[The talk WebSocket](/docs/talk-websocket)** — the streaming protocol: what you send, what you get back.
- **[Agents API](/docs/agents-api)** — create/list/update/delete agents, and the realtime pipeline knobs (barge-in, endpointing, language lock, model tier).
- **[Calls API](/docs/calls-api)** — start calls, list history, fetch the frozen transcript schema, per-call metrics, cost breakdown, and recordings.
- **[Batch LLM API](/docs/batch-llm-api)** — `POST /llm/completions`: pick a model, messages in, text or schema-validated JSON out. No agent.
- **[Batch STT API](/docs/batch-stt-api)** — `POST /stt/transcribe`: pick a provider, upload an audio file, get text + timestamps + optional diarization. No agent.
- **[Batch TTS API](/docs/batch-tts-api)** — `POST /tts/speak`: pick a provider and voice, text to a streamed audio file, with a server-side cache. No agent.

The batch endpoints bill the underlying model's list price plus a flat 10% routing fee — see each page.
- **[Webhooks](/docs/webhooks-api)** — register an endpoint, get a signed `call.ended` POST instead of polling.
- **[Next.js integration guide](/docs/nextjs-integration)** — a complete server-to-server example (push-to-talk in the browser, API key never leaves your server).

## Base URL

All REST and WebSocket endpoints are served from the same host, with no path prefix:

```
https://api.wakili.dev
```

Locally (via `docker compose up` from the repo root) the backend listens on `http://localhost:8010`; running the backend directly with `uv run uvicorn app.main:app --reload` it's `http://localhost:8000`.

## Reading these docs

Every page here has a **Copy as Markdown** button — it copies the page's raw Markdown source, ready to paste into an LLM. You can also fetch the raw source directly by appending `.md` to any doc URL, e.g. `https://wakili.dev/docs/quickstart.md` — no HTML, no JS, just the Markdown, so an agent or script can `curl` it directly.
