Bring Your Own Wallet (BYOW)

Let users bring their AI wallet to your app.

Stop eating your users' LLM bills or building complex billing meters. Users connect their funded Zorveus wallet to your AI app with custom spending caps. You execute model inference, Zorveus handles the billing.

Register your app

5-minute setup · TypeScript & Python SDKs · No credit card required

Connect user wallets in minutes

Allow end-users to authorize your app with OAuth 2.0 PKCE and fund model inference directly.

STEP 01

Initiate OAuth PKCE flow

Generate PKCE verifier, S256 challenge, and state CSRF token. Redirect the user browser to the Zorveus authorization consent page.

STEP 02

Exchange code for access token

On your callback page, validate the state token and exchange the authorization code and verifier for a user access token.

STEP 03

Run inference billed to user wallet

Instantiate the Zorveus client using the user's access token. All model completion calls are debited directly from the user's wallet.

Terminal: 1. OAuth Redirect
# 1. Generate PKCE verifier & S256 challenge
# 2. Redirect user browser to authorization URL:
https://api.zorveus.com/oauth/authorize\
  ?client_id=YOUR_CLIENT_ID\
  &redirect_uri=https://myapp.com/oauth/callback\
  &response_type=code\
  &scope=inference:write%20models:*\
  &code_challenge=CODE_CHALLENGE\
  &code_challenge_method=S256
Terminal: 2. Token Exchange
# Exchange authorization code for user access token
curl -X POST https://api.zorveus.com/oauth/token \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "YOUR_CLIENT_ID",
    "grant_type": "authorization_code",
    "code": "AUTH_CODE_FROM_CALLBACK",
    "code_verifier": "PKCE_CODE_VERIFIER",
    "redirect_uri": "https://myapp.com/oauth/callback"
  }'
Terminal: 3. Inference Request
# Execute model completion using user access_token as Bearer token
curl -X POST https://api.zorveus.com/v1/chat/completions \
  -H "Authorization: Bearer zrv_usr_live_9f8e7d6c5b" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4o",
    "messages": [
      {"role": "user", "content": "Summarize Q3 financial report."}
    ]
  }'
1-initiate-auth.ts
import { ZorveusOAuth } from "@zorveus/sdk";

// 1. Generate PKCE verifier, S256 challenge, and state CSRF token
const pkce = ZorveusOAuth.generatePKCE();

sessionStorage.setItem("zorveus_code_verifier", pkce.codeVerifier);
sessionStorage.setItem("zorveus_auth_state", pkce.state);

// 2. Build authorization URL (requests inference & model access)
const authUrl = ZorveusOAuth.getAuthorizationUrl({
  clientId: process.env.NEXT_PUBLIC_ZORVEUS_CLIENT_ID!,
  redirectUri: "https://myapp.com/oauth/callback",
  state: pkce.state,
  codeChallenge: pkce.codeChallenge,
  scopes: ["inference:write", "models:*"],
});

// 3. Redirect browser to Zorveus authorization consent page
window.location.href = authUrl;
2-exchange-token.ts
import { ZorveusOAuth } from "@zorveus/sdk";

// 1. Read stored state & verifier on callback page
const savedState = sessionStorage.getItem("zorveus_auth_state");
const codeVerifier = sessionStorage.getItem("zorveus_code_verifier");

// 2. Validate callback state CSRF token
const validation = ZorveusOAuth.validateCallback(window.location.href, savedState);

// 3. Exchange authorization code for user access token
const tokenResponse = await ZorveusOAuth.exchangeToken({
  clientId: process.env.NEXT_PUBLIC_ZORVEUS_CLIENT_ID!,
  code: validation.code!,
  codeVerifier: codeVerifier!,
  redirectUri: "https://myapp.com/oauth/callback",
});

// Note: The OAuth access_token IS the user's API key for inference
const userApiKey = tokenResponse.access_token;
3-run-inference-zorveus.ts
import { Zorveus } from "@zorveus/sdk";

// 1. Initialize Zorveus client using the user's access_token as the API key
const client = new Zorveus({ apiKey: userApiKey });

// 2. Execute AI inference charged directly to the user's wallet
const response = await client.chat.completions.create({
  model: "openai/gpt-4o",
  messages: [{ role: "user", content: "Summarize Q3 financial report." }],
});

console.log(response.choices[0].message.content);
3-run-inference-openai-sdk.ts
import OpenAI from "openai";

// 1. Point Official OpenAI SDK to Zorveus Edge gateway proxy
const openai = new OpenAI({
  baseURL: "https://api.zorveus.com/v1",
  apiKey: userApiKey, // OAuth access_token acts as the API key
});

