vexer API

vexer API

One API key for Claude, Grok and GPT. Fully compatible with the OpenAI and Anthropic APIs, so it drops into the tools you already use — the terminal, your editor, Claude Code, or any SDK. Requests are billed per token against your credit balance; no subscription.

Base URLs

OpenAI-compatible:    https://vexer.chat/v1
Anthropic-compatible: https://vexer.chat   (SDK appends /v1/messages)

Authentication

Create a key at /sign-up (starts with vx-, shown once). Send it any of these ways — all three work:

  • Authorization: Bearer vx-… (OpenAI SDKs, most tools)
  • x-api-key: vx-… (Anthropic SDK style)
  • ANTHROPIC_AUTH_TOKEN=vx-… — Claude Code sends it as a Bearer token

Models

autoRouter — picks a model per request
claude-opus-4-8Anthropic — deepest reasoning
claude-sonnet-5Anthropic — fast, balanced
claude-fable-5Anthropic — creative writing
grok-4.5xAI
gpt-5.6-solOpenAI

You can pass a bare id (claude-opus-4-8) or a provider-prefixed one (anthropic/claude-opus-4.8, openai/gpt-5.6, xai/grok-4.5) — both resolve to the same model. Unknown ids that look like a known family (e.g. gpt-4o, claude-3-5-haiku) map to the nearest vexer model, so existing clients work unchanged. List everything live: GET https://vexer.chat/v1/models.

Chat Completions (OpenAI-compatible)

curl https://vexer.chat/v1/chat/completions \
  -H "Authorization: Bearer $VEXER_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "messages": [{"role": "user", "content": "Hello in one sentence."}],
    "stream": false
  }'

Messages (Anthropic-compatible)

curl https://vexer.chat/v1/messages \
  -H "x-api-key: $VEXER_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4-8",
    "max_tokens": 512,
    "messages": [{"role": "user", "content": "Hi"}]
  }'

Automatic routing & fallback

Pass "model": "auto" to let vexer pick a model per request — hard, long, or code-heavy prompts route to the deepest model, the rest to a fast default. Every model also has a fallback: if the chosen provider is unavailable, the request reroutes before any token streams. Every response reports the route: the model field and an X-Model header. On a non-streamed request both are the model that actually ran; on a stream the header is the routing decision (headers are sent before generation starts). See the routing guide and the model catalog.

Images & file uploads

Send images alongside text on either endpoint — a public URL or a base64 data: URI. PDFs work on the Anthropic endpoint via a document block (base64, application/pdf) and go to Claude models; GPT can't read PDFs directly, so it returns a note rather than failing silently. In the chat you can additionally attach or paste JSON, CSV, TXT/Markdown and code files (4 files, 5 MB each) — those are decoded and inlined into the prompt.

# OpenAI-compatible — image_url part
curl https://vexer.chat/v1/chat/completions \
  -H "Authorization: Bearer $VEXER_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4-8",
    "messages": [{"role": "user", "content": [
      {"type": "text", "text": "What is in this image?"},
      {"type": "image_url", "image_url": {"url": "https://example.com/cat.jpg"}}
    ]}]
  }'

# Anthropic-compatible — image source block (base64 or url)
curl https://vexer.chat/v1/messages \
  -H "x-api-key: $VEXER_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4-8",
    "max_tokens": 512,
    "messages": [{"role": "user", "content": [
      {"type": "text", "text": "Describe this."},
      {"type": "image", "source": {"type": "url", "url": "https://example.com/cat.jpg"}}
    ]}]
  }'

Usage

Check your own consumption and credit balance with your API key. Token counts and amounts are for the account the key belongs to; amounts are US cents.

curl https://vexer.chat/v1/usage \
  -H "Authorization: Bearer $VEXER_KEY"

