Configuration Reference
| Option | Type | Default | Description |
|---|
apiKey | string | — | Your Observ API key (required) |
recall | boolean | false | Enable semantic caching |
environment | string | "production" | Environment tag for filtering |
debug | boolean | false | Enable debug logging (TypeScript only) |
Option Details
apiKey
Required - Your Observ API key for authentication and tracing.
Get your API key from Settings → API Keys.
const ob = new Observ({
apiKey: "your-observ-api-key",
});
ob = Observ(
api_key="your-observ-api-key",
)
recall
Intelligently cache similar prompts and reduce costs in a few lines of code.
When enabled, Observ analyzes the semantic meaning of prompts and returns cached responses for similar requests, even if the exact wording differs.
const ob = new Observ({
apiKey: "your-observ-api-key",
recall: true, // Enable semantic caching
});
ob = Observ(
api_key="your-observ-api-key",
recall=True, # Enable semantic caching
)
Semantic caching can reduce costs by up to 85% on similar prompts. It’s
especially effective for: - Customer support chatbots - FAQ systems - Repeated
queries with slight variations
environment
Tag traces with an environment identifier for filtering in the dashboard.
Useful for separating production, staging, development, and test traces.
const ob = new Observ({
apiKey: "your-observ-api-key",
environment: "staging",
});
ob = Observ(
api_key="your-observ-api-key",
environment="staging",
)
Common values: "production", "staging", "development", "test"
debug
TypeScript only - This option is not available in the Python SDK.
Enable detailed logging for debugging integration issues.
const ob = new Observ({
apiKey: "your-observ-api-key",
debug: true, // Enable debug logging
});
Debug mode logs:
- API calls to Observ servers
- Caching hits/misses
- Tracing events
- Error details
Complete Example
import Observ from "observ-sdk";
const ob = new Observ({
apiKey: process.env.OBSERV_API_KEY,
recall: true,
environment: process.env.NODE_ENV || "development",
debug: process.env.NODE_ENV === "development",
});
import os
from observ import Observ
ob = Observ(
api_key=os.getenv("OBSERV_API_KEY"),
recall=True,
environment=os.getenv("ENVIRONMENT", "development"),
)
Environment Variables
OBSERV_API_KEY=your-observ-api-key
ENVIRONMENT=production
import Observ from "observ-sdk";
const ob = new Observ({
apiKey: process.env.OBSERV_API_KEY,
environment: process.env.ENVIRONMENT,
});
import os
from observ import Observ
ob = Observ(
api_key=os.getenv("OBSERV_API_KEY"),
environment=os.getenv("ENVIRONMENT"),
)
Next Steps