Setup
Key
Create a key in the console and put it in the VELISITY_API_KEY environment variable. The configs below read it from there.
Get a key →export VELISITY_API_KEY="vls_live_…"Install the provider
npm i ai @ai-sdk/openaiCreate the provider
Use .chat(): it calls /chat/completions, which every catalog model supports.
import { createOpenAI } from "@ai-sdk/openai";import { streamText } from "ai"; const velisity = createOpenAI({ baseURL: "https://api.velisity.live/v1", apiKey: process.env.VELISITY_API_KEY,}); const result = streamText({ model: velisity.chat("anthropic/claude-sonnet-4-5"), prompt: "ping" });for await (const delta of result.textStream) process.stdout.write(delta);Check that it works
A request to /v1/key returns the key name, limits and balance — if you get JSON back, the key and URL are right.
curl https://api.velisity.live/v1/key -H "Authorization: Bearer $VELISITY_API_KEY"
Your first request in a minute
Create a key, change the base_url — and your code already works with any model. You only pay for answers.