- Docs
- Getting Started
- Quickstart
Quickstart
Open Vertex Router is a drop-in replacement for the OpenAI API. If you already call OpenAI, you change two things: the base URL and the API key. The rest of your code stays as it is.
1. Get your gateway URL and a key
Section titled “1. Get your gateway URL and a key”Every account has its own gateway, with its own URL. Open the dashboard: the Integrate page shows your base URL, and the API keys page creates keys. Copy the key when you create it. The full value is shown only once.
On this site, https://<your-gateway>/v1 stands for your base URL, and the OVR_API_KEY
environment variable holds the key:
export OVR_API_KEY="sk-..."2. Send a chat completion
Section titled “2. Send a chat completion”curl https://<your-gateway>/v1/chat/completions \ -H "Authorization: Bearer $OVR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4.1-mini", "messages": [{"role": "user", "content": "Say hello in one sentence."}] }'import osfrom openai import OpenAI
client = OpenAI( base_url="https://<your-gateway>/v1", api_key=os.environ["OVR_API_KEY"],)
reply = client.chat.completions.create( model="gpt-4.1-mini", messages=[{"role": "user", "content": "Say hello in one sentence."}],)print(reply.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://<your-gateway>/v1", apiKey: process.env.OVR_API_KEY,});
const reply = await client.chat.completions.create({ model: "gpt-4.1-mini", messages: [{ role: "user", content: "Say hello in one sentence." }],});console.log(reply.choices[0].message.content);The response is the standard OpenAI chat completion object: choices[0].message.content holds
the reply, usage holds the token counts, and model echoes the id you asked for. Every
response also carries an x-request-id header. Keep it when something goes wrong: it is what
support will ask you for.
3. Switch providers with one field
Section titled “3. Switch providers with one field”The model field selects the provider. Reaching another vendor is a string change, not a new
integration, contract or invoice:
curl https://<your-gateway>/v1/chat/completions \ -H "Authorization: Bearer $OVR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-haiku-4-5", "messages": [{"role": "user", "content": "Say hello in one sentence."}] }'reply = client.chat.completions.create( model="claude-haiku-4-5", messages=[{"role": "user", "content": "Say hello in one sentence."}],)const reply = await client.chat.completions.create({ model: "claude-haiku-4-5", messages: [{ role: "user", content: "Say hello in one sentence." }],});GET /v1/models lists every model your key can call, with the exact ids to use. See
Models & providers.
Next steps
Section titled “Next steps”- Authentication: how keys are scoped, budgeted and revoked.
- Making requests: the endpoints, streaming, and what differs from calling OpenAI directly.
- Request tags: attribute spend to a feature, an environment or a customer.