Authentication
Updated
The Chaos AI SDK supports two environments: Production and Staging. By default, you should use production credentials for stable, reliable access.
Environments
| Environment | URL | Use Case |
|---|---|---|
| Production | https://ai.chaoslabs.co | Default, stable API |
| Staging | https://ai-staging.chaoslabs.co | Experimental features |
Production (Default)
Production is the default environment. It provides stable, reliable access to the Chaos AI API.
# Production credentials (default)
CHAOS_API_KEY=ck-your-production-api-keyCopy code
Open in Cursor
Open in VS Code
Open in v0
Open in Claude
Open in ChatGPT
import { Chaos } from '@chaoslabs/ai-sdk';
const chaos = new Chaos({
apiKey: process.env.CHAOS_API_KEY!,
// No baseUrl needed - defaults to production
});Copy code
Open in Cursor
Open in VS Code
Open in v0
Open in Claude
Open in ChatGPT
Staging (Experimental)
Staging is our experimentation environment. It has the latest features and improvements, but may also be more prone to errors or breaking changes.
Only use staging if Chaos Labs specifically directs you to test new features. For normal usage, stick with production.
# Staging credentials (experimental)
CHAOS_API_KEY=ck-your-staging-api-key
CHAOS_BASE_URL=https://ai-staging.chaoslabs.coCopy code
Open in Cursor
Open in VS Code
Open in v0
Open in Claude
Open in ChatGPT
import { Chaos } from '@chaoslabs/ai-sdk';
const chaos = new Chaos({
apiKey: process.env.CHAOS_API_KEY!,
baseUrl: process.env.CHAOS_BASE_URL || 'https://ai-staging.chaoslabs.co',
});Copy code
Open in Cursor
Open in VS Code
Open in v0
Open in Claude
Open in ChatGPT
When to Use Each Environment
| Scenario | Environment |
|---|---|
| Building production applications | Production |
| Normal development and testing | Production |
| Testing new features at Chaos Labs' direction | Staging |
| Evaluating upcoming API changes | Staging |
Getting Credentials
Contact support@chaoslabs.co to request API credentials. Specify whether you need access to production, staging, or both environments.
Related Pages
Was this helpful?