# Test mode

Keys starting with `sk-test-` run in test mode. Use them for development, CI and demos.

## What test keys do

- Return **deterministic sample payloads** with the same shape as live responses.
- Add the header `Talksign-Test-Mode: true` and `usage.test_mode: true`.
- Validate input like live keys: missing `text` → `400 missing_parameter`, unknown `model` →
  `400 unknown_model`, coming-soon avatars → `409 avatar_coming_soon`.
- Simulate errors with **magic inputs**: any string field containing `__error_402` answers
  `402 insufficient_credits`, `__error_422` answers `422 invalid_request`; in a job,
  `__job_fail` gives a job that has already failed.
- Count in a separate **test** usage view in the portal (cost always $0).

## What test keys never do

- Never call an AI engine.
- Never charge the wallet or a card (`usage.costUsd: 0`, `walletRemainingUsd: null`).
- Never create real avatars or avatar slots.

## Per endpoint

| Endpoint | Test-mode response |
|---|---|
| `GET /models` | The model list. |
| `POST /speech-to-sign/realtime` (and `/speech-to-sign`) | Sample playlist from the words of `text`, with `in_url`/`out_url`/active range, all optional playlist fields (`null`), `idle: null` and `expires_at` (sample links last 1 hour). |
| `POST /speech-to-sign/studio` | A `req_test_…` id; its `video_url` redirects (302) to a sample clip. |
| `POST /speech-to-sign/gloss` | Uppercase content words of `text` as gloss. |
| `GET /avatars`, `GET /avatars/{id}` | Sample preset avatars. |
| `POST /avatars` | A sample avatar; nothing stored. |
| `POST /avatars/validate` | A sample passing result (`sample: true`). |
| `DELETE /avatars/{id}` | Sample success. |
| `POST /speech-to-speech` | A sample translation. |
| `POST /sign-to-speech` | `501 not_available`, like live. |
| `POST /jobs` | A finished sample job (`livemode: false`, `status: succeeded`, sample `result`); `GET /jobs/{id}` returns it. Test-key jobs are listed only for test keys. |
| `POST /speech-to-sign/studio?async=true` | The synchronous sample studio response. |
| `POST /uploads` | A sample upload id and link (nothing is stored). |
| `POST /meetings`, `GET /meetings/{id}`, `POST /meetings/{id}/stop` | A sample meeting (id `000000000000000000000000`); no interpreter joins. |
| `POST /voice` | A short silent MP3 (or JSON), cost $0. |
| `POST /speech-to-sign/realtime` with `audio` | A sample playlist for a fixed sample transcript. |
| `GET /jobs`, `GET /usage`, `GET /balance` | Your account's real (free) data. |

The same input always gives the same output (sample clip links carry a short-lived
token, so the token part of URLs changes).

## Limits

Test keys are capped at **10 requests/min** and **20 active test keys per account**. They
are not for production traffic.
