Skip to main content

Configuration Reference

OptionTypeDefaultDescription
apiKeystringYour Observ API key (required)
recallbooleanfalseEnable semantic caching
environmentstring"production"Environment tag for filtering
debugbooleanfalseEnable 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",
});

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
});
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",
});
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",
});

Environment Variables

OBSERV_API_KEY=your-observ-api-key
ENVIRONMENT=production

Next Steps