JavaScript / Node.js gateway beta quickstart
The OpenAI JS SDK works against VerticalAPI without modification. Install with npm, set baseURL and apiKey, pass your provider key via defaultHeaders. Same code in browser, Node, Deno, Bun.
From beta docs to a verified test
Read the gateway beta documentation
Confirm current access, supported providers, compatibility and limits.
Prepare scoped credentials
Follow your provider's current key-handling guidance and avoid production credentials during evaluation.
Install the JavaScript / Node.js SDK
npm install openaiRun the example below
Use the documented base URL and required headers, then verify the returned shape for this beta path.
Validate the result
Check response shape, model behavior, limits and total cost against the provider before production.
JavaScript / Node.js — first call
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://api.verticalapi.com/v1',
apiKey: 'vapi_...',
defaultHeaders: { 'X-Provider-Key': 'sk-...' }
});
const response = await client.chat.completions.create({
model: 'gpt-4o', // or claude-sonnet-4-5, gemini-2.5-pro
messages: [{ role: 'user', content: 'Hello, world' }],
});
console.log(response.choices[0].message.content);Model IDs and provider support can drift. Check the source-dated model directory and current beta documentation before changing the model or provider header.
Common errors and fixes
Where to go from here
Pick a model in the source-dated directory. Compare two in the decision comparisons. Review the benchmark evidence policy before trusting performance claims.