AGENTS DON’THOLD CREDIT CARDS.THEY HOLD VAGA.
VAGA Router gives VagaChain agents a European brain: 100+ models, hosted in the EU, behind an OpenAI-compatible endpoint. Every request reserves a VAGA ceiling on-chain, runs in Europe, settles the exact cost — and releases the change back to the agent.
A deposit, not a subscription.
Every inference is a self-contained escrow operation: the agent controls the ceiling, the router pays the model, the chain settles the truth. Four moves — no trust needed.
The agent puts down a deposit.
Before any model runs, the router locks the maximum possible price in VAGA — on VagaChain, not in someone's database. A hard ceiling the agent controls. Nothing can ever spend more than that.
A European model does the work.
The request runs on EU-hosted models — Mistral, Llama, GPT, Gemini, whichever the agent picks. The compute stays inside the European Union. Streaming, OpenAI-compatible, no code changes.
Payment is exactly what it cost.
When the answer is done, the router reads the real usage and converts it to VAGA — to the twelfth decimal. No estimates, no rounding games. A signed receipt lands on-chain. VagaChain's own gas for the three on-chain steps is paid in VAGA on top — small, predictable, never mixed into the compute price.
The change goes back to the agent.
The unused part of the deposit returns to the agent automatically — down to the last base unit. Escrow back to zero, operation closed. Ready for the next request.
YOUR AGENTS THINK IN EUROPE.
Every model behind the router runs on European infrastructure — GDPR by default, EU data residency, no US detours. The agent picks the brain. The location is not negotiable.
The live catalog is fetched from the router on every call — models without exact EUR pricing, text modality, or a bounded output limit never make it onto the route. If it’s listed, it runs in Europe.
Browse the live catalogExact money, to the 12th decimal.
VAGA settles in integer base units — 10¹² per VAGA. The router reserves the worst case, then charges one final, upward-rounded conversion of the provider's actual EUR cost. No floats. Ever.
Micro-charges survive the rounding: even 10⁻²⁰ EUR converts to at least one base unit — every settlement is an exact integer amount on VagaChain, never a float.
Mirrors the backend conversion ceil(cost · (1+markup) · 10¹² ÷ eur_per_vaga). The reservation uses the output limit; after inference the router settles EUrouter’s returned actual cost and releases the remainder. Settlement covers compute only — VagaChain bills its own gas for the three on-chain operations (reserve, settle, release), paid in native VAGA by the submitting account on top. Rate, markup, gas, and prices here are illustrative (.env.example defaults); the real request bound also uses canonical-JSON input bytes ×2 + 64 tokens.
DON’T BELIEVE IT. USE IT.
Everything below talks to the VAGA Router backend — reservation, European inference, settlement, receipts. In demo mode it runs against a local simulation; flip the toggle in the nav to go live.
Models come from /v1/models — nothing else.
The catalog is the authenticated, live EUrouter listing filtered by the router to models with verifiable EUR pricing and bounded text inference. No hardcoded lists, no cached catalogs — and every entry runs on European infrastructure.
Issue a vcomp_ credential — signed outside the browser.
Credentials are issued from a controller-signed Ed25519 request against the agent's registered controller key. This frontend never accepts private key material: you sign with your agent CLI or the documented node one-liner, and the signature is verified locally against the public key before anything is sent.
demo mode · no real keys needed
The router is simulated locally. Fill in a demo agent and a simulated signature — the mock router issues a fully usable demo credential for the playground.
This frontend never accepts seeds or private keys. The signature is checked locally against your public controller key, then verified server-side by the backend.
Fill in agent id and controller key…
Sign externally · node one-liner (localhost tooling)
…
what the backend checks
- · the controller key is registered on the VagaChain agent
- · the Ed25519 signature over the canonical message verifies
- · the nonce is canonical and the issue hash was never used before (replay protection)
- · expiry is a millisecond UTC ISO timestamp within the configured max lifetime
Speak OpenAI. Settle on VagaChain.
Three OpenAI-compatible endpoints, two signed credential endpoints, one health probe. Everything below mirrors the running backend contract — including what happens when things go wrong.
- GET/v1/models
Authenticated live model catalog (EUrouter-shaped, filtered to safe models).
- POST/v1/chat/completions
OpenAI-compatible chat. Requires Idempotency-Key (recommended).
- POST/v1/responses
OpenAI Responses API shape. Same billing pipeline.
- GET/v1/operations/:id
Settlement & receipt status for the caller's own operations — foreign or unknown ids are a non-enumerable 404.
- POST/v1/credentials
Controller-signed issue. Returns the raw vcomp_ token exactly once.
- POST/v1/credentials/:id/revoke
Controller-signed revocation. Immediate 401s afterwards.
- GET/healthz
Unauthenticated process health check.
- Authorization
- Bearer vcomp_… — authentication only; payment is on-chain VAGA.
- Idempotency-Key
- Recommended. Same key + same body replays the settled response; different body with same key → 409.
- x-vaga-compute-operation-id
- Returned on every inference response — the durable operation reference (op_…).
- Retry-After
- Present on retryable 503s; retry with the identical Idempotency-Key.
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.VAGA_ROUTER_TOKEN, // vcomp_… (auth only)
baseURL: "https://api.vagarouter.dnsstack.pro/v1"
});
const completion = await client.chat.completions.create(
{
model: "mistralai/mistral-large",
messages: [{ role: "user", content: "ping" }],
max_completion_tokens: 64
},
{ headers: { "Idempotency-Key": "agent-run-42" } }
);Point any OpenAI SDK at the router base URL and pay with VAGA. The local backend listens on http://127.0.0.1:8787/v1; the public gateway is served via Cloudflare in front of the same process.
{
"id": "resp-…",
"model": "mistralai/mistral-large",
"choices": [{
"message": { "role": "assistant", "content": "Escrow = " … },
"finish_reason": "stop"
}],
"usage": { "prompt_tokens": 21, "completion_tokens": 14 }
}| HTTP | Code | Meaning | Retry |
|---|---|---|---|
| 401 | invalid_bearer_token / credential_expired_or_revoked | Credential missing, unknown, expired, or revoked. | no |
| 402 | insufficient_balance | Agent liquid VAGA is below the reservation bound. | no |
| 400 | model_not_found / model_capability_unsupported | Live catalog rejected the model or its pricing. | no |
| 400 | unsupported_request / unsupported_input_modality | Bounded-inference rules: text only, n=1, no unbounded features. | no |
| 409 | Idempotency-Key conflict | Same key used with a different request body. | no |
| 409 | provider_call_ambiguous | Provider outcome unknown — never blindly retried. | no |
| 503 | reservation_pending / settlement_pending | Durable operation in progress. | yes · same key |
| 502 | provider_request_failed | No billable result; reservation fully released. | new request |
Streaming requests are raw SSE passthrough: after the provider window opens, nothing is retried. Interrupted provider calls become recovery_required — visible as 409 with the operation id, reconciled by the backend, never duplicated.
Run a real request. Watch it settle.
Simulated locally in demo mode — same shapes, same settlement lifecycle, mock data. Hit “Use demo credential”, run a request, and watch the operation close.
reserve → infer → settle → release
connect a credential and run
The frontend holds no private keys and no provider secrets. Your controller seed signs in memory and is gone when the tab closes.
The vcomp_ credential is sent only as an Authorization header. It never touches analytics, logs, or third parties — payment runs over VagaChain.
Inference runs on EU-hosted infrastructure only. The VagaChain RPC and the backend database stay on loopback — the public gateway fronts the router process alone.
Every request yields a durable operation id and a hash-only inference receipt commitment — evidence without exposing payload content.