Find Your Roboflow API Key
Find your API Key to authenticate with the Roboflow API and Roboflow Inference
You can find your API Key at app.roboflow.com/settings/api
There are two kinds of API key:
Private API Keys: used by Roboflow API and Roboflow Infernece
Public / Publishable API Key: Used by
inference.js, our JavaScript inference SDK
API keys are scoped to a Workspace, which means you must use the API key associated with a workspace to access that Workspace's private projects.

Click "Generate New Key" to issue a new key, or copy a key you have already created.
Be sure to keep your private API key secret. Treat it like a password; it grants the bearer access to your workspace's data and models.
If you ever accidentally expose your key to someone who isn't authorized to access your workspace, click "Roll API Key", which will disable previous API key and create a new one.
Multiple API Keys
Workspaces on Enterprise plans can create multiple API keys, allowing them to isolate environments and instantly revoke access for specific deployments or personnel without disrupting their entire production workflow.

We also offer Scoped API Keys as an Add-on to our Enterprise customers.
Default API Key
When a workspace has several keys, the app still uses one of them for code snippets and common workspace actions (ex: viewing model evaluation results). To choose it, edit a key and check "Set as default API key for this workspace". That key then shows a "Default" badge in the key list. Choosing a default requires the Advanced API Keys feature.
If no key is set as the default, the app falls back to the oldest enabled workspace key, and that key shows an "In Use" badge instead. Check the badge before you disable or revoke a key, so you know which one your workspace actions and billed usage run under.
Use your key with Roboflow Inference
Your API key grants access to the models you have trained on Roboflow, public models on Roboflow Universe, and the hosted inference APIs. There are several ways to supply it when using Roboflow Inference.
Environment variable
The recommended way is to set ROBOFLOW_API_KEY in your environment. In most terminals:
Any command run in that terminal session then has access to the key. See Environment Variables for the other variables the CLI and SDK read.
Python
When using Inference from Python, the key can be passed as a keyword argument:
If the key is set in your environment, you do not have to pass it as an argument: model = get_model(model_id="...").
HTTP request payload
When calling the server directly, pass the key as a URL parameter or as part of the request payload, depending on the route:
Docker
If you run the Inference Server locally in a Docker container, provide the key in the docker run command:
Requests sent to that server can then omit api_key from the request payload.
A self-hosted server does not require an API key by default. Setting one in the container does not restrict who may call the server: see Securing a Self-Hosted Server to enforce authentication.
Last updated
Was this helpful?