Secrets

In Langtail, the “Secrets” section allows you to manage your API keys and Environment Variables, ensuring secure access to your language models and providing a centralized location for configuring global settings.

API Keys

API keys are used to authenticate your application with Langtail and enable secure communication with the platform’s APIs. In the API Keys section, you can create, manage, and revoke API keys as needed.

Creating a New API Key

1

Click the “New API Key” button in the API Keys section.

2

A modal will appear, prompting you to provide a name for the new API key.

3

Optional Step

Set budget limits for total requests and/or requests per individual user. This feature helps prevent overspending and protects against malicious or accidental misuse.

4

Click “Create” to generate the new API key.

For security reasons, API keys are only displayed once during creation. Make sure to copy and store the key securely, as it won’t be shown again.

Managing API Keys

In the API Keys section, you can view a list of all your existing API keys, including their names, creation dates, and any configured budget limits. From here, you can revoke API keys that are no longer needed or have been compromised.

It’s a good practice to create separate API keys for different environments (e.g., development, staging, production) and revoke them when they’re no longer needed.

Environment Variables

Environment Variables are global variables that can be accessed and used throughout your Langtail project. Unlike Prompt Variables, which are specific to individual prompts, Environment Variables are project-wide and can be useful for various purposes, such as testing, custom code assertions, or sharing common values across multiple prompts.

Managing Environment Variables

1

Switch to the “Env Variables” tab in the top navigation of the Secrets section.

2

You’ll see a list of all existing Environment Variables, along with their names and values.

3

To create a new Environment Variable, click the “New Variable” button and provide a name and value.

4

To edit an existing Environment Variable, click on the Edit and update the value as needed.

5

To delete an Environment Variable, click the delete next to the variable you want to remove.

By leveraging the Secrets section in Langtail, you can securely manage API keys and Environment Variables, ensuring proper access control and configuration management for your language models and applications.