This guide will walk you through the process of creating, managing, and using secrets in your Julep applications. Secrets provide a secure way to store and use sensitive information like API keys, credentials, and tokens without exposing them in your code or configuration files.
# Create a new secretjulep secrets create --name "openai_api_key" --value "sk-..." --description "OpenAI API key for production"# List all secretsjulep secrets list# Get a specific secretjulep secrets get openai_api_key
from julep import Julepclient = Julep(api_key="your_api_key")# Create a secretclient.secrets.create( name="openai_api_key", value="sk-...", description="OpenAI API key for production")# List all secretssecrets = client.secrets.list()for secret in secrets.items: print(f"{secret.name}: {secret.description}")
steps: - kind: tool_call tool: email operation: send arguments: to: "recipient@example.com" subject: "Hello from Julep" body: "This is a test email sent from Julep." secrets: service_api_key: "email_service_api_key" sender_address: "email_sender_address"
Julep can automatically use developer secrets for LLM API keys based on the provider:
Copy
# Store the API key as a secretclient.secrets.create( name="OPENAI_API_KEY", value="sk-...")# The key will be automatically used for OpenAI requeststask = client.tasks.create({ "steps": [ { "kind": "prompt", "model": "gpt-4", "prompt": "Generate a story about space exploration." } ]})