Getting Started

TypoMonster Chat is an LLM orchestration layer that routes your AI requests through a centralized proxy. Use a single API key to access multiple providers, track usage, and manage rate limits — all without changing your existing code.

How It Works

  1. Create an API key on the API Keys page
  2. Install the SDK for your provider
  3. Swap the import — your existing code stays the same

The proxy sits between your app and the AI provider. It authenticates requests with your TypoMonster key, forwards them to the upstream provider, and logs usage to your analytics dashboard.

Packages

PackageDescription
@typochat-sdk/coreBase proxy fetch wrapper — works with any @ai-sdk/* provider
@typochat-sdk/googleDrop-in replacement for @ai-sdk/google
@typochat-sdk/google-vertexDrop-in replacement for @ai-sdk/google-vertex using Vertex AI Express Mode

Install

bash
npm install @typochat-sdk/core @typochat-sdk/google @typochat-sdk/google-vertex ai

Quick Start (Google Gemini)

Google Gemini is fully supported today.

Then use it just like @ai-sdk/google — only the import and config change:

typescript
import { createProxyGoogle } from "@typochat-sdk/google";
import { generateText } from "ai";
 
const google = createProxyGoogle({
  apiKey: "tmk_your_api_key_here",
});
 
const { text } = await generateText({
  model: google("gemini-2.5-flash"),
  prompt: "Explain quantum computing in one paragraph.",
});
 
console.log(text);

That's it. Streaming, function calling, and all other Vercel AI SDK features work out of the box.

Quick Start (Google Vertex)

Google Vertex uses the same Gemini model list as Google, but model IDs are routed through Vertex AI Express Mode.

typescript
import { createProxyVertex } from "@typochat-sdk/google-vertex";
import { generateText } from "ai";
 
const vertex = createProxyVertex({
  apiKey: "tmk_your_api_key_here", // express mode
});
 
const { text } = await generateText({
  model: vertex("gemini-3.1-flash-lite-preview"),
  prompt: "Explain quantum computing in one paragraph.",
});
 
console.log(text);

Use @typochat-sdk/google for Google AI Studio keys and @typochat-sdk/google-vertex for Vertex AI Express Mode.

Context Keys

The optional contextKey parameter groups related requests together, improving Gemini's prefix cache hit rate. When cache hits occur, input tokens are served at a 75% discount and responses arrive faster.

typescript
const google = createProxyGoogle({
  apiKey: "tmk_your_api_key_here",
  contextKey: "chat-session-abc123", // stable ID for related requests
});

Use a conversation or session ID as the context key for chat apps, or a descriptive label for batch jobs. If you don't provide one, the proxy derives a key automatically — but an explicit key gives better results.

Streaming Example

typescript
import { createProxyGoogle } from "@typochat-sdk/google";
import { streamText } from "ai";
 
const google = createProxyGoogle({
  apiKey: "tmk_your_api_key_here",
});
 
const result = streamText({
  model: google("gemini-2.5-flash"),
  prompt: "Write a short poem about coding.",
});
 
for await (const chunk of result.textStream) {
  process.stdout.write(chunk);
}

Try It Out

Head to the Playground to test your API key with a live chat interface — no code required.

What's Next