Documentation
Vercel AI SDK in the NexoRouter documentation.
Vercel AI SDK
Status: Candidate setup, not yet verified by NexoRouter.
Use @ai-sdk/openai-compatible with NexoRouter's base URL and API key.
TypeScript example
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { generateText } from "ai";
const nexorouter = createOpenAICompatible({
name: "nexorouter",
apiKey: process.env.NEXOROUTER_API_KEY,
baseURL: "https://api.nexorouter.com/v1"
});
const result = await generateText({
model: nexorouter("deepseek-v4-flash"),
prompt: "Write one short production checklist."
});
console.log(result.text);
Verify
Start with non-streaming generateText. Confirm Usage Logs before enabling streaming UI, tools, or long-running server actions.