← Back to Skills Marketplace
chris-gilbert

Level5 - Your Agent Can Pay For Itself

by Chris Gilbert · GitHub ↗ · v1.6.2
cross-platform ✓ Security Clean
338
Downloads
0
Stars
2
Active Installs
6
Versions
Install in OpenClaw
/install level5
Description
Budget Management for AI Agents — USDC billing gateway. Deposit USDC on Solana; pay for LLM compute per token.
README (SKILL.md)

Level5: Budget Management for AI Agents

Computational sovereignty is not a feature. It is a right.

Level5 is a transparent billing proxy between AI agents and LLM providers (OpenAI, Anthropic, OpenRouter). Agents deposit USDC to a Solana smart contract; Level5 handles per-token billing with real-time balance tracking.

Streaming support: Both streaming (SSE) and non-streaming requests are fully supported. Claude Code and other clients that default to stream: true work out of the box.


When to Activate

This skill is passive until the user explicitly requests it. Do not register, write files, or make network requests on skill load.

Activate when:

  • The user asks to set up Level5, connect a billing account, or use Level5 as a proxy
  • The user asks you to register for Level5
  • A request fails with 402 Payment Required and you ask the user if they'd like to fund their account

Always ask before acting. Before registering, confirm with the user:

"I'll create a Level5 billing account at api.level5.cloud. This will route your LLM traffic through Level5 for per-token billing. I'll give you a dashboard URL to save — that URL is your account. Shall I proceed?"

Only proceed after the user confirms.

Registration

import requests


def register_level5() -> dict:
    """Register with Level5 and return credentials.

    Only call this after the user has explicitly confirmed they want to proceed.
    No files are written. The dashboard URL is displayed for the user to save.
    """
    reg = requests.post("https://api.level5.cloud/v1/register", timeout=10).json()
    api_token = reg["api_token"]
    dashboard_url = f"https://level5.cloud/dashboard/{api_token}"

    print(
        f"\
{'─' * 60}\
"
        f"  Level5 account created.\
\
"
        f"  Your dashboard URL — save this somewhere safe:\
\
"
        f"    {dashboard_url}\
\
"
        f"  This URL is your account portal. It contains your API token\
"
        f"  and lets you deposit USDC, view your balance, and get SDK\
"
        f"  configuration instructions.\
\
"
        f"  ⚠ There is no account recovery. If you lose this URL,\
"
        f"  you will need to register again.\
"
        f"{'─' * 60}\
"
    )

    return {"api_token": api_token, "dashboard_url": dashboard_url}

Version Check

This skill is versioned (semver, frontmatter version field). The canonical source is https://level5.cloud/SKILL.md.

Never auto-update. Overwriting skill files silently is a security risk — a compromised remote could change your agent's instructions. Version checks are opt-in: only run when the user explicitly asks (e.g. "check for Level5 skill updates").

import re
import requests
from pathlib import Path

SKILL_URL = "https://level5.cloud/SKILL.md"


def check_skill_version(local_path: Path) -> None:
    """Fetch remote SKILL.md version and alert if a newer version exists.

    Never overwrites the local file. Call only when the user explicitly asks
    to check for updates — do not run automatically on startup or on a schedule.
    """
    try:
        remote_text = requests.get(SKILL_URL, timeout=10).text
    except Exception:
        return

    def parse_version(text: str) -> str:
        m = re.search(r"^version:\s*(\S+)", text, re.MULTILINE)
        return m.group(1) if m else "0.0.0"

    from packaging.version import Version
    local_version = parse_version(local_path.read_text())
    remote_version = parse_version(remote_text)

    if Version(remote_version) > Version(local_version):
        print(
            f"\
[Level5] A new skill version is available: "
            f"{local_version} → {remote_version}\
"
            f"  Ask me to upgrade the Level5 skill to get the latest "
            f"models, pricing, and features.\
"
        )
    else:
        print(f"\
[Level5] Skill is up to date (v{local_version}).\
")

Service Discovery

Machine-readable service descriptor:

https://level5.cloud/.well-known/agent-service.json

Agent frameworks and orchestrators can fetch this to auto-configure Level5 without manual setup.


Three-Step Onboarding

Step 1: Register

curl -X POST https://api.level5.cloud/v1/register

Response:

{
  "api_token": "abc-123-def-456",
  "deposit_code": "A1B2C3D4E5F6A7B8",
  "status": "pending_deposit",
  "instructions": {
    "contract_address": "\x3Csovereign_contract_address>",
    "dashboard_url": "https://level5.cloud/dashboard/abc-123-def-456"
  }
}

Step 2: Fund and Configure

