Skip to main content

Going live

Before real users arrive, check each of these.

Secrets and tokens​

  • Project secrets live only on your servers — never in an app or in a repository. See Authentication.
  • Each service or environment has a key of its own, so one can be revoked without stopping the others.
  • User tokens last no longer than your app needs (at most a day), and your backend issues a fresh one when a token expires.
  • When a user leaves your product, your backend revokes their tokens or disables them.

Retries​

  • Creating a session, sending a message and starting a generation each carry an Idempotency-Key, so a retry never does the work twice.
  • 429 rate_limited waits for Retry-After; a 5xx backs off exponentially, with jitter and a cap on attempts.
  • Requests refused for their input (4xx other than 429) are not retried unchanged.

Streams​

  • Event streams reconnect with Last-Event-ID set to the last frame's id — when the connection ends, after at most 10 minutes, and after 45 seconds with nothing received. See Event streams.
  • Every way a task can end is handled: task.completed, task.stopped and task.failed.

Errors​

  • Your code branches on error.code, never on message.
  • Every error is logged with its request_id, and you have it at hand when you report a problem. See Errors.

Limits and credits​

  • Your app expects one task at a time per session (409 session_busy) and the other rate limits.
  • Someone watches the project's balance in the console, and your app tells its users plainly when work is refused with 429 insufficient_credits. See Credits and billing.

Files​

  • An upload is sent in a message or used in a generation within 30 days — an unused one then expires. See Files.

Versions​