Guidelines
API Keys
API Keys
Introduction
Langflow offers an API Key functionality that allows users to access their individual components and flows without going through traditional login authentication. The API Key is a user-specific token that can be included in the request's header or query parameter to authenticate API calls. The following documentation outlines how to generate, use, and manage these API Keys in Langflow.
Generating an API Key
Through Langflow UI

Click on the "API Key" icon.
Click on "Create new secret key".
Give it an optional name.
Click on "Create secret key".
Copy the API key and store it in a secure location.
Using the API Key
Using the x-api-key
Header
Include the x-api-key
in the HTTP header when making API requests:
With Python using requests
:
Using the Query Parameter
Alternatively, you can include the API key as a query parameter in the URL:
Or with Python:
Security Considerations
Visibility: The API key won't be retrievable again through the UI for security reasons.
Scope: The key only allows access to the flows and components of the specific user to whom it was issued.
Revoking an API Key
To revoke an API key, simply delete it from the UI. This will immediately invalidate the key and prevent it from being used again.