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
- Create an API key on the API Keys page
- Install the SDK for your provider
- 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
| Package | Description |
|---|---|
@typochat-sdk/core | Base proxy fetch wrapper — works with any @ai-sdk/* provider |
@typochat-sdk/google | Drop-in replacement for @ai-sdk/google |
@typochat-sdk/google-vertex | Drop-in replacement for @ai-sdk/google-vertex using Vertex AI Express Mode |
Install
npm install @typochat-sdk/core @typochat-sdk/google @typochat-sdk/google-vertex aiQuick Start (Google Gemini)
Google Gemini is fully supported today.
Then use it just like @ai-sdk/google — only the import and config change:
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.
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.
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
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
- Google Gemini provider — full reference with all models, streaming, reasoning, and structured output
- Google Vertex provider — Vertex AI Express Mode setup using the same Gemini model list
- API Reference — proxy SDK configuration and options
- OpenAI and Anthropic support are coming soon