# {
#   "object": "usage",
#   "balance_cents": 482,
#   "today":  { "requests": 12, "input_tokens": 18400, "output_tokens": 5200, "cents_charged": 31 },
#   "month":  { "requests": 240, "input_tokens": 410000, "output_tokens": 96000, "cents_charged": 612 },
#   "by_model": [ { "model": "claude-sonnet-5", "requests": 180, ... } ]
# }

Streaming

Set "stream": true. The OpenAI endpoint returns chat.completion.chunk SSE events ending in data: [DONE]; the Anthropic endpoint returns the standard message_start → content_block_delta → message_stop event sequence.

Errors

Errors use standard HTTP status codes with a JSON body. The OpenAI endpoints return { "error": { "message", "type" } }; the Anthropic endpoint returns { "type": "error", "error": { "type", "message" } }.

  • 400 invalid_request_error — bad JSON, unknown model, or empty messages.
  • 401 authentication_error — missing or invalid API key.
  • 402 insufficient_quota — no credit balance; top up to continue.
  • 429 — rate limit or daily spend cap reached; honor the Retry-After header.
  • 502 api_error — the upstream model failed to generate; retry.

If a stream fails after it has started, the failure arrives in-band as a chunk carrying an error object (code: "stream_error"), and data: [DONE] still follows — so a broken stream is distinguishable from a normal stop.

Claude Code

Point Claude Code at vexer's Anthropic-compatible endpoint. Use the base URL without /v1 — Claude Code appends the Messages path itself.

Temporary (current shell):

$env:ANTHROPIC_BASE_URL = "https://vexer.chat"
$env:ANTHROPIC_AUTH_TOKEN = "vx-your_api_key"
$env:ANTHROPIC_MODEL = "claude-opus-4-8"
claude

Persistent (saved for your user):

[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://vexer.chat", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "vx-your_api_key", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_MODEL", "claude-opus-4-8", "User")

OpenAI-compatible tools

Any tool that speaks the OpenAI chat completions API — OpenCode, Continue, Cursor, LiteLLM and others — works by pointing its base URL at vexer and using your vx- key. Most read these two environment variables:

export OPENAI_BASE_URL="https://vexer.chat/v1"
export OPENAI_API_KEY="vx-your_api_key"
# then pick a model, e.g. gpt-5.6-sol or claude-opus-4-8

Codex CLI is not supported yet. It talks the OpenAI Responses API (wire_api = "responses"), which vexer doesn't implement — pointing it at /v1 will fail. Use Claude Code above, or any chat-completions client, until /v1/responses ships.

SDKs

OpenAI SDK (Python)

from openai import OpenAI

client = OpenAI(api_key="vx-...", base_url="https://vexer.chat/v1")
resp = client.chat.completions.create(
    model="claude-opus-4-8",
    messages=[{"role": "user", "content": "Explain quantum tunneling briefly."}],
)
print(resp.choices[0].message.content)

OpenAI SDK (JavaScript)

import OpenAI from "openai";

const client = new OpenAI({ apiKey: "vx-...", baseURL: "https://vexer.chat/v1" });
const r = await client.chat.completions.create({
  model: "grok-4.5",
  messages: [{ role: "user", content: "Give me a haiku about the sea." }],
});
console.log(r.choices[0].message.content);

Anthropic SDK (JavaScript)

import Anthropic from "@anthropic-ai/sdk";

// Base URL without /v1 — the SDK appends /v1/messages.
const client = new Anthropic({ apiKey: "vx-...", baseURL: "https://vexer.chat" });
const msg = await client.messages.create({
  model: "claude-opus-4-8",
  max_tokens: 512,
  messages: [{ role: "user", content: "Write a one-line launch checklist." }],
});
console.log(msg.content);

Pricing & limits

  • Billed per token against your credit balance — top up in the app, no subscription.
  • Max output: 8192 tokens per request.
  • Rate limits and a daily spend cap apply per account.
  • List models any time: GET https://vexer.chat/v1/models.
vexer API — OpenAI & Anthropic-compatible LLM API