Identical surface area to the official OpenAI and Anthropic SDKs. Failover, semantic caching, PII masking, and cost tracking are wired in automatically.
installnpm install @tokenlens/sdk
typescriptimport { TokenLensOpenAI } from "@tokenlens/sdk"; const client = new TokenLensOpenAI({ apiKey: process.env.TOKENLENS_KEY }); // Behaves identically to the official OpenAI SDK const res = await client.chat.completions.create({ model: "gpt-5.5", messages: [{ role: "user", content: "Summarize this contract..." }], }); // Automatic: failover, semantic cache, PII masking, cost tracking
Provision gateway keys, budgets, regional restrictions, and PII firewalls directly from your existing Terraform stack. Plug into CI/CD with zero context switching.
hclterraform { required_providers { tokenlens = { source = "tokenlens-ai/tokenlens" version = "~> 1.0" } } } provider "tokenlens" { admin_token = var.tokenlens_admin_token # from your secret manager } resource "tokenlens_gateway_key" "finance_team" { name = "finance-prod-key" daily_budget_usd = 250.00 monthly_budget_usd = 5000.00 region_restriction = "eu" # eu | us | global pii_firewall = true semantic_cache = true } output "finance_key" { value = tokenlens_gateway_key.finance_team.plaintext sensitive = true }
Everything in the dashboard, available as a clean REST API. Powers the Terraform provider, the Helm operator, and your own internal automation.
/api/public/v1/admin/keys/api/public/v1/admin/keys/api/public/v1/admin/keys/{id}/api/public/v1/admin/keys/{id}/api/public/v1/models/api/public/v1/chat/completions/api/public/v1/messagescurlcurl https://tokenlens.co.in/api/public/v1/admin/keys \ -H "Authorization: Bearer tlsk_admin_..." \ -H "Content-Type: application/json" \ -d '{ "name": "finance-prod", "daily_budget_usd": 250, "region_restriction": "eu", "pii_redaction_enabled": true }'
The proxy gateway, Inngest workflow engine, and PII regex library are Apache 2.0. Multi-tenant RBAC, forecasting analytics, and SAML SSO ship with the Enterprise tier.
Talk to Navin directly. We pair with platform teams during onboarding.