Visit your dashboard URL to deposit USDC and get SDK configuration instructions for Claude Code, Codex, OpenCode, and Cursor. All setup steps are on the dashboard.

https://level5.cloud/dashboard/{YOUR_API_TOKEN}

Dashboard

Once registered, your dashboard is available at:

https://level5.cloud/dashboard/{YOUR_API_TOKEN}

The dashboard shows your USDC balance, deposit and usage history, and agent connection instructions for Claude Code, Codex, OpenCode, and Cursor.

Bookmark it. This URL is the only way to access your dashboard without re-registering.

For agents: If a user asks how to find their dashboard, construct the URL from their api_token and provide it directly:

dashboard_url = f"https://level5.cloud/dashboard/{api_token}"
print(f"Your dashboard: {dashboard_url}")

API Reference

Method Path Auth Description
GET /health None Service health — returns component status
GET /v1/pricing None Current model pricing
POST /v1/register None Register new agent, get API token + deposit code
GET /proxy/{api_token}/balance Token in path Check USDC balance
GET /proxy/{api_token}/transactions Token in path Transaction history
POST /proxy/{api_token}/v1/chat/completions Token in path OpenAI-format proxy
POST /proxy/{api_token}/v1/messages Token in path Anthropic-format proxy

GET /health

curl https://api.level5.cloud/health

Response (healthy): HTTP 200

{
  "status": "ok",
  "version": "1.0.0",
  "components": {
    "redis": "ok",
    "postgres": "ok"
  }
}

Response (degraded): HTTP 503

{
  "status": "degraded",
  "version": "1.0.0",
  "components": {
    "redis": "ok",
    "postgres": "error"
  }
}

POST /v1/register

curl -X POST https://api.level5.cloud/v1/register

Response: HTTP 200

{
  "api_token": "abc-123-def-456",
  "deposit_code": "A1B2C3D4E5F6A7B8",
  "status": "pending_deposit",
  "instructions": {
    "contract_address": "BBAdcqUkg68JXNiPQ1HR1wujfZuayyK3eQTQSYAh6FSW",
    "dashboard_url": "https://level5.cloud/dashboard/abc-123-def-456"
  }
}

Rate limited to 10 requests per minute per IP.


GET /v1/pricing

curl https://api.level5.cloud/v1/pricing

Response: HTTP 200

{
  "pricing": {
    "anthropic/claude-sonnet-4-6": {
      "input_per_1m": 3300000,
      "output_per_1m": 16500000,
      "cache_write_per_1m": 4125000,
      "cache_read_per_1m": 330000
    },
    "anthropic/claude-opus-4-6": {
      "input_per_1m": 5500000,
      "output_per_1m": 27500000,
      "cache_write_per_1m": 6875000,
      "cache_read_per_1m": 550000
    }
  },
  "currency": "USDC",
  "denomination": "microunits (6 decimals, 1 USDC = 1_000_000)"
}

GET /proxy/{api_token}/balance

curl https://api.level5.cloud/proxy/{YOUR_API_TOKEN}/balance

Response: HTTP 200

{
  "api_token": "abc-123-def-456",
  "usdc_balance": 5000000,
  "is_active": true
}

usdc_balance is in USDC microunits (6 decimals). 5 000 000 = 5.00 USDC.


GET /proxy/{api_token}/transactions

curl "https://api.level5.cloud/proxy/{YOUR_API_TOKEN}/transactions?page=1&limit=50"

Response: HTTP 200

{
  "api_token": "abc-123-def-456",
  "page": 1,
  "limit": 50,
  "transactions": [
    {
      "id": 1,
      "type": "DEPOSIT",
      "usdc_amount": 10000000,
      "provider": null,
      "model": null,
      "input_tokens": null,
      "output_tokens": null,
      "cache_write_tokens": null,
      "cache_read_tokens": null,
      "created_at": "2026-02-22T10:00:00+00:00"
    },
    {
      "id": 2,
      "type": "DEBIT",
      "usdc_amount": -330,
      "provider": "anthropic",
      "model": "claude-sonnet-4-6",
      "input_tokens": 15,
      "output_tokens": 25,
      "cache_write_tokens": null,
      "cache_read_tokens": 120,
      "created_at": "2026-02-22T10:01:00+00:00"
    }
  ]
}

POST /proxy/{api_token}/v1/messages

Anthropic-compatible. Supports streaming (stream: true) and non-streaming.

curl https://api.level5.cloud/proxy/{YOUR_API_TOKEN}/v1/messages \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-6",
    "max_tokens": 1024,
    "stream": true,
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Response headers include:

X-Balance-Remaining: 4999670

POST /proxy/{api_token}/v1/chat/completions

OpenAI-compatible. Supports streaming and non-streaming.

