Sharing Assistants with API Keys

An admin needs to create the API key and share the assistant with the API key. Invite an admin as an editor to your assistant 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

1

Navigate to your Langdock workspace: https://app.langdock.com/chat

Get to settings
2

Go to the workspace settings.

Get to Workspace Settings
3

Click on “API” under products.

Go to API Settings
4

Create a new API key.

Create new Key
5

Enter a name for the key and click “Create API key”.

Copy to clipboard
6

Copy your API Key to the clipboard.

Click on Done
7

Click “Done” to finish.

Click on Done
8

Leave the settings by clicking on “Settings” on the top left.

Leave Settings

How to share an assistant with the API key

Only admins can connect an assistant 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 the relevant steps for you.

1

Click “Assistants” in the Langdock app.

Go to Assistants
2

Create a new assistant (if needed).

Create new Assistant
3

Configure your assistant. To save it, at least enter a name.

Configure your assistant
4

Click “Share” for the assistant.

Click on the "Share" button
5

Search for the name of your API key in the Share dialog.

Search for your API Key
6

Click “Share” next to the API key entry.

Click on "Share"
7

Open the Assistant API documentation at https://docs.langdock.com/ and click “Assistant API” then “Try it”.

Click "Assistant API"
Click "Try it"
8

In the API docs “Try it” panel, paste the API Key you copied earlier.

ter the API Key from your clipboard
9

Switch back to the Langdock application and copy the Assistant ID from the URL. The assistant edit URL is structured like: https://app.langdock.com/assistants/ASSISTANT_ID/edit You only need the ASSISTANT_ID.

vigate back to the Langdock application and copy the Assistant ID
10

Return to the Assistant API documentation “Try it” panel and enter the Assistant ID.

Enter the Assistant ID
11

Add a message object with content and the role set to "user" in the request body.

Add a message with a content and the role "user"
12

Click “Send”. You should receive a response from the Assistant API with status code 200 if successful. If your API Key is invalid, the status code will be 401.

Click "Send"

Additional images from the original guide:

Get to settings
Get to Workspace Settings
Go to API Settings
Create new Key
Copy to clipboard
Click on Done
Click on Done
Leave Settings
Go to Assistants
Create new Assistant
Configure your assistant
Click on the "Share" button
Search for your API Key
Click on "Share"
Click "Assistant API"
Click "Try it"
ter the API Key from your clipboard
vigate back to the Langdock application and copy the Assistant ID
Enter the Assistant ID
Add a message with a content and the role "user"
Click "Send"