• Playground
  • Models
  • Rankings
  • Pricing
  • Support
Docs
  • About Boundless
  • Quickstart
  • API Compatibility
  • Models
  • OpenAI SDK
  • Anthropic SDK
  • Vercel AI SDK
  • LangChain
  • Streaming
  • Tool calling
  • Reasoning
  • Errors
  • MPP & Agentic Payments
  • Credits & Billing
  • Rate Limits
  • Teams
  • Privacy & ZDR
  • FAQ
  • Coding agents
    Coding Agents & Harnesses
  • Claude Code
  • Claude Desktop
  • Codex CLI
  • Codex app
  • OpenCode
  • Cursor
  • Cline
  • GitHub Copilot
  • Kilo Code
  • Qwen Code
  • Amp
  • CodeBuddy
  • Hermes
  • Hermes Desktop
  • JetBrains AI & Junie
  • Cherry Studio
  • Mastra
  • MiMo Code
  • Muse
  • omp (Oh My Pi)
  • OpenClaw
  • OpenHands
  • T3 Code
  • Advanced
    System One
All systems operational
© 2026 BoundlessTermssupport@boundless.network

Vercel AI SDK

Use the Vercel AI SDK with Boundless through the OpenAI-compatible provider: install, base URL and key, streaming and a tool call.

The Vercel AI SDK reaches Boundless through @ai-sdk/openai-compatible, which speaks chat completions.

Install#

npm install ai @ai-sdk/openai-compatible zod

Base URL and key#

export BOUNDLESS_API_KEY="paste-your-key-here"
import { createOpenAICompatible } from "@ai-sdk/openai-compatible"

export const boundless = createOpenAICompatible({
  name: "boundless",
  baseURL: "https://api.inference.boundless.network/v1",
  apiKey: process.env.BOUNDLESS_API_KEY,
})

Name a model with the ID from the models table: boundless("deepseek/deepseek-v4.1-flash-1017").

Make a request#

import { generateText } from "ai"
import { boundless } from "./boundless"

const { text, usage } = await generateText({
  model: boundless("deepseek/deepseek-v4.1-flash-1017"),
  prompt: "Say hello",
})

console.log(text)
console.log(usage)

Stream the reply#

import { streamText } from "ai"

const result = streamText({
  model: boundless("deepseek/deepseek-v4.1-flash-1017"),
  prompt: "Say hello",
})

for await (const delta of result.textStream) {
  process.stdout.write(delta)
}
console.log("\n", await result.usage)

Call a tool#

import { generateText, stepCountIs, tool } from "ai"
import { z } from "zod"

const { text, toolCalls } = await generateText({
  model: boundless("deepseek/deepseek-v4.1-flash"),
  prompt: "What is 20 + 22? Use the add tool.",
  tools: {
    add: tool({
      description: "Add two integers.",
      inputSchema: z.object({ a: z.number().int(), b: z.number().int() }),
      execute: async ({ a, b }) => ({ result: a + b }),
    }),
  },
  stopWhen: stepCountIs(3),
})

console.log(toolCalls)
console.log(text)

The SDK runs execute, sends the result back and asks the model for the final answer. Tool calling shows the same loop on the raw API.

Known differences#

  • Keep @ai-sdk/openai-compatible on the same AI SDK major version as ai. The tool example uses the inputSchema and stopWhen names of AI SDK 5 and later.
  • The provider speaks chat completions. Messages and Responses are not used.
  • Not every model supports tools. GET /v1/model/info lists the capability flags.
  • Credits that run out return 402 with budget_exceeded. Rate limits return 429. See Errors.
  • A reasoning model spends max_tokens on thinking too. See Reasoning.
NextLangChain