Find Your Roboflow API Key
To use the Roboflow API, SDKs, or CLI tools, you need an API key. Your API key authenticates your requests and associates them with your workspace.
Retrieve Your API Key
- Log in to Roboflow.
- Click Settings in the left sidebar.
- Navigate to the Roboflow API section.
- Copy your Private API Key.
Warning
Keep your API key secret. Do not share it in public repositories or client-side code.
Use Your API Key
You can provide your API key in several ways:
Environment Variable
Set the ROBOFLOW_API_KEY environment variable:
export ROBOFLOW_API_KEY=your_api_key_here
Directly in Code
Pass the API key directly when initializing an SDK client:
from inference_sdk import InferenceHTTPClient
client = InferenceHTTPClient(
api_url="https://serverless.roboflow.com",
api_key="your_api_key_here",
)
As a Query Parameter
When using the REST API, pass your API key as a query parameter:
https://api.roboflow.com/your-workspace?api_key=your_api_key_here