TheFluxTrain

API keys

Create and use API keys for the REST API and CLI.

An API key ties requests to your TheFluxTrain account. Generations, folders, and Flow Studio data created through the API belong to you, the same as when you use the website.

Create a key

  1. Sign in at TheFluxTrain.
  2. Open Account → API keys (/account/api-keys).
  3. Optionally set a name and expiry, then click Create API key.
  4. Copy the secret right away — it is only shown once.

Revoked or expired keys return 403 Unauthorised.

Keys can only be created or revoked while you are signed in on the website. The API itself does not create new keys.

Use a key in API requests

Send your key on every request in the x-api-key header:

x-api-key: YOUR_API_KEY

Full URL example:

POST https://api.thefluxtrain.com/api/v1/image-generate/generate
x-api-key: YOUR_API_KEY
Content-Type: application/json

See Authentication for details and error handling.

CLI

For terminal use, prefer CLI sign-in (tft login). The CLI creates and stores an API key for you after you authorize at thefluxtrain.com/cli/authorize. You can still create keys manually here for other integrations.

Security

  • Treat keys like passwords — do not publish them, embed them in public front-end code, or commit them to public repositories.
  • Use separate keys for different apps or environments (for example one key for production and one for testing), and set expiries when you can.
  • Revoke keys you no longer need from the API keys page.