// 2. Standard OpenAI API call billed directly to user's wallet
const response = await openai.chat.completions.create({
  model: "gpt-4o",
  messages: [{ role: "user", content: "Summarize Q3 financial report." }],
});

console.log(response.choices[0].message.content);
3-run-inference-zorveus-openai.ts
import { ZorveusOpenAI } from "@zorveus/sdk/openai";

// 1. Initialize ZorveusOpenAI adapter with user access_token as the API key
const client = new ZorveusOpenAI({ apiKey: userApiKey });

// 2. Standard OpenAI API call billed directly to user's wallet
const response = await client.chat.completions.create({
  model: "openai/gpt-4o",
  messages: [{ role: "user", content: "Summarize Q3 financial report." }],
});

console.log(response.choices[0].message.content);
3-run-inference-vercel-ai.ts
import { createOpenAI } from "@ai-sdk/openai";
import { generateText } from "ai";

// 1. Create OpenAI provider pointing to Zorveus Edge gateway
const zorveus = createOpenAI({
  baseURL: "https://api.zorveus.com/v1",
  apiKey: userApiKey, // OAuth access_token acts as the API key
});

// 2. Generate text using Vercel AI SDK billed to user wallet
const { text } = await generateText({
  model: zorveus("openai/gpt-4o"),
  prompt: "Summarize Q3 financial report.",
});

console.log(text);
1_initiate_auth.py
from zorveus import ZorveusOAuth

# 1. Generate PKCE parameters for OAuth flow
pkce = ZorveusOAuth.generate_pkce()
session["code_verifier"] = pkce.code_verifier
session["oauth_state"] = pkce.state

# 2. Build authorization URL
auth_url = ZorveusOAuth.get_authorization_url(
    client_id="YOUR_CLIENT_ID",
    redirect_uri="https://myapp.com/oauth/callback",
    state=pkce.state,
    code_challenge=pkce.code_challenge,
    scopes=["inference:write", "models:*"],
)

# 3. Redirect user browser to auth_url
2_exchange_token.py
from zorveus import ZorveusOAuth

# Read query parameters and saved session state
saved_verifier = session.get("code_verifier")

# Exchange authorization code for user access token
token_data = ZorveusOAuth.exchange_token(
    client_id="YOUR_CLIENT_ID",
    code=auth_code,
    code_verifier=saved_verifier,
    redirect_uri="https://myapp.com/oauth/callback",
)

# Note: The OAuth access_token IS the user's API key for inference
user_api_key = token_data.access_token
3_run_inference_zorveus.py
from zorveus import Zorveus

# 1. Instantiate client with user access_token as the API key
client = Zorveus(api_key=user_api_key)

# 2. Execute AI inference charged directly to user wallet
response = client.chat.completions.create(
    model="openai/gpt-4o",
    messages=[{"role": "user", "content": "Summarize Q3 financial report."}],
)

print(response.choices[0].message.content)
3_run_inference_openai_sdk.py
from openai import OpenAI

# 1. Point official OpenAI SDK to Zorveus Edge gateway proxy
client = OpenAI(
    base_url="https://api.zorveus.com/v1",
    api_key=user_api_key,  # OAuth access_token acts as the API key
)

# 2. Standard OpenAI API call billed directly to user wallet
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Summarize Q3 financial report."}],
)

print(response.choices[0].message.content)
3_run_inference_zorveus_openai.py
from zorveus.openai import ZorveusOpenAI

# 1. Instantiate OpenAI SDK adapter with user access_token as the API key
client = ZorveusOpenAI(api_key=user_api_key)

# 2. Standard OpenAI API call billed directly to user wallet
response = client.chat.completions.create(
    model="openai/gpt-4o",
    messages=[{"role": "user", "content": "Summarize Q3 financial report."}],
)

print(response.choices[0].message.content)

Simplified Architecture

Monetize your AI app without collecting credit cards

Connect end-user wallets with OAuth 2.0 PKCE. Zorveus meters usage and handles billing across providers.

Direct user wallet billing

Usage is charged directly to the user's Zorveus wallet. You never touch credit card details, Stripe invoices, or PCI compliance.

Hard user spend caps

Users configure their monthly budget allowance during OAuth consent. Requests halt at the gateway before any overages occur.

Multi-model provider access

Pass the user's access token to run completions across OpenAI, Anthropic, and Gemini models using a single unified gateway.

Official client SDKs

Open source libraries available on npm and PyPI.

npm i @zorveus/sdk
npm i @zorveus/react
pip install zorveus
GitHub

Start building in under 5 minutes

Create a developer workspace, register your client application, and connect your first user wallet.