Skip to main content

Introduction

Terramind can be used as an AI provider with the Vercel AI SDK, giving you access to multiple LLM providers through a unified, easy-to-use interface. This is perfect for building AI-powered applications without managing multiple API keys or dealing with different provider APIs.

Why Use Terramind as a Provider?

Unified Interface

Access Claude, GPT, Gemini, and more through one consistent API

Simplified Auth

One API key for all models - no need to manage multiple provider keys

Built-in Tracking

Automatic usage tracking and cost monitoring

Vercel AI SDK Compatible

Drop-in replacement that works with all AI SDK features

Features

Full AI SDK Support

Terramind supports all major Vercel AI SDK features:
  • Text Generation - generateText(), streamText()
  • Object Generation - generateObject(), streamObject()
  • Tool Calling - Full tool/function calling support
  • Streaming - Real-time streaming responses
  • Multi-modal - Text, images, and more
  • Embeddings - Generate text embeddings

Multiple Models

Access industry-leading models:
  • Claude: Sonnet 4.5, Sonnet 4, Opus 4.1, Haiku 4.5
  • GPT: GPT-5, GPT-5 Codex
  • Chinese Models: GLM-4.6, Kimi K2, Qwen3 Coder
  • Specialized: Grok Code, Big Pickle

Installation

Install both Terramind and the Vercel AI SDK:

Quick Start

Here’s a simple example to get started:

Basic Usage Patterns

Text Generation

Generate text responses:

Streaming Responses

Stream responses in real-time:

Object Generation

Generate structured data:

Tool Calling

Use AI with tools/functions:

Configuration

Create Provider Instance

Environment Variables

Set your API key as an environment variable:
Then the provider will automatically use it:

Error Handling

Handle errors gracefully:

TypeScript Support

Terramind has full TypeScript support with type inference:

Next Steps

Usage Examples

See detailed code examples and patterns

Available Models

Browse all available models