Get started

API reference

The gateway answers the OpenAI and Anthropic wire formats as their SDKs expect. Requests and responses are the standard shapes; Vioneer adds a few headers that say what a request cost.

Base URLs and authentication

OpenAI-compatible base URL
https://vioneer.xyz/api/v1
Anthropic-compatible base URL
https://vioneer.xyz/api
Authentication
Authorization: Bearer <key> or x-api-key: <key>

The API is served under both /api/v1 and /v1, so a client that adds its own /v1 and one that does not both find it.

Endpoints

Method and pathWhat it does
POST /chat/completionsOpenAI chat completions, streamed or not, with tools
POST /responsesThe OpenAI Responses API
POST /messagesThe Anthropic Messages API, streamed or not, with tools
GET /modelsThe catalogue with prices, in OpenRouter’s shape. No key needed
GET /models/{id}One model
GET /keyThe calling key: its label, limit and usage
GET /creditsThe account’s total credit and total usage
GET /generation?id=Usage and cost for one request id

Paths are relative to https://vioneer.xyz/api/v1.

Streaming

Set "stream": true on either format. Server-sent events are relayed as they arrive, with no buffering added, tool calls and reasoning included.

OpenAI SDK · Python · streaming
# pip install openai
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["VIONEER_API_KEY"],
    base_url="https://vioneer.xyz/api/v1",
)

stream = client.chat.completions.create(
    model="gpt-6.2-sol",
    messages=[{"role": "user", "content": "Write a haiku about the sea."}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="", flush=True)

Response headers

Every answer says what it cost. A streamed answer carries only its id, because the cost is known when the stream ends; GET /generation?id= has the rest.

headers
x-vioneer-request-id:        gen_9f3c…     # the row in your activity log
x-vioneer-cost-usd:          0.000412000   # what this request cost
x-vioneer-tokens-prompt:     318
x-vioneer-tokens-completion: 96

Errors

Errors come back in the format of the endpoint you called: {"error": {"message", "type", "code"}} on the OpenAI paths, {"type": "error", "error": {"type", "message"}} on /messages.

StatusTypeMeaning
400invalid_request_errorThe request is malformed, or the model is not served on that endpoint
401authentication_errorMissing, wrong or revoked key
402insufficient_creditsNot enough credit: top up
403permission_errorThe key may not use that model, or its budget is spent
404not_found_errorUnknown model or path
429rate_limit_errorA rate or concurrency limit; honour retry-after