Docs

OpenAI-compatible model router

Point any OpenAI SDK at /api/v1. Set "web_search": true and TENON reads every URL in the prompt as clean Markdown before the model answers. Responses stream over SSE and each one returns an axon_receipt.

POST /api/v1/chat/completions
Authorization: Bearer axk_live_...

{
  "model": "openai/gpt-6.2-sol",
  "stream": true,
  "web_search": true,
  "messages": [{ "role": "user", "content": "Summarize https://v4.fun" }]
}

x402 pay-per-request

A request without a key gets 402 Payment Required with a base64 PAYMENT-REQUIRED header. Its accepts list names every network this deployment can settle: USDG on Robinhood Chain (eip155:4663, sign an EIP-3009 TransferWithAuthorization offline) and USDC on Solana (solana:5eykt4Us…). Retry with PAYMENT-SIGNATURE.

# 1. The server answers 402 with PAYMENT-REQUIRED (eip155:4663 USDG and/or Solana USDC)
# 2. Retry with the signed payment:
curl -X POST https://tenon.example/api/v1/chat/completions \
  -H "PAYMENT-SIGNATURE: <base64_x402_payload>" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-6.2-sol","messages":[{"role":"user","content":"ping"}]}'

On Solana the payload carries a base64 transaction instead of an authorization: one USDC TransferChecked from your token account to the payTo treasury's USDC account, signed by you, with extra.feePayer as fee payer. TENON checks every instruction before co-signing as fee payer, so you pay no SOL. Only compute-budget, one memo, and that single transfer are accepted.

{
  "x402Version": 1,
  "scheme": "exact",
  "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
  "payload": { "transaction": "<base64 VersionedTransaction, payer-signed, feePayer = extra.feePayer>" }
}

Remote MCP server

Streamable HTTP at /api/mcp with nine JSON-RPC tools: get_balance, list_models, chat_completion, scrape_url, list_sandboxes, create_sandbox, exec_sandbox, kill_sandbox, and list_receipts.

POST /api/mcp
Authorization: Bearer axk_live_...

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": { "name": "get_balance", "arguments": {} }
}

Live browser API

POST /api/v1/browsers starts a real headless Chromium page (1280×800) billed per second. Stream it over /ws/browser/:id as JPEG frames, or drive it over REST with navigate, click, scroll, type, key, back, forward, and reload. Private and internal addresses are refused.

POST /api/v1/browsers            { "url": "https://example.com" }
POST /api/v1/browsers/:id        { "action": "click", "x": 640, "y": 320 }
POST /api/v1/browsers/:id        { "action": "type", "text": "tenon" }
GET  /api/v1/browsers/:id?frame=jpeg   → image/jpeg of the current viewport
DELETE /api/v1/browsers/:id      → stops billing

Health and operations

GET /api/health reports secrets, database, chain, contracts, and the model, computer, and browser drivers. Add ?deep=1 with the internal secret to check the RPC, contract bytecode, operator gas, and provider keys live. The same report prints from npm run doctor. Hours seal automatically at :15 UTC; POST /api/internal/settle-hour and /api/internal/earn-round stay available for external cron.

curl -s https://your-host/api/health | jq '.status, .checks[] | {id, status, detail}'
curl -s -H "Authorization: Bearer $INTERNAL_SETTLE_SECRET" "https://your-host/api/health?deep=1"

Contracts on Robinhood Chain

  • AxonCredits.sol

    Holds USDG, stock-token swaps, and $TNN in two buckets. Unspent principal is refundable without gas, and the $TNN behind spent credits burns at :15 every hour to 0x…dEaD.

  • AxonReceipts.sol

    Stores one double-hashed OpenZeppelin StandardMerkleTree root per hour and verifies any receipt against it.

  • AxonEarn.sol

    Converts v4.fun creator fees into tokenized $ANT and pays it to $TNN holders every hour.

Solana and $TNN

Solana is a first-class network next to Robinhood Chain. Sign in with Phantom, Solflare, or Backpack (one free signMessage), buy credits with USDC sent to the treasury (verified by transaction signature), and refund unspent USDC without gas: you sign a single-use message and TENON sends the transfer and pays the fee. Every hourly Merkle root is also written as an SPL Memo tenon:merkle:v1:<hour>:<root>:<count>, linked from Receipts on Solscan.

$TNN has not been issued yet. It will launch on Solana. Until then there is no $TNN contract or mint, the holder allowance stays locked, and /api/health reports solana_tnn as off. Any address presented as $TNN before launch is not ours.

POST /api/auth/nonce   { "address": "<base58 wallet>", "chain": "solana" }
POST /api/auth/verify  { "address": "...", "message": "...", "signature": "<base64|base58|hex>", "chain": "solana" }
POST /api/v1/billing   { "action": "deposit", "txHash": "<base58 signature>" }
POST /api/v1/billing   { "action": "refund_prepare" }   → message to sign
POST /api/v1/billing   { "action": "refund", "message": "...", "signature": "...", "deadline": "..." }