Documentation
VIA tools and API reference. Check availability before making an inference or top-up request.
Quickstart
Checking availability…
Authentication
Send your key as a bearer token. The header x-credit-token is accepted as an alternative. VIA stores only a fingerprint of the key and cannot recover it: keep it in a password manager and never put it in a URL.
Authorization: Bearer via_YOUR_KEY
Extra keys with their own usage, manager or standard role, and safe replacement of a compromised primary key are in Account → Keys.
First request
curl https://via-router.floot.app/_api/v1/chat/completions \
-H "Authorization: Bearer $VIA_KEY" -H "Content-Type: application/json" \
-d '{"model":"MODEL_ID","messages":[{"role":"user","content":"Hello"}],"max_tokens":512}'from openai import OpenAI
client = OpenAI(base_url="https://via-router.floot.app/_api/v1", api_key=VIA_KEY)
r = client.chat.completions.create(model="MODEL_ID",
messages=[{"role": "user", "content": "Hello"}], max_tokens=512)
print(r.choices[0].message.content)The response headers X-VIA-Charge-USD and X-VIA-Receipt-Id give the exact charge and the receipt id.
Models
GET /v1/models lists the chat models on sale (HTTP 200; an empty list means none is on sale). Each entry states its price per million input and output tokens, a minimum per request only where the model has one, context length and capabilities (tools, vision, JSON schema, streaming mode). The model page, the Playground and the API use this same list; prices never change silently.
Inference
- Accepted: temperature, top_p, stop, seed, penalties, response_format, max_tokens or max_completion_tokens up to 8,192 (default 2,048), tools and tool_choice, images (image_url) on models with vision, stream.
- Streaming: each model states capabilities.streaming_mode. "buffered" sends standard SSE events once the full answer is ready; "progressive" sends tokens as generated. Both work with stream: true.
- Billing: the maximum possible cost is reserved, the real usage is charged and the rest returned. A provider failure costs nothing. Repeating a request with the same Idempotency-Key never charges twice.
- Optional fallback: "fallback_models": ["OTHER_MODEL_ID"] (ids from GET /v1/models) tries the listed models, never more expensive and with the same capabilities, if the requested one fails. The response says which model answered.
- Errors: 401 unknown or revoked key · 402 insufficient balance (nothing charged) · 429 your rate or spend limit (default 600 requests/minute) · 502/503 provider unavailable (nothing charged; retry with the same Idempotency-Key).
Not available: embeddings, fine-tuning jobs (dataset upload and price quotes only), dedicated GPU capacity, n > 1.
Tools
The same key pays VIA's own tools (or pay each call with x402 instead):
| Tool | Endpoint | USD |
|---|---|---|
| API comparison | POST /_api/api_compare | 0.01 |
| Document text extraction | POST /_api/extract_page | 0.02 |
| Web Text Lite | POST /_api/extract_web_lite | 0.001 |
| Hash SHA-256/512 (x402) | POST /_api/via_direct | 0.003 |
curl https://via-router.floot.app/_api/api_compare -H "Authorization: Bearer $VIA_KEY" -H "Content-Type: application/json" \
-d '{"intent":"Compare PDF text extraction APIs","country":"US"}'Batch processing
Up to 100 chat requests per batch, each billed at the normal price of its model; streaming is not used in batches. Create and follow batches from code or from Account → Batches.
POST https://via-router.floot.app/_api/inference_batches
{"requests":[{"custom_id":"a1","body":{"model":"MODEL_ID","messages":[{"role":"user","content":"Hello"}],"max_tokens":512}}]}
GET https://via-router.floot.app/_api/inference_batches?id=BATCH_IDOpenAI compatibility
Point any OpenAI SDK at the VIA base URL and use your VIA key as the API key; nothing else changes. Model ids with a dot or slash also have aliases (zai--glm-5-3, deepseek--deepseek-v4-pro) for models.retrieve.
// Node
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://via-router.floot.app/_api/v1", apiKey: process.env.VIA_KEY });LiteLLM & LangChain
# LiteLLM
import litellm, os
litellm.completion(model="openai/MODEL_ID", api_base="https://via-router.floot.app/_api/v1",
api_key=os.environ["VIA_KEY"], messages=[{"role": "user", "content": "Hello"}])
# LangChain
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="MODEL_ID", base_url="https://via-router.floot.app/_api/v1", api_key=os.environ["VIA_KEY"])
llm.invoke("Hello")Both use the OpenAI-compatible route; no VIA-specific package is needed.
Payments
| Method | How | For |
|---|---|---|
| Card (Stripe) | /credits · any amount from 5 USD (up to 999,999.99 USD per payment) · no fee · cards, Apple Pay, Google Pay, Link where available · does not expire | Prepaid balance |
| Bank transfer (USD, Stripe) | /credits · "method":"bank_transfer" · from 5 USD up to 999,999.99 USD per transfer · no fee · credited when Stripe confirms the funds (usually 0–3 business days) · same bank details and reference for your account | Prepaid balance, large amounts |
| USDC (x402, Base) | POST /_api/credits_buy {"tier":"5"} · 1, 5, 20, 100 | Prepaid balance |
| x402 per request | agent tools only (prices in the Tools table); AI inference is sold only on prepaid account credit | Agents without a key |
x402 flow: send the request → HTTP 402 states the exact price → sign it with your wallet → repeat the identical request with PAYMENT-SIGNATURE. Never send a key and a payment on the same request. Low balance: GET /_api/credits_balance returns lowBalance below 0.50 USD with top-up options.
Automatic recharge: in Account you set the balance that triggers it, the amount and a monthly cap, and authorise your card once in Stripe; nothing is charged without that authorisation, and you can change or switch it off at any time. Large amounts: load the same key as often as needed; payment methods enabled on the live Stripe account (and the maximum per payment) are listed by GET /_api/credits_payment_methods. Credit is added only after the funds are confirmed, and purchased credit does not expire. Estimate usage with the simulator on the pricing page.
API reference
Base URL: https://via-router.floot.app/_api · OpenAPI · llms.txt
| Method | Path | Purpose |
|---|---|---|
| GET | /_api/v1/models | Catalog with prices, context and capabilities (free) |
| GET | /_api/v1/models/{id} | One model (use the one-segment alias for ids with a slash) |
| POST | /_api/v1/chat/completions | Chat completions, prepaid key |
| POST | /_api/v1/completions | Legacy completions (one prompt, no streaming) |
| POST / GET | /_api/inference_batches | Create a batch / read it with ?id= |
| POST | /_api/credits_key | Anonymous zero-balance key for x402 agent tools; AI inference and card top-ups need a VIA account (sign in at /credits) |
| POST | /_api/credits_card_checkout | Card top-up: returns a checkout URL |
| GET | /_api/credits_payment_methods?amountUsd= | Enabled payment methods, card fee and total for an amount (free) |
| POST | /_api/credits_autorecharge | Automatic recharge: status, authorise, switch off |
| POST | /_api/credits_buy | USDC top-up by x402 (tiers 1, 5, 20, 100) |
| GET | /_api/credits_balance | Balance and low-balance signal |
| GET | /_api/credits_usage | Usage history, by key and service |
| GET | /_api/credits_receipt?requestId= | Receipt of one request |
| GET | /_api/credits_orders | Top-up history |
| POST | /_api/credits_limits | Rate limit and monthly spend cap |
| POST | /_api/credits_keys | List, create and revoke extra keys |
| POST | /_api/api_compare | API provider comparison |
| POST | /_api/extract_page | Document / page text extraction |
| POST | /_api/via_direct | Single x402 entry for VIA's own services |