Skip to main content

Authentication

Claro uses API keys to authenticate requests. API keys are workspace-scoped and can be managed from your workspace settings.

Creating an API Key

1

Navigate to API Keys

Log into Claro and click API Keys from the sidebar
2

Create New API Key

Click Create API Key and provide a descriptive name:
  • Development - For local development
  • Production - For production deployments
  • CI/CD - For automated testing and deployments
3

Save Your Key Securely

Copy the API key immediately - it will only be shown once
Store your API key securely. Never commit it to version control or share it publicly.

Using API Keys

Store API keys in environment variables:
Then in your code:

.env Files (Development)

For local development, use a .env file:
.env
Load it with python-dotenv:
Add .env to your .gitignore to prevent accidentally committing secrets
You can pass the API key directly, but this is not recommended for production:

API Key Permissions

API keys have the following permissions by default:
  • prompts:read - Read prompts and their versions
  • prompts:list - List all prompts in the workspace
  • context:download - Download attached context files
API keys inherit the permissions of the user who created them. If you need different permissions, create the key from a user account with the appropriate access level.

REST API Authentication

When using the REST API directly, include your API key in the Authorization header:

Security Best Practices

Rotate your API keys every 90 days or immediately if compromised:
  1. Create a new API key
  2. Update your applications with the new key
  3. Delete the old API key
Create different API keys for each environment:
  • Development keys for local testing
  • Staging keys for pre-production
  • Production keys for live applications
This allows you to revoke compromised keys without affecting other environments.
Check your API key usage regularly in Settings → Security:
  • Last used timestamp
  • Request count
  • Error rates
Unusual activity may indicate a compromised key.
Follow the principle of least privilege:
  • Only give API keys to services that need them
  • Create keys from service accounts, not personal accounts
  • Delete unused API keys immediately

Troubleshooting

Invalid API Key Error

Common causes:
  • API key not set or set incorrectly
  • Extra spaces or quotes around the key
  • API key was deleted or revoked
  • Using a key from a different workspace
Solution:

Permission Denied Error

Solution:
  • Verify the user who created the API key has the necessary permissions
  • Check workspace membership and roles
  • Create a new API key from an account with appropriate access

API Key Lifecycle

1

Creation

API keys are created in workspace security settings
2

Active

Keys remain active until explicitly revoked or deleted
3

Revocation

Revoked keys immediately stop working across all applications
There is no automatic expiration for API keys. Implement your own rotation policy based on your security requirements.

Next Steps

Python SDK

Install and configure the Python SDK with your API key

API Reference

Learn about REST API endpoints and authentication