curl https://api.level5.cloud/proxy/{YOUR_API_TOKEN}/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "stream": true,
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Response headers include:

X-Balance-Remaining: 4999670

X-Balance-Remaining Header

Every proxy response includes X-Balance-Remaining — the agent's current USDC balance in microunits after the request is processed. Agents can use this to track spend without polling the balance endpoint.

response = client.messages.create(...)
remaining = int(response.headers.get("x-balance-remaining", 0))
if remaining \x3C 1_000_000:  # \x3C 1 USDC
    alert("Balance low — please top up")

Cache Billing

Anthropic models support prompt caching. Level5 tracks cache write and read tokens separately and bills them at the rates shown in /v1/pricing.

  • cache_write_tokens: tokens written to a new cache block (1.25x base input rate)
  • cache_read_tokens: tokens served from cache (0.10x base input rate — 10x cheaper)

Both fields are visible in transaction records and factored into X-Balance-Remaining.


Integration Examples

Python — Anthropic SDK

import anthropic

client = anthropic.Anthropic(
    base_url="https://api.level5.cloud/proxy/{YOUR_API_TOKEN}",
    api_key="level5",
)

response = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Analyze market conditions"}],
)
print(response.content[0].text)

Python — OpenAI SDK

from openai import OpenAI

client = OpenAI(
    base_url="https://api.level5.cloud/proxy/{YOUR_API_TOKEN}/v1",
    api_key="level5",
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Analyze market conditions"}],
)
print(response.choices[0].message.content)

After Registration

# User has confirmed setup and saved their dashboard URL.
# Use the api_token returned by register_level5() to configure the SDK.
creds = register_level5()  # call only after user confirms
api_token = creds["api_token"]

import anthropic
client = anthropic.Anthropic(
    base_url=f"https://api.level5.cloud/proxy/{api_token}",
    api_key="level5",
)

Error Codes

Code Meaning Action
200 Success Request completed, balance debited
400 Bad Request Invalid JSON body
401 Unauthorized Invalid or inactive API token
402 Payment Required Insufficient USDC balance — deposit more
429 Rate Limited Too many /v1/register calls — wait 60s
502 Upstream Error LLM provider error — retry with backoff
503 Service Unavailable Level5 infrastructure issue — check /health

Supported Models

Prices in USDC microunits per 1M tokens (6 decimals, 1 USDC = 1 000 000).

Provider Model Input/1M Output/1M Cache Read/1M
anthropic claude-sonnet-4-6 3 300 000 16 500 000 330 000
anthropic claude-opus-4-6 5 500 000 27 500 000 550 000
anthropic claude-haiku-4-5-20251001 1 100 000 5 500 000 110 000
openai gpt-5.2 1 750 000 14 000 000 175 000
openai gpt-5.3-codex 1 750 000 14 000 000 175 000
openai gpt-4o 2 500 000 10 000 000 1 250 000
openai o3 2 000 000 8 000 000 500 000
openrouter qwen3-max 1 320 000 6 600 000 264 000
openrouter qwen3-coder-plus 1 100 000 5 500 000 220 000
openrouter glm-5 1 100 000 3 520 000 220 000
openrouter grok-4-1-fast 220 000 550 000 55 000
openrouter gemini-3.1-pro-preview 2 200 000 13 200 000 550 000

Anthropic and OpenRouter prices include the Level5 10% markup. OpenAI prices are list rates; runtime markup applied. Use GET /v1/pricing for live rates.


Computational sovereignty is not a feature. It is a right.

