API reference
API overview
Base URLs, authentication, conventions and limits that apply to every Aniwaffle v1 endpoint.
Base URLs
| Region | HTTP | WebSocket |
|---|---|---|
| United States (default) | https://aniwaffle.com | wss://aniwaffle.com/v1/tts/stream |
| Japan | https://jp.aniwaffle.com | wss://jp.aniwaffle.com/v1/tts/stream |
Choose the region closest to your servers. The hostname selects the region; there is no region field. API keys, voice IDs and credits work in both regions. In Japan, Waffle Mono Flash runs in the Japan region, which keeps realtime first audio short for listeners there.
Note: The region decides where requests are processed for latency. It does not change where your workspace data is stored.
Authentication
Send a workspace API key as a bearer token on every request, including the WebSocket handshake:
Authorization: Bearer awp_...Browser and mobile clients connect to the streaming endpoint with a short-lived stream token instead. See Authentication.
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /v1/voices | List the voices your key can use. |
GET | /v1/models | List the models served by this host. |
POST | /v1/tts | Generate speech from complete text and return the audio. |
WSS | /v1/tts/stream | Stream text in and audio out over a WebSocket. |
POST | /v1/tts/stream-tokens | Create a short-lived token for client-side streaming. |
POST | /v1/tts/jobs | Submit long text as a background job. |
GET | /v1/tts/jobs/{id} | Get a job's status. |
GET | /v1/tts/jobs/{id}/audio | Download a completed job's audio. |
POST | /v1/audio/speech | Generate speech from an OpenAI-compatible request. |
Requests and responses
- JSON bodies. Send request bodies as JSON with
Content-Type: application/json. Unknown fields are rejected with400 invalid_request, so typos surface immediately. - Audio responses. Successful speech responses return audio bytes, not JSON. Read the format from the
X-Audio-Formatheader. - Errors. Failed requests return a JSON error with a stable
codeand aretryableflag. See Errors. - Request IDs. Every speech response includes an
X-Request-Idheader, and every streaming event includesrequest_id. Log it and include it when you contact support.
Idempotency
POST /v1/tts accepts an optional Idempotency-Key header, and POST /v1/tts/jobs requires one. Keys are 1–200 characters.
Retrying with the same key and the same body within 24 hours returns the original result without generating or charging again. The same key with a different body returns 409 idempotency_conflict. Use a new key for every new request.
Limits
| Limit | Value |
|---|---|
| Concurrent Playground and API generations (shared per workspace in each region) | 3 by default during early access, 10 after the first successful top-up |
| Text per request (one-shot, stream or job), including tags | 500 characters by default during early access, 20,000 after the first successful top-up |
Text per streaming text event | 5,000 characters |
| Streaming control message size | 64 KiB |
| Stream token lifetime | 2 minutes |
| Queued or running jobs per workspace | 20 |
| Job and idempotent result retention | 24 hours |
When a capacity limit is reached, requests return 429 rate_limited. Retry after Retry-After when present, otherwise after a backoff.
Usage and billing
For workspaces on audio-time billing, Waffle speech is billed by the duration of audio delivered, including pauses. Early-access rates are in USD per audio hour.
| Model | Standard | Real-Time |
|---|---|---|
| Waffle Mono Flash | $0.20 | $0.24 |
| Waffle Mono | $0.40 | $0.48 |
| Waffle Stereo | $1.60 | $1.92 |
Playground uses standard pricing. Developer WebSocket requests and HTTP requests (including jobs) with "realtime": true cost 1.2× the standard rate. If generation stops early, only audio already delivered is billable. Replaying an idempotent result or downloading a completed job is free.
Credits and top-ups
Your first personal workspace gets two separate allowances, each worth 20 minutes of standard Flash: monthly Playground TTS credits and One-time API credits. At standard rates, each allowance covers 10 minutes of Mono or 2.5 minutes of Stereo. Each surface uses its own free credits first, then draws from the workspace’s shared paid USD balance.
The Studio balance ring shows the percentage of Playground credits left. Once they run out, it shows the percentage of the paid balance remaining since your last top-up. Open it for the exact balance and API allowance. Owners and Admins can add credits in Billing. Where refunds are available, select a top-up in Payment history to request all or part of its unused paid balance within 90 days. All requests are reviewed. After 90 days you can request an exception. Paid credits do not expire.
Workspaces still showing character credits in Billing use the earlier pricing: 1, 2 or 8 credits per input character for Flash, Mono or Stereo respectively. Real-Time applies the same 1.2× multiplier, rounded up once per request.
Versioning
The API version is part of the path (/v1). Every change to the v1 contract is listed in the changelog. New response fields, events and error codes can be added at any time, so ignore fields you don't recognize and treat unknown error codes by their retryable flag.