An admin needs to create the API key and share the agent with the API key. Invite an admin as an editor to your agent with the “Share” button in the top right corner (skip this step if you are a Langdock admin yourself).
How to create an API key
-
Navigate to Langdock.
-
Navigate to the workspace settings.
-
Click on “API” under products.
-
Create a new API key.
-
Enter a name and click “Create API key”
-
Copy your API Key to the clipboard.
-
Click “Done”
-
Leave the settings by clicking on “Settings” on the top left.
How to share an agent with the API key
-
Click “Agents”
-
Create a new agent
-
Configure your agent. To save it, at least enter a name.
-
Click “Share”
Only admins can connect an agent with an API key. To find the API key in the “Share” menu, you have to be an admin or ask an admin to perform steps 13 and 14 for you.
-
Search for the name of your API key.
-
Click “Share”
- Navigate to docs.langdock.com.
-
Click “Agent API”
-
Click “Try it”
-
Enter the API Key from your clipboard
-
Navigate back to the Langdock application and copy the Agent ID from the URL. The URL is structured as follows:
https://app.langdock.com/agents/AGENT_ID/edit. You only need the AGENT_ID.
- Switch to tab Agent API - Documentation”
-
Enter the Agent ID
-
Add a message with a content and the role “user”
-
Click “Send”. You should receive a response from the Agent API with the status code 200. If your API Key is invalid, the status code will be 401.
Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on API Key Best Practices.