Provider support
Integrate once and reach them all. VectorAxis speaks the OpenAI wire format, so a single integration routes to 50+ LLM providers plus Anthropic’s native API and Google Vertex, with no per-provider SDKs, no lock-in. Swap models or providers by changing a key, not your code.
- No lock-in. Move from one provider to another, or run several side by side, without touching application code.
- One format. Send OpenAI-style requests everywhere; VectorAxis translates to each provider’s wire format and back.
- Best price / latency. Route cheap tasks to a small provider and hard ones to a frontier model with a routing config.
There are two ways to tell VectorAxis which provider to use; both resolve to the same routing:
- Virtual key. Create a virtual key for a provider once, then send it as your API key. The provider and credentials are resolved server-side.
- Direct credentials. Send x-provider (the provider id, e.g. GROQ) plus x-api-key (your own key for that provider). Best for quick tests and bring-your-own-key flows.
These share the OpenAI wire format and route transparently. The most-requested first:
Plus a long tail of specialist and regional providers:
Anthropic requests are converted to the native Messages API format with automatic anthropic-version: 2023-06-01 header injection. Specify x-provider: ANTHROPIC or use an Anthropic virtual key; the translation is handled transparently, so you keep sending OpenAI-style requests and get OpenAI-style responses back. Tools, images, PDFs, structured output, extended thinking and prompt caching (cache_control) are carried across, and an anthropic-beta header is passed on. The other direction works too: the Claude SDK can call /v1/messages on any provider’s key.
TYPESAFE is not a chat provider. Jev answers typed questions (yes/no, choice, score) instead of generating text, and it is served on its own endpoint, POST /v1/systemone, in TypeSafe’s own format, so the TypeSafe SDK works by pointing its base URL at VectorAxis. A TypeSafe key is rejected on chat completions and the media endpoints. See System One (Jev).
Vertex AI is reached through its OpenAI-compatible endpoint. Create a VERTEX_AI virtual key with your GCP service-account JSON, project ID, and region. VectorAxis signs a short-lived OAuth2 token from the service account on each request (cached and refreshed automatically), so you never manage access tokens yourself. Model ids use the Vertex publisher form (google/gemini-2.0-flash); a bare id like gemini-2.0-flash is prefixed with google/ for you. Override the key's project or region per request with x-vertex-project and x-vertex-region (use global for the multi-region endpoint).
Set stream: true to receive the response as Server-Sent Events. Every provider streams in the OpenAI chat.completion.chunk format. For Anthropic, the native Messages SSE events (message_start, content_block_delta, message_delta) are translated to OpenAI chunks on the fly, ending with a chunk that carries token usage. Every stream is logged and billed with its whole answer, including one the client stops reading early.
The stream is a series of data: lines, one JSON chunk each, ending with a chunk that has an empty choices list and the token usage, then a final data: [DONE]. The same applies to POST /v1/prompts/{slug}/completions. Use the OpenAI SDK’s stream=True and it handles the framing for you. See the Quick start.
data: {"object":"chat.completion.chunk","choices":[{"index":0,"delta":{"role":"assistant","content":""}}]}
data: {"object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"Hello"}}]}
data: {"object":"chat.completion.chunk","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: {"object":"chat.completion.chunk","choices":[],"usage":{"prompt_tokens":9,"completion_tokens":2,"total_tokens":11}}
data: [DONE]- Cache. A hit is sent as a stream at once; a finished miss is stored. See Caching.
- Guardrails. Input and output checks both run; output checks hold each sentence back until it has been checked. x-guardrail-status reports the input phase. See Guardrails.
- Retry / fallback. Applied until the first token; after that a failure ends the stream with an error event. x-retry-count and x-fallback-provider report what happened.
Pass OpenAI-style tools in the request and the model's tool_calls come back in the same format. This works for OpenAI-compatible providers and for Anthropic. VectorAxis maps OpenAI tool definitions to Anthropic tool_use blocks and back, and converts tool-role result messages into Anthropic tool_result blocks. Tool calls also stream incrementally, as tool_calls deltas.