Guide · Vercel AI SDK

Connect Vercel AI SDK to Synap

3 steps · about 2 minutes

  1. Get a free key

    Sign in with Google at synap.linkrra.com — no card. Your key starts with sk-pool-.

  2. Create the provider

    @ai-sdk/openai-compatible is the standard provider package — it takes a base URL and a key, and nothing else about the AI SDK changes.

    // npm i ai @ai-sdk/openai-compatible
    import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
    
    export const synap = createOpenAICompatible({
      name: "synap",
      baseURL: "https://synap.linkrra.com/v1",
      apiKey: process.env.SYNAP_API_KEY,
    });
  3. Generate, or stream

    Pass synap("<model id>") wherever the AI SDK takes a model.

    import { generateText } from "ai";
    
    const { text } = await generateText({
      model: synap("qwen3-coder-30b"),
      prompt: "Write a one-line Python function that reverses a string.",
    });
    console.log(text);
    import { streamText } from "ai";
    
    const { textStream } = streamText({
      model: synap("qwen3-coder-30b"),
      prompt: "Name three Python standard-library modules, comma separated.",
    });
    for await (const chunk of textStream) process.stdout.write(chunk);
Notes, prices and limits

One provider object, then the AI SDK as usual. Recommended model: qwen3-coder-30b — $0.0675 in and $0.27 out per 1M tokens, 98,304-token context.

Run live against this API with ai 7.0.162 and @ai-sdk/openai-compatible 3.0.84 — both generateText and streamText.

It is the generic OpenAI-compatible provider, not a Synap-specific one, so the rest of the AI SDK — tools, generateObject, useChat — sees an ordinary model.

Keep the key server-side. In Next.js that means a route handler or a server action, never a component that ships to the browser.

On the free tier: every request counts input and output against 100,000 free tokens a day, and answers stop at 4,096 output tokens. Coding agents send long prompts, so the free tier covers a short session; credits cover the rest.

Field names from AI SDK docs: OpenAI-compatible providers, run against this API, checked 2026-11-03 17:45 UTC. Prices refresh from /v1/models when this page loads.