Skip to content
TokenGauge
Menu

Setup note · 3 steps

SayGM in Vercel AI SDK

The Vercel AI SDK can override the base URL on any provider. Point the OpenAI and Anthropic providers at SayGM to reach GPT, Claude and open-weight models with one key.

Updated 11 Nov 2026

§ 01

Steps

  1. Step 1: Install @ai-sdk/openai for GPT and open models, and @ai-sdk/anthropic for Claude.

  2. Step 2: Create each provider with baseURL set to https://api.saygm.com/v1 and apiKey set to your SayGM key.

  3. Step 3: Call generateText or streamText. Use saygm.chat() so OpenAI-format calls go to Chat Completions, which open models serve.

TypeScript
import { createAnthropic } from "@ai-sdk/anthropic";import { createOpenAI } from "@ai-sdk/openai";import { streamText } from "ai"; const apiKey = process.env.SAYGM_API_KEY;const saygm = createOpenAI({ baseURL: "https://api.saygm.com/v1", apiKey });const claude = createAnthropic({ baseURL: "https://api.saygm.com/v1", apiKey }); const result = streamText({  model: saygm.chat("deepseek-v4.1-flash"),  prompt: "Summarise this changelog in three bullets.",}); // For Claude: model: claude("claude-sonnet-5-5")

§ 02

Why route Vercel AI SDK through a gateway

  • 01

    Single key for every provider simplifies secrets management.

  • 02

    Fusion models combine two to four models and an adjudicator in one call.

  • 03

    Each response carries its exact charge in the usage block.

§ 03

Models worth trying in Vercel AI SDK

Snapshot SayGM prices per million tokens, input then output.

§ 04

Vercel AI SDK questions

Does Vercel AI SDK work with SayGM?

Yes. The Vercel AI SDK can override the base URL on any provider. Point the OpenAI and Anthropic providers at SayGM to reach GPT, Claude and open-weight models with one key.

Which models can I use in Vercel AI SDK through SayGM?

Claude through the Anthropic setup, and GPT and open-weight models through the OpenAI-compatible one, including Claude Opus 5.5, Claude Sonnet 5.5 and GPT-6.1 Sol. SayGM serves Gemini only on generateContent.

Where do I find the SayGM base URL?

The steps above give it for this tool. The SayGM developer docs list the endpoint for each API format: Anthropic Messages, OpenAI Chat Completions and Responses, and Gemini generateContent.