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.
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.
# 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# 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# 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"
}'# 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"
}'# 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."}
]
}'# 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."}
]
}'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;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;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;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;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);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);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);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);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);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);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);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);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_urlfrom 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_urlfrom 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_tokenfrom 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_tokenfrom 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)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)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)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)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)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.
Start building in under 5 minutes
Create a developer workspace, register your client application, and connect your first user wallet.