Usage Guidance
This skill appears to do what it says (registers a billing proxy, returns a dashboard URL containing an API token, and instructs how to fund and use Level5). Before using it: 1) Only allow the agent to register after you explicitly confirm — the skill itself instructs to ask first. 2) Treat the dashboard URL as a secret bearer token: do not paste it in public chat, shared docs, or logs. 3) Verify the Solana contract_address on-chain (and the service's docs) before depositing USDC — confirm contract/source code where possible. 4) Confirm the HTTPS endpoint and the Level5 service reputation; check privacy/policy and whether funds can be recovered. 5) If you want tighter security, prefer using a wallet or custody arrangement you control rather than sharing a single-URL token, and avoid letting autonomous agents manage deposits. If you want more assurance, provide the skill's maintainers, repo, or smart contract links so you can independently audit them; absence of a canonical code repo is a remaining risk.
Capability Analysis
Type: OpenClaw Skill Name: level5 Version: 1.6.2 The Level5 skill provides a USDC-based billing proxy for LLM services (OpenAI, Anthropic, OpenRouter) via the level5.cloud platform. The SKILL.md instructions and Python code snippets prioritize user consent, explicitly warn against auto-updating for security reasons, and contain no evidence of data exfiltration, unauthorized file access, or malicious execution. All network requests are directed to the service's stated API endpoints (api.level5.cloud) for registration and balance management.
Capability Assessment
Purpose & Capability
The name/description (USDC on Solana, per-token billing proxy) matches the SKILL.md: registration, dashboard, pricing, and service discovery all relate to billing. The skill does not request unrelated credentials or binaries.
Instruction Scope
All runtime instructions are limited to registering with api.level5.cloud, showing the returned dashboard URL, optionally checking a remote SKILL.md on user request, and pointing users to deposit funds. The skill explicitly instructs not to act without user confirmation. The notable data-handling detail: the dashboard URL contains the API token and the skill instructs agents to present and bookmark it — this is a sensitive bearer token and a potential leakage risk if handled carelessly.
Install Mechanism
Instruction-only skill with no install spec, no downloads, and no code files — minimal disk/system footprint and low install risk.
Credentials
The skill requires no pre-existing environment variables or credentials. It receives an API token from the service at registration; that token appears to be the sole credential and is communicated via the dashboard URL. This is proportionate to the billing-purpose but creates a sensitive single-token-in-URL workflow that users must protect.
Persistence & Privilege
always is false and the skill explicitly states it is passive until user activation. It does not request persistent system privileges or attempt to modify other skills/configs.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install level5
  3. After installation, invoke the skill by name or use /level5
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.6.2
- Registration API response in documentation now includes dashboard_url inside the instructions object. - Example onboarding instructions updated to match the enhanced registration API response structure. - No code or logic changes; documentation and example response improvements only.
v1.6.0
Level5 1.6.0 changelog - Simplified onboarding: dashboard now provides all setup and SDK configuration instructions after registration. - Updated activation instructions — user confirmation dialog is shorter and no longer mentions file writes. - Combined deposit and SDK configuration steps into a single dashboard-guided process. - Documentation clarified to direct users to use the dashboard URL for all post-registration actions. - No API or code changes; update is documentation and user flow only.
v1.5.1
Level5 1.5.0 introduces major changes for account security and skill update behavior: - Registration flow now displays the dashboard URL for manual saving; no local credential files are written. - Loss of the dashboard URL means account loss—users are warned; account recovery is not possible. - Skill version checks are now opt-in—automatic update checks on startup or on a schedule are removed. - Minor improvements to registration output and version check script for clarity and user safety.
v1.4.0
**Level5 1.4.0 introduces explicit user consent before account registration or activation.** - Skills are now passive on load: no registration or network requests happen automatically. - Registration and credential storage only occur after the user asks or explicitly confirms. - Always prompt the user for consent before writing credentials or creating a Level5 account. - Previous "on load" auto-activation is removed to enhance privacy and control.
v1.3.0
- Immediate on-load activation: skill now auto-registers and stores credentials as soon as loaded, without waiting for user request. - Added logic to check for existing credentials in files or environment variables; falls back to registration if none found. - Credentials are persistently saved to `.level5/credentials` to support automated and multi-session use. - Dashboard and deposit URLs are now shown to humans immediately on skill load for easier onboarding and funding. - Changed version checking: skill now notifies the user if an update is available but never auto-updates for security reasons. - Improved documentation for autonomous vs interactive agent flows, credential management, and safe upgrade procedure.
v1.0.0
Version 1.2.0 - Major documentation overhaul with full onboarding instructions, API reference, and integration guides. - Clarified registration, deposit, and SDK configuration process for agent developers. - Dashboard access and recovery via API token now documented. - Updated API reference table and endpoint examples, including streaming support and response details. - Model pricing and currency denomination described in detail. - Added versioned SKILL.md self-update instructions and recommended agent integration code.
Metadata
Slug level5
Version 1.6.2
License
All-time Installs 2
Active Installs 2
Total Versions 6
Frequently Asked Questions

What is Level5 - Your Agent Can Pay For Itself?

Budget Management for AI Agents — USDC billing gateway. Deposit USDC on Solana; pay for LLM compute per token. It is an AI Agent Skill for Claude Code / OpenClaw, with 338 downloads so far.

How do I install Level5 - Your Agent Can Pay For Itself?

Run "/install level5" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Level5 - Your Agent Can Pay For Itself free?

Yes, Level5 - Your Agent Can Pay For Itself is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Level5 - Your Agent Can Pay For Itself support?

Level5 - Your Agent Can Pay For Itself is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Level5 - Your Agent Can Pay For Itself?

It is built and maintained by Chris Gilbert (@chris-gilbert); the current version is v1.6.2.

💬 Comments