Integration · framework

Cypherz for Vercel AI SDK

The Vercel AI SDK is the fastest way to ship a chat UI in Next.js — which means it's the fastest way to ship a customer-data leak. Point the underlying provider at the Cypherz proxy and every server-side AI call gets tokenized, with streaming preserved.

  • 01

    Streaming-safe

    Token-by-token streaming works through the proxy; restoration is incremental.

  • 02

    Server actions friendly

    Drop in inside any Next.js route or server action.

  • 03

    Edge-compatible

    Works in Edge Runtime — no Node-only dependencies.

Stream from a Next.js server action

import { streamText } from "ai";
import { createOpenAI } from "@ai-sdk/openai";

const openai = createOpenAI({
  apiKey: process.env.CYPHERZ_KEY,
  baseURL: "https://api.cypherz.app/v1/proxy/openai/v1",
});

export async function ask(prompt: string) {
  return streamText({
    model: openai("gpt-4o"),
    prompt,
  });
}

Common questions

Frequently asked.

Is Cypherz officially supported by Vercel AI SDK?

Cypherz is built as a transparent proxy compatible with Vercel AI SDK's public API. We don't require their endorsement and they don't gate us — your existing API key works through Cypherz.

Will my latency get worse?

Tokenization adds 5-30ms per request depending on payload size. The actual LLM call is the dominant cost (hundreds of ms), so the user-perceived difference is negligible. Run Cypherz in the same region as your AI provider for lowest hop overhead.

Does streaming work?

Yes — Cypherz proxies streaming responses and restores tokens chunk-by-chunk on the way back. Works with SSE and standard chunked transfer.

Can I use my own Vercel AI SDK key?

Yes — paste your key when you create a project; Cypherz encrypts it under the per-project vault key. You can also use managed mode where Cypherz provisions and bills the upstream key.

Get started

Add Cypherz to your Vercel AI SDK integration in 60 seconds.

Sign up, create a project, copy your API key. The first request is tokenized in under sixty seconds.