Langbase API Keys for users and organizations
The Langbase API uses API keys for authentication. You can create API keys at a user or org account level.
Table of contents
Get your Langbase API key
You can generate API keys from the Langbase studio by following these steps:
- Switch to your user or org account.
- From the sidebar, click on the
Settings
menu. - In the developer settings section, click on the
Langbase API keys
link. - From here you can create a new API key or manage existing ones.
For more details read the docs below.
All API requests should include your API key in an Authorization HTTP header as follows:
Authorization: Bearer LANGBASE_API_KEY
With Langbase SDK, you can set your API key as follows:
import {Langbase} from 'langbase';
const langbase = new Langbase({
apiKey: process.env.LANGBASE_API_KEY
});
Org API Key
Get an API key for your organization on Langbase.
Step #1 Go to organization settings
Login to your account on Langbase.
- Navigate to your organization profile page.
- Click on the
Settings
button and select 'Langbase API Keys'.

Step #2 Org API Keys section
- In the
Org API Keys
section, click on theGenerate API Key
button.

Step #3 Generate a new API key
- Give your org API key a name. Let's call it
Org API Key
. - Click on
Generate API Key
button to generate the API key.

Step #4 Copy the API Key
- Use the
Copy
button to copy your org API key. - Click on the
Done
button to close the modal.

User API Key
Get an API key for your user account on Langbase.
Step #1 Go to profile settings
Login to your account on Langbase.
- Navigate to your profile
Settings
page. - Select 'Langbase API Keys'

Step #2 User API Keys section
- In the
User API Keys
section, click on theGenerate API Key
button.

Step #3 Generate a new API key
- Give your user API key a name. Let's call it
API Key
. - Click on
Generate API Key
button to generate the API key.

Step #4 Copy the API Key
- Use the
Copy
button to copy your user API key. - Click on the
Done
button to close the modal.

✨ Congrats, you have created your first API key. We're excited to see what you build with it.