# Fireworks AI API keys: find, store, rotate, and use them safely with AI agents

Source: https://botpassword.com/keys/fireworks-ai
Last checked: 2026-11-08

Fireworks AI API keys are created in the Fireworks dashboard at `app.fireworks.ai/settings/users/api-keys` with **Create API key**, or with `firectl api-key create`. The key value is shown only at creation and is sent as `Authorization: Bearer $FIREWORKS_API_KEY`. For CI and backend services, Fireworks offers service accounts whose API keys only an Admin can create.

## Key types

| Type | Prefix | Secret | Scope | Expiry |
|---|---|---|---|---|
| User API key | — | Yes | Acts as the user who created it, with that user's role (Admin, User, Contributor or Inference user) in the account | Keys made with `firectl api-key create` expire one year after creation unless `--expire-time` sets an earlier date (at most 365 days) |
| Service account API key | — | Yes | Acts as a non-human service account with the role assigned to it (default `user`) | Same `firectl` expiry rules as user keys |

## How to create a Fireworks AI key

1. Sign in to the Fireworks dashboard.
2. Open `app.fireworks.ai/settings/users/api-keys` and click **Create API key**.
3. Copy the key immediately. Fireworks does not store the key value after creation.
4. Or run `firectl api-key create --key-name "Production Key"`; an Admin can add `--service-account <name>` to create a key for a service account.
5. Set `FIREWORKS_API_KEY` in the environment or secrets manager that runs your code.

## Limiting what the key can do

Fireworks AI API keys carry the role of the user or service account they belong to. Give automation its own service account with the narrowest role, such as **Inference user**, which can run inference but cannot create or modify resources. Set a short `--expire-time` on keys made with `firectl`. Usage is billed at the account level, not per key.

## How to rotate a Fireworks AI key

1. Create a new key with `firectl api-key create` (optionally with `--expire-time`) or in the dashboard.
2. Deploy it wherever `FIREWORKS_API_KEY` is read and confirm requests succeed.
3. Delete the old key with `firectl api-key delete <key-id>`.

## How to revoke a Fireworks AI key

1. Run `firectl api-key delete <key-id>`.
2. Or call `POST /v1/accounts/{account_id}/users/{user_id}/apiKeys:delete` (Delete API Key) with the key ID, which the List API Keys endpoint returns.
3. Users can delete their own keys; only Admins can delete other users' and service accounts' keys.

## If the key leaked

1. Delete the exposed Fireworks AI API key with `firectl api-key delete <key-id>` or the Delete API Key endpoint.
2. Create a replacement, ideally on a service account with a narrow role, and deploy it.
3. Review the account's audit logs and usage for activity you do not recognise.
4. Update every service and CI secret that used the old key.

## Environment variables

- `FIREWORKS_API_KEY`

## Gotchas

- Keys made with `firectl` expire after one year by default, so long-running services need a rotation plan.
- Fireworks shows the key value only once and does not store it.
- Fireworks AI API keys are not in GitHub secret scanning's supported patterns, so a leaked key in a repository will not raise a GitHub alert.

## Using this key with AI agents (BotPassword)

- `run_with`: Runs a command with the key injected as an environment variable or a 0600 temporary file, never on the command line, and redacts the key from the output.
- `http_request`: Makes an authenticated API call after checking the destination against the hosts this key may be sent to. The response comes back with credential-shaped values redacted, and one that holds the key itself is refused.
- `cli_login`: Lets git, Docker, the AWS CLI and kubectl log in through bpw's credential helper, so the token is fetched when the tool needs it and not written into its config. The helper hands the value to the tool, so the grant is always disclosing. Other tools use run_with; OAuth device logins are planned.
- `store_secret`: Saves a value the agent already holds as a new vault item.
- `capture_secret`: Planned, not built yet: will read a newly created key straight from the page or command output into the vault.

## FAQ

### Where do I create a Fireworks AI API key?

Click **Create API key** at `app.fireworks.ai/settings/users/api-keys`, or run `firectl api-key create`.

### What environment variable does Fireworks use?

`FIREWORKS_API_KEY`.

### Do Fireworks AI API keys expire?

Keys created with `firectl api-key create` expire one year after creation by default, and `--expire-time` can set an earlier date within 365 days.

### How do I delete a Fireworks AI API key?

Run `firectl api-key delete <key-id>`, or call the REST API's Delete API Key endpoint with the key ID.

### Should I use a service account for production?

Fireworks service accounts exist for CI/CD pipelines, backend services and automated workflows, so production code does not depend on a person's key. Only an Admin can create their keys.

### Can an AI agent use my Fireworks AI key without seeing it?

Yes, if the key never enters the agent's context. Instead of pasting the key into a chat or leaving it in a `.env` file the agent can read, keep it in a credential broker that injects it into the command or request on the agent's behalf. BotPassword does this with `run_with`, `http_request`, `store_secret`, so the agent gets the result and never the value.

## Sources

- https://docs.fireworks.ai/getting-started/quickstart
- https://docs.fireworks.ai/tools-sdks/firectl/firectl
- https://docs.fireworks.ai/tools-sdks/firectl/commands/api-key-create
- https://docs.fireworks.ai/tools-sdks/firectl/commands/api-key-delete
- https://docs.fireworks.ai/accounts/service-accounts
- https://docs.fireworks.ai/accounts/users
- https://docs.fireworks.ai/api-reference/introduction
- https://docs.fireworks.ai/guides/inference-error-codes
- https://docs.fireworks.ai/api-reference/create-api-key
- https://docs.fireworks.ai/api-reference/list-api-keys
- https://docs.fireworks.ai/api-reference/delete-api-key
- https://docs.github.com/en/code-security/secret-scanning/introduction/supported-secret-scanning-patterns
