Getting Started
Quick Start
VectorAxis exposes an OpenAI-compatible API. You only need to change your base URL and use a VectorAxis virtual key — the rest of your code stays identical. Four steps and you’re live.
1
Create a virtual key
In the dashboard, go to Virtual Keys → New Key. Choose a provider (e.g. OpenAI), paste your provider API key, and optionally set a credit budget or rate limits. Copy the returned slug (vk-…) — that’s what your app will use instead of the real key. No provider account of your own? Create a PLATFORM key and draw on prepaid credits instead. Full detail on the Virtual Keys page.
2
Point your SDK at VectorAxis
Replace your provider base URL with the gateway URL and set api_key to your virtual key slug — the SDK sends it as Authorization: Bearer and VectorAxis routes to the right provider.
python
from openai import OpenAI
client = OpenAI(
base_url="https://api.vectoraxis.ai/v1",
api_key="vk-1a2b3c4d5e6f7a8b", # your VectorAxis virtual key slug
)
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello!"}],
)Or with plain HTTP:
bash
curl https://api.vectoraxis.ai/v1/chat/completions \
-H "Authorization: Bearer vk-1a2b3c4d5e6f7a8b" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4o","messages":[{"role":"user","content":"Hello!"}]}'3
Add gateway features via headers
Every VectorAxis capability is activated by a request header — no SDK changes required. Turn on caching, retries, and a fallback provider in one call:
python
response = client.chat.completions.create(
model="gpt-4o",
messages=[...],
extra_headers={
"x-cache-mode": "semantic", # serve similar queries from cache
"x-retry-count": "3", # retry transient failures
"x-fallback-1-provider": "ANTHROPIC", # fail over to Anthropic
"x-fallback-1-api-key": "sk-ant-...",
"x-guardrail": "pii-redact", # redact PII on the way out
},
)See every header on the Request Headers reference.
4
View logs and cost in the dashboard
Every request is logged automatically. Open Logs to inspect latency, tokens, cost, cache status, and the full request/response bodies; open Analytics for cost and latency trends across all traffic. (Attribution to an org/workspace is automatic when you call with a virtual key.)
Where to next? Spread traffic with Routing Configs, cut cost with Caching, enforce safety with Guardrails, or wire up your IDE via Coding Agents.