Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@tessera-llm/sdk

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tessera-llm/sdk

Tessera SDK — drop-in LLM cost optimization. One line patches OpenAI, Anthropic, Mistral, Groq, Cohere clients to route through Tessera's auto-route + auto-cache + auto-compress + auto-batch proxy. Free 60M tokens/mo. Production: 20% of measured savings,

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

@tessera-llm/sdk

npm version Node

Drop-in cost optimization for LLM applications. One line of code patches your existing OpenAI / Anthropic / Mistral / DeepSeek / Groq / Together / Fireworks / OpenRouter / Perplexity / Cerebras / xAI client to route through Tessera's measurement + auto-optimize proxy. You keep your provider account and keys; we route + cache + compress and measure savings on every request.

Free Dev tier: 60M tokens / month · no card required · no fee until you upgrade. Get your free key at tesseraai.io/dev.

Get a free API key

Get free key (email + ToS, 30 seconds, no card)

After signup you get:

  • Your tk_ API key (shown once)
  • A magic-link for the dashboard — see your token counter + savings counter live
  • 60M tokens/month at 30 req/min — generous for hobby + side projects

Install

npm install @tessera-llm/sdk
# or: pnpm add @tessera-llm/sdk
# or: yarn add @tessera-llm/sdk

One-line setup

Drop this at the top of your application's entry point (server.ts, app.ts, index.ts, wherever your app boots — before any LLM SDK client is constructed):

import { activate } from "@tessera-llm/sdk";

activate("tk_your_tessera_key");

That's it. Your existing code runs unchanged — new OpenAI(), new Anthropic(), and other supported SDK constructors are transparently patched to route through Tessera. Your provider keys (OpenAI sk-..., Anthropic sk-ant-..., etc.) stay in your environment as before; Tessera forwards them upstream untouched.

Environment variable form

If you'd rather not put the key in code:

export TESSERA_KEY=tk_your_tessera_key
import { activate } from "@tessera-llm/sdk";
activate(); // reads TESSERA_KEY from process.env

What gets patched

Calling activate(...) patches the following SDKs at load time (each is opt-in: only patched if the library is installed as a peer dependency):

SDKTessera route
openaihttps://api.tesseraai.io/v1/openai
@anthropic-ai/sdkhttps://api.tesseraai.io/v1/anthropic
@mistralai/mistralaihttps://api.tesseraai.io/v1/mistral
groq-sdkhttps://api.tesseraai.io/v1/groq
cohere-aihttps://api.tesseraai.io/v1/cohere (Wave 2)

If you use a framework that wraps these SDKs (LangChain.js, LlamaIndex.TS, Vercel AI SDK, Mastra, etc.), the patch applies transparently because those frameworks call the underlying SDK constructors which are what we patched.

Direct provider URLs

If you call providers that aren't covered by an official Node SDK (DeepSeek, Together, Fireworks, OpenRouter, Perplexity, Cerebras, xAI), construct an OpenAI client manually with the matching Tessera URL:

import OpenAI from "openai";
import { url, headers } from "@tessera-llm/sdk";

// DeepSeek via Tessera
const client = new OpenAI({
  apiKey: process.env.DEEPSEEK_API_KEY,
  baseURL: url("deepseek"),       // → https://api.tesseraai.io/v1/deepseek
  defaultHeaders: headers(),
});

// Same pattern for: together, fireworks, openrouter, perplexity, cerebras, groq, xai

url(provider) and headers() are pure helpers — no globals, no patching. Use them when you want explicit, traceable wiring.

Verification

import { activate, isActive, status } from "@tessera-llm/sdk";

activate("tk_...");

console.log(isActive());  // → true
console.log(status());
// → { active: true, providersPatched: ['openai', 'anthropic'], proxyBase: 'https://api.tesseraai.io/v1', featureTag: null }

Deactivation

To restore the original SDK constructors (e.g. in test teardown):

import { deactivate } from "@tessera-llm/sdk";
deactivate();

Configuration

activate("tk_...", {
  proxyBase: "https://api.tesseraai.io/v1",  // default; override for staging/dev
  featureTag: "checkout-summarizer",         // attaches X-Tessera-Feature-Tag to every request
});

featureTag lets you split savings reporting per workload (e.g. one tag per logical feature in your app). You can also set per-request tags by passing extra_body: { tessera_feature_tag: "..." } on individual SDK calls.

Pricing

Two tiers:

Free DevProduction
Token throughput60M / monthUnlimited
Rate limit30 req / min60 req / min
Performance fee$020% of measured savings · $0 if none
Balance managementStripe top-ups ($100 min)
Monthly Reading PDFAudit-grade ledger
Anomaly responseObserve onlyTier 1 throttle + Tier 2 halt
Team seatsUp to 5

Zero savings = zero fee. Even on Production, if our optimization doesn't save you anything in a period, you pay nothing for that period.

Kill-switch available anytime from your portal — pauses optimization, traffic still flows passthrough.

Full terms: https://tesseraai.io/terms · Upgrade flow: https://ledger.tesseraai.io/portal/upgrade

License

Apache-2.0

Keywords

tessera

FAQs

Package last updated on 18 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts