Flux logo
Flux
Docs
Concepts

Concepts

Keys and authentication

Create an API key, send it with each request, and keep it out of your code.

1 min read · Updated 20 Nov 2026
On this page

Every request to the Flux API carries an API key in the Authorization header. The key decides which workspace's balance pays for the request.

Create a key

Open API keys in the Flux app and choose a name. The key is shown once, when you create it. Flux stores only a hash, so if you lose it, create another.

There are two kinds:

  • user_sk_... keys draw on your personal workspace's balance.
  • org_sk_... keys draw on a team workspace's balance, so a team's usage is billed together.

Send it

Use the Bearer scheme. Keep the key in an environment variable:

export FLUX_API_KEY="<your key>"
$env:FLUX_API_KEY = "<your key>"
curl https://fluxsearch.io/api/v1/account \  -H "Authorization: Bearer $FLUX_API_KEY"
import osimport requestsresponse = requests.get(    "https://fluxsearch.io/api/v1/account",    headers={"Authorization": f"Bearer {os.environ['FLUX_API_KEY']}"},)response.raise_for_status()print(response.json()["balance"]["usd"])
const response = await fetch("https://fluxsearch.io/api/v1/account", {  headers: { Authorization: `Bearer ${process.env.FLUX_API_KEY}` },});if (!response.ok) throw new Error(`Flux responded ${response.status}`);const { balance } = await response.json();console.log(balance.usd);

GET /account is free, so it is a safe way to check a key works. A wrong or revoked key returns 401 unauthorized.

Keep it safe

  • Never put a key in code you commit, in a browser bundle, or in a mobile app. Call Flux from your server.
  • Use a separate key for each app or environment, so you can revoke one without stopping the others.
  • Revoke a key from the same page you created it. It stops working within a minute.

Next steps