SDKs and frameworks

Vercel AI SDK

The AI SDK’s OpenAI provider takes a base URL. Create one pointed at the gateway and use it for any model in the catalogue.

Set up a provider

TypeScript
// npm install ai @ai-sdk/openai
import { createOpenAI } from '@ai-sdk/openai';
import { streamText } from 'ai';

const vioneer = createOpenAI({
  apiKey: process.env.VIONEER_API_KEY,
  baseURL: 'https://vioneer.xyz/api/v1',
});

const result = streamText({
  model: vioneer.chat('claude-sonnet-5-5'),
  prompt: 'Write a haiku about the sea.',
});

for await (const text of result.textStream) process.stdout.write(text);

Why .chat()

vioneer.chat(id) calls /chat/completions, which every model on Vioneer answers. Keep the API key on the server: in Next.js, call the model from a route handler or a server action, never from the browser.

If something does not work

  • 401: the key is wrong, revoked or missing. Keys are shown once, when you create them; make a new one in the dashboard if in doubt.
  • 402: the account is out of credit. Top up and the next request goes through.
  • 403: the key is not allowed that model. Check its model allowlist under Keys.
  • 404 on a model: the id is not in the catalogue. Copy it from the price list.
  • 429: a rate or concurrency limit was hit. Wait for the retry-after seconds, or raise the key’s limit.

Every request, failed ones included, is listed in the dashboard’s activity log with its status and cost.