# Go-live checklist

A short list to run through before you send real traffic. Each item is one line, with a link to the page that explains it.

## Keys

- Call the API from your server only. A key in a browser or a mobile app can be read by anyone.
- Keep each key in an environment variable or a secret store, never in source code or a committed file.
- Use one key per app or environment, so you can revoke one without touching the rest.
- Narrow each production key: an IP allowlist, the models it may use and a spend limit. See [Key controls](https://docs.vidlab.ai/authentication#key-controls).

## Requests

- Send an `Idempotency-Key` with every submit. A retry with the same key returns the same generation and never charges twice. See [Idempotency](https://docs.vidlab.ai/rate-limits#idempotency).
- Treat a failed generation as final. To try again, send the request with a new key.
- Quote the request first and pass the quote as `max_cost_usd`, so a call never costs more than the listed price. See [Price it first](https://docs.vidlab.ai/price-it-first).
- Send only the fields the model lists. A field the model does not take is refused, never ignored. See [Input fields](https://docs.vidlab.ai/input-fields).

## Results

- Wait with `GET /v1/generations/{id}?wait=60` in a loop, or send `webhook_url`. Reading a generation is free and never rate limited.
- A webhook carries the id and the status only. Read the generation with your key before you act on it.
- Never start a second generation while the first is `queued` or `running`. A second one is a second charge.
- Download the files as soon as a job succeeds, and copy the ones you want to keep to your own storage. The links in `outputs[].url` last 6 hours and the files are kept for 30 days. See [Get the result](https://docs.vidlab.ai/get-the-result).

## Errors and limits

- On `429 rate_limited`, wait for the `Retry-After` and send the request again. Excess requests are not queued. See [Rate limits](https://docs.vidlab.ai/rate-limits).
- On `429 api_wallet_exhausted`, the balance has no room for the request: add credit, or wait for running generations to finish.
- When a generation fails, read its `error`. It is never charged. See [Why a generation failed](https://docs.vidlab.ai/why-a-generation-failed) and [Errors](https://docs.vidlab.ai/errors).

## Billing

- Turn on auto-reload, with a monthly cap, so long jobs never stop for an empty balance. See [Billing](https://docs.vidlab.ai/billing#auto-reload).
- Watch what you can spend with [`GET /v1/balance`](https://docs.vidlab.ai/balance), or read `x-wallet-remaining-cents` on any generation answer.

## Status

- Each model carries its status in `GET /v1/models`. See [Model list](https://docs.vidlab.ai/model-list).
- Check the [status page](https://vidlab.ai/status) when something looks wrong.
