ZuploZuplo
LoginSign Up
  • Documentation
  • API Reference
Introduction
Getting Started
    Develop using the Portal
      1 - Setup Your Gateway2 - Rate Limiting3 - API Key Auth4 - Deploy5 - Dynamic Rate LimitingMCP - Quick start
    Develop Locally
      1 - Setup Your Gateway2 - Rate Limiting3 - API Key Auth
Concepts
Development
Policies
Handlers
API Keys
MCP Server
MCP Gateway
AI Gateway
    IntroductionGetting StartedUniversal API
    Providers
    Teams
    Apps
    Guardrails & Policies
    Integrations
      AI SDKClaude CodeCodexGooseLangChain SDKOpenAI SDK
Developer Portal
Monetization
Deploying & Source Control
Observability
Networking & Infrastructure
Account Management
Programming API
Build with AI
Zuplo CLI
Migration Guides
Platform LimitsSecuritySupportTrust & ComplianceChangelog
powered by Zudoku
Integrations

AI SDK

The AI SDK is a free open-source library that gives you the tools you need to build AI-powered products. It's compatible with a large selection of providers and models, and has a large selection of additional community supported providers being added regularly.

Prerequisites

In order to use the AI Gateway with any AI SDK powered application you will need to complete these steps first:

  1. Create a new provider in the AI Gateway for the provider you want to use with AI SDK

  2. Set up a new team

  3. Create a new app to use specifically with AI SDK and assign it to the team you created

  4. Copy the API Key for the app you created, as well as the Gateway URL

Configure the AI SDK

To route all AI SDK requests through Zuplo instead of directly to the API of the chosen provider, you must set the API baseUrl in the SDK configuration to point to the Gateway URL of your Zuplo AI Gateway.

Additionally, you will need to change the value of apiKey to the API key of the app you have configured in Zuplo.

OpenAI

Code
import { createOpenAI } from "@ai-sdk/openai"; import { generateText } from "ai"; const openai = createOpenAI({ apiKey: process.env.ZUPLO_AI_GATEWAY_API_KEY, baseURL: "https://my-ai-gateway.zuplo.app/v1", }); const { text } = await generateText({ model: openai.chat("gpt-4o"), prompt: "Write a one-sentence bedtime story about a unicorn.", });

Anthropic

Code
import { createAnthropic } from "@ai-sdk/anthropic"; import { generateText } from "ai"; const anthropic = createAnthropic({ apiKey: process.env.ZUPLO_AI_GATEWAY_API_KEY, baseURL: "https://my-ai-gateway.zuplo.app/v1", // Authorization header is also required headers: { Authorization: `Bearer ${process.env.ZUPLO_AI_GATEWAY_API_KEY}`, }, }); const { text } = await generateText({ model: anthropic("claude-sonnet-4-5-20250929"), prompt: "Write a one-sentence bedtime story about a unicorn.", });

Google

Code
import { createGoogleGenerativeAI } from "@ai-sdk/google"; import { generateText } from "ai"; const google = createGoogleGenerativeAI({ apiKey: process.env.ZUPLO_AI_GATEWAY_API_KEY, baseURL: "https://my-ai-gateway.zuplo.app/v1", }); const { text } = await generateText({ model: google("gemini-2.5-flash"), prompt: "Write a one-sentence bedtime story about a unicorn.", });

Mistral

Code
import { createMistral } from "@ai-sdk/mistral"; import { generateText } from "ai"; const mistral = createMistral({ apiKey: process.env.ZUPLO_AI_GATEWAY_API_KEY, baseURL: "https://my-ai-gateway.zuplo.app/v1", }); const { text } = await generateText({ model: mistral("mistral-large-latest"), prompt: "Write a one-sentence bedtime story about a unicorn.", });
Edit this page
Last modified on November 17, 2025
Galileo TracingClaude Code
On this page
  • Prerequisites
  • Configure the AI SDK
    • OpenAI
    • Anthropic
    • Google
    • Mistral
TypeScript
TypeScript
TypeScript
TypeScript