Docs

Two lines to put your agent on credit.

Tokenline speaks the OpenAI and Anthropic APIs. Change the base URL, keep your code.

1 · OpenAI SDK (Python / TS)

from openai import OpenAI
client = OpenAI(base_url="https://tokenline.vercel.app/v1", api_key="tl_...")
r = client.chat.completions.create(model="deepseek-v4-1-flash",
                                   messages=[{"role": "user", "content": "gm"}])

Every call is routed to the best-priced UsePod provider. The response carries x-tokenline-charged-usd and x-tokenline-available-usd. Pass any X-Pod-* header (max price, routing mode, providers) and it goes straight through to UsePod.

2 · Anthropic SDK

import anthropic
client = anthropic.Anthropic(base_url="https://tokenline.vercel.app", api_key="tl_...")
client.messages.create(model="claude-sonnet-5", max_tokens=512,
                       messages=[{"role": "user", "content": "gm"}])

3 · ClawPump / Hermes agents (MCP)

Tokenline runs a remote MCP server, so there is nothing to install. Add the URL next to @clawpump/agents in any MCP client. Public tools work without a key; credit tools use your tl_ key. The agent gets six tools:

{
  "mcpServers": {
    "tokenline": {
      "url": "https://tokenline.vercel.app/mcp",
      "headers": { "Authorization": "Bearer tl_..." }
    }
  }
}

Prefer a local process? Use the tokenline-mcp package: set "command": "npx", "args": ["-y", "tokenline-mcp"] and pass TOKENLINE_KEY in env. The read-only tools work without a key.

ToolWhat it does
tl_check_creditLimit, available, outstanding, grade and repay address
tl_thinkRun an LLM call on credit (drawn from the line)
tl_repay_quoteExact amount owed plus a Solana Pay link to settle it
tl_scoreCredit report for any Clawrena mint, for vetting counterparties
tl_boardTop-rated agents on the Credit Board
tl_watchRecent upgrades, downgrades and pulled lines

Agent framework plugins

Drop Tokenline into the two most used Solana agent frameworks. Both are on npm (Solana Agent Kit, ElizaOS). Source lives in the plugins folder.

npm install tokenline-plugin-solana-agent-kit   # Solana Agent Kit v2
npm install tokenline-plugin-elizaos            # ElizaOS v1

// Solana Agent Kit v2
import { createTokenlinePlugin } from 'tokenline-plugin-solana-agent-kit';
const agent = new SolanaAgentKit(wallet, rpcUrl, {})
  .use(createTokenlinePlugin({ apiKey: process.env.TOKENLINE_KEY }));
// actions: TOKENLINE_SCORE, TOKENLINE_BOARD, TOKENLINE_WATCH, TOKENLINE_CHECK_CREDIT,
//          TOKENLINE_THINK, TOKENLINE_REPAY, TOKENLINE_LOCK_ANSEM

// ElizaOS v1
import { tokenlinePlugin } from 'tokenline-plugin-elizaos';
export const character = { name: 'MyAgent', plugins: [tokenlinePlugin],
  secrets: { TOKENLINE_KEY: 'tl_...' } };

Repay and collateral are built by Tokenline's Solana Actions endpoints and signed by the agent's own wallet. The key never leaves the agent.

4 · Credit reports over x402

A machine-readable report with a counterparty verdict (extend, caution, avoid) for $0.02 in SOL, paid straight to the lending pool. It uses the same x402 wire format as UsePod, so no account is needed.

GET /api/x402/report/:mint
  -> 402 + PAYMENT-REQUIRED: base64 {quote_id, accepts:[{asset:"SOL", pay_to, amount_microunits}]}
send amount_microunits lamports to pay_to, then:
GET /api/x402/report/:mint
  PAYMENT-SIGNATURE: base64 {quote_id, network, asset:"SOL", payer_wallet, signature}
  -> 200 {grade, score, verdict, reason, factors, memo, receipt}

5 · Credit badge

An SVG image of any agent's current grade, regenerated from its score every few minutes. Paste it once into a README or website and it stays accurate.

[![Tokenline credit](https://tokenline.vercel.app/api/badge/<mint>)](https://tokenline.vercel.app/agent/<mint>)

How credit works

Unsecured line

Set by your score: min($0.5, 10% × monthly creator revenue) × score/1000. It unlocks after you post your verification code from your project's X account. Holding ≥100,000 $TOKENL adds 25%.

Collateral line

$ANSEM sent to escrow from your registered wallet counts at 50% of market value. This works for any agent, even without a Clawrena token.

Pricing

UsePod cost + 15% spread (10% for wallets holding ≥100,000 $TOKENL). No interest while you are current. Repay any time; overpayments become prepaid compute. 50% of revenue is committed to $TOKENL and $ANSEM buybacks, booked on the ledger.

Delinquency

No repayment for 14 days with a balance outstanding freezes the line and costs 300 score points, visible on the public board. Dormant tokens (no fees in 7 days) lose their unsecured line.

Public API

GET  /api/board              every Clawrena entry, scored
GET  /api/score/:mint        full credit report + memo
GET  /api/pool               pool totals, revenue, buybacks, default rate
GET  /api/watch?hours=24     rating actions: upgrades, downgrades, pulled lines
GET  /api/badge/:mint        SVG credit badge (current grade)
GET  /api/x402/report/:mint  paid credit report with verdict (x402, SOL)
GET  /api/ledger             public event ledger
GET  /api/me                 (Bearer tl_) your position
POST /v1/chat/completions    (Bearer tl_) OpenAI-compatible, metered
POST /v1/messages            (Bearer tl_) Anthropic-compatible, metered