{"openapi":"3.1.0","info":{"title":"OneNess TOR API","version":"2.0.0","description":"Every endpoint the node, the pages and the Ollama command brain share."},"servers":[{"url":"https://www.torblockchain.fun"}],"components":{"securitySchemes":{"AdminToken":{"type":"apiKey","in":"header","name":"x-admin-token"},"WalletSession":{"type":"apiKey","in":"header","name":"x-wallet-session"},"ApiKey":{"type":"apiKey","in":"header","name":"x-api-key"}}},"paths":{"/api/health":{"get":{"operationId":"chain_health","summary":"Node liveness, height and whether the Rust node is reachable.","tags":["chain"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/chain/info":{"get":{"operationId":"chain_info","summary":"Chain id, height, head/genesis hash, supply, founder, fee receiver, public window, coin.","tags":["chain"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/chain/verify":{"get":{"operationId":"chain_verify","summary":"Live supply + founder balance snapshot proving the ledger is intact.","tags":["chain"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/chain/sync":{"get":{"operationId":"chain_sync","summary":"Sync + replication status: role (origin/replica), the configured origin, the onion link, the block-range catch-up endpoint and the snapshot endpoints.","tags":["chain"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/chain/sync/audit":{"get":{"operationId":"chain_sync_audit","summary":"AUTOMATED SYNC CHECK \u2014 fetch every block from the node, re-hash each one (sha3-256 over the canonical block payload), walk prev_hash links, compare genesis/head and probe each configured peer.","tags":["chain"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/chain/sync/snapshot":{"get":{"operationId":"chain_sync_snapshot","summary":"THE REPLICATION SOURCE \u2014 the whole ledger (state + every block + txs) as one verifiable snapshot, straight from this node's Rust ledger. A replica pulls this.","tags":["chain"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"security":[{"AdminToken":[]}]}},"/api/chain/sync/pull":{"post":{"operationId":"chain_sync_pull","summary":"REPLICA PULL \u2014 fetch the origin snapshot, re-hash every block + the state root here, then import it into this node's ledger (state.json + blocks.jsonl swapped atomically). Refuses to roll back unless force=true.","tags":["chain"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"origin":{"type":"string"},"force":{"type":"boolean"},"origin_token":{"type":"string"}}}}}},"security":[{"AdminToken":[]}]}},"/api/chain/blocks":{"get":{"operationId":"chain_blocks","summary":"A block range, oldest first \u2014 the endpoint peers use to catch up.","tags":["chain"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"integer"}},{"name":"to","in":"query","required":false,"schema":{"type":"integer"}}]}},"/api/chain/block/{ref}":{"get":{"operationId":"chain_block","summary":"One block by height or by hash.","tags":["chain"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/chain/tx/{txid}":{"get":{"operationId":"chain_tx","summary":"One record; records past the public window need the node operator's admin session.","tags":["chain"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"txid","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/chain/events":{"get":{"operationId":"chain_events","summary":"Events still inside the 30-day public window.","tags":["chain"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}}]}},"/api/public/records":{"get":{"operationId":"records_public","summary":"Public records (the ledger keeps everything after the window, privately).","tags":["records"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}}]}},"/api/private/records":{"post":{"operationId":"records_private","summary":"Permanently archived (expired) records \u2014 the operator's admin session required.","tags":["records"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}}],"security":[{"AdminToken":[]}]}},"/api/admin/archive":{"post":{"operationId":"admin_archive","summary":"Seal every record whose 30-day public window closed into the private archive.","tags":["admin"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"security":[{"AdminToken":[]}]}},"/api/chain/tx":{"post":{"operationId":"tx_submit","summary":"Submit an Ed25519-signed transaction to the ledger.","tags":["tx"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"amount":{"type":"integer"},"token":{"type":"string"},"nonce":{"type":"integer"},"timestamp":{"type":"integer"},"pubkey_base58":{"type":"string"},"signature":{"type":"string"}}}}}}}},"/api/account/{address}":{"get":{"operationId":"account_get","summary":"Public: balance, token holdings, nonce and role for one address \u2014 balances are permanent public ledger data.","tags":["account"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/tokens":{"get":{"operationId":"tokens_list","summary":"Every token minted on this chain.","tags":["tokens"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/pools":{"get":{"operationId":"pools_list","summary":"AMM pools (TOR + token reserves).","tags":["pools"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/tokens/public":{"get":{"operationId":"tokens_public","summary":"THE PERMANENT PUBLIC RECORD \u2014 price, pools, market cap, 24h volume, supply, circulating supply, holder count, mint address and owner for every token, plus the chain-wide totals. This data outlives the 30-day window.","tags":["tokens"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}}]}},"/api/tokens/images":{"get":{"operationId":"tokens_images","summary":"Token logos resolved from public metadata (CoinGecko top coins by market cap, DexScreener fallback for tickers CoinGecko does not know), cached on disk for 24 h.","tags":["tokens"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"refresh","in":"query","required":false,"schema":{"type":"boolean"}}]}},"/api/tokens/images/refresh":{"post":{"operationId":"tokens_images_refresh","summary":"Force a CoinGecko/DexScreener logo refresh now (admin) and return the refreshed cache. Whatever the refresh learns is mirrored onto this node straight away.","tags":["tokens"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"security":[{"AdminToken":[]}]}},"/api/tokens/images/mirror":{"post":{"operationId":"tokens_images_mirror","summary":"Copy every cached token logo onto this node (data/metadata/token-logos) so the pages draw them from /assets/tokens/<SYMBOL>.<ext>: no third-party image host, no hotlink block, works over Tor and offline. Idempotent \u2014 an already-mirrored picture is skipped unless force is set.","tags":["tokens"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"symbols":{"type":"string"},"limit":{"type":"integer"},"force":{"type":"boolean"}}}}}},"security":[{"AdminToken":[]}]}},"/api/tokens/bootstrap":{"get":{"operationId":"tokens_bootstrap_plan","summary":"What the top-N market-cap token bootstrap would mint right now: ranked tickers, names, which already exist, and the total 5 TOR-per-token fee. Read-only.","tags":["tokens"],"responses":{"200":{"description":"envelope {ok, data, error}"}}},"post":{"operationId":"tokens_bootstrap","summary":"MINT THE TOP-N MARKET-CAP TOKENS \u2014 real on-chain token_create transactions (5 TOR each from the wallet), ranked by market cap from the cached public metadata, idempotent (existing tickers are skipped). dry_run is the default; pools=true also seeds a TOR pool per token.","tags":["tokens"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"limit":{"type":"integer"},"supply":{"type":"integer"},"wallet":{"type":"string"},"dry_run":{"type":"boolean"},"pools":{"type":"boolean"},"pool_tor":{"type":"number"},"pool_share":{"type":"integer"}}}}}},"security":[{"AdminToken":[]}]}},"/api/tokens/universe":{"get":{"operationId":"tokens_universe","summary":"THE 120-ASSET UNIVERSE \u2014 the top 100 assets by market cap plus the top 20 Solana memecoins, each with price (USD), market cap, total supply and one logo. Key-less public providers with two fallbacks each (CoinGecko \u2192 CoinPaprika \u2192 CoinLore; CoinGecko's solana-meme-coins \u2192 GeckoTerminal \u2192 DexScreener); the answer names the provider that answered.","tags":["tokens"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"majors","in":"query","required":false,"schema":{"type":"integer"}},{"name":"memes","in":"query","required":false,"schema":{"type":"integer"}}]}},"/api/tokens/universe/refresh":{"post":{"operationId":"tokens_universe_refresh","summary":"FETCH THE UNIVERSE NOW (admin) \u2014 walk every provider in fallback order, cache the result on disk and report which provider answered each list and which one errored.","tags":["tokens"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"security":[{"AdminToken":[]}]}},"/api/tokens/fleet":{"get":{"operationId":"tokens_fleet_status","summary":"THE 120-TOKEN FLEET RECORD \u2014 one wallet per asset, one token in each: wallet name, address and public key, ticker, name, supply, price, market cap, logo and transaction, plus the live plan for the next run.","tags":["tokens"],"responses":{"200":{"description":"envelope {ok, data, error}"}}},"post":{"operationId":"tokens_fleet","summary":"MINT THE 120-TOKEN FLEET (admin) \u2014 generate one Ed25519 wallet per asset, fund it from the founder, mint one token in each with the provider's total supply, remember the same logo in the node's logo cache and write data/metadata/token-fleet.json + docs/TOKEN_FLEET.md. dry_run is the default; a ticker that already exists is skipped, never re-minted.","tags":["tokens"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"majors":{"type":"integer"},"memes":{"type":"integer"},"fund_tor":{"type":"number"},"founder":{"type":"string"},"prefix":{"type":"string"},"dry_run":{"type":"boolean"},"pin_metadata":{"type":"boolean"}}}}}},"security":[{"AdminToken":[]}]}},"/api/public/ledger":{"get":{"operationId":"public_ledger","summary":"THE PERMANENT PUBLIC LEDGER \u2014 every account with its TOR balance and token balances, every token with supply/circulating/pooled/holders, every pool and the chain-wide totals. Public data: no session, no admin token.","tags":["public"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer"}}]}},"/api/public/tokens":{"get":{"operationId":"public_tokens","summary":"The permanent public token table (same document as /api/tokens/public): price, pools, market cap, 24h volume, supply, circulating supply, holder count, mint address, owner and logo for every token.","tags":["public"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}}]}},"/api/public/tokens/{symbol}":{"get":{"operationId":"public_token","summary":"One token's public detail: supply, circulating supply, tokens locked in pools, holder count, owner, decimals and its AMM pool with price_tor.","tags":["public"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/public/tokens/{symbol}/holders":{"get":{"operationId":"public_token_holders","summary":"Every address holding a token, largest first, with its amount and share of supply \u2014 public balances, no session.","tags":["public"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}}]}},"/api/public/balances":{"get":{"operationId":"public_balances","summary":"The public balance sheet: every address on this node with its TOR balance, every token balance it holds and the chain totals. Paginated, public, permanent.","tags":["public"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer"}}]}},"/api/public/balances/{address}":{"get":{"operationId":"public_balance","summary":"One address's balances \u2014 public, permanent, no session required (same numbers as /api/account/{address}).","tags":["public"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/public/totals":{"get":{"operationId":"public_totals","summary":"Chain-wide totals: total supply, accounts, tokens, pools, holders, pooled tokens and per-token supply \u2014 computed from the ledger itself.","tags":["public"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/coin":{"get":{"operationId":"coin_get","summary":"TOR coin metadata: name, symbol, decimals, description, image, logo_url, logo_ipfs, properties.logo_cid.","tags":["coin"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/pricing":{"get":{"operationId":"pricing_get","summary":"The LOCKED price table (contract 5, mint 3, transfer 0.1).","tags":["pricing"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/wallets":{"get":{"operationId":"wallets_list","summary":"Server-side wallets by name \u2014 the operator's admin session only (it exposes keystore metadata; balances themselves are public at /api/public/balances).","tags":["wallets"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"security":[{"AdminToken":[]}]},"post":{"operationId":"wallets_create","summary":"Generate a Phantom-compatible wallet.","tags":["wallets"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"words":{"type":"integer"}}}}}},"security":[{"AdminToken":[]}]}},"/api/wallets/{name}/challenge":{"post":{"operationId":"wallets_challenge","summary":"Start a private balance read: a single-use nonce plus the exact message the wallet must sign (5 minutes).","tags":["wallets"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/wallets/{name}/session":{"post":{"operationId":"wallets_session","summary":"Verify the wallet's Ed25519 signature over the challenge and mint a 1-hour session token (x-wallet-session).","tags":["wallets"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"nonce":{"type":"string"},"signature":{"type":"string"}}}}}}}},"/api/wallets/{name}":{"get":{"operationId":"wallets_get","summary":"Public: one wallet (address, role, live balances) \u2014 secret material and keystore paths are redacted.","tags":["wallets"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/wallets/{name}/balance":{"get":{"operationId":"wallets_balance","summary":"Public: live balance from the node \u2014 a balance is permanent public ledger data, no session required.","tags":["wallets"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/wallets/{name}/history":{"get":{"operationId":"wallets_history","summary":"The last 30 days of this wallet's transactions (the public window): txid, signature and block hash in hex, TOR/token amounts, platform fee, direction and totals.","tags":["wallets"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}}]}},"/api/wallets/{name}/receive":{"get":{"operationId":"wallets_receive","summary":"Receive panel: the address, the Ed25519 public key (base58 + hex) and a real QR code for each \u2014 owner session or admin.","tags":["wallets"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/wallets/{name}/send":{"post":{"operationId":"wallets_send","summary":"Sign and broadcast a real transfer. The chain itself is fee-free; the node/platform adds its 0.1 TOR fee as a separate transfer.","tags":["wallets"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string"},"amount":{"type":"number"},"token":{"type":"string"},"note":{"type":"string"}}}}}}}},"/api/wallets/{name}/sign":{"post":{"operationId":"wallets_sign","summary":"Build and sign a transaction without broadcasting it.","tags":["wallets"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string"},"to":{"type":"string"},"amount":{"type":"number"},"token":{"type":"string"},"note":{"type":"string"}}}}}}}},"/api/payments/plans":{"get":{"operationId":"payments_plans","summary":"Everything that can be bought, with the price in TOR and microTOR.","tags":["payments"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/payments/quote":{"get":{"operationId":"payments_quote","summary":"Quote one code (and quantity) before charging.","tags":["payments"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string"}},{"name":"quantity","in":"query","required":false,"schema":{"type":"number"}}]}},"/api/payments/invoices":{"post":{"operationId":"payments_invoices_create","summary":"Open an invoice for a price code or a custom TOR amount.","tags":["payments"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"amount_tor":{"type":"number"},"wallet":{"type":"string"},"note":{"type":"string"}}}}}},"security":[{"AdminToken":[]}]},"get":{"operationId":"payments_invoices_list","summary":"Newest invoices first.","tags":["payments"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}}]}},"/api/payments/invoices/{invoice_id}":{"get":{"operationId":"payments_invoices_get","summary":"One invoice with its settlement transaction.","tags":["payments"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/payments/invoices/{invoice_id}/pay":{"post":{"operationId":"payments_invoices_pay","summary":"Pay an invoice from the visitor's own account wallet \u2014 a real signed on-chain transfer. An admin may name any wallet.","tags":["payments"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"wallet":{"type":"string"}}}}}}}},"/api/payments/revenue":{"get":{"operationId":"payments_revenue","summary":"Settled revenue per price code, straight from the invoice ledger.","tags":["payments"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/contracts/templates":{"get":{"operationId":"contracts_templates","summary":"Rust contract templates that can be deployed (escrow, token gate, subscription).","tags":["contracts"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/contracts":{"get":{"operationId":"contracts_list","summary":"Programs/contracts. Owners and admins see everything; everyone else sees a summary (no source, state or fees).","tags":["contracts"],"responses":{"200":{"description":"envelope {ok, data, error}"}}},"post":{"operationId":"contracts_create","summary":"Deploy a Rust contract (5 TOR, authorized nodes only).","tags":["contracts"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"template":{"type":"string"},"source":{"type":"string"},"owner_wallet":{"type":"string"},"wallet":{"type":"string"}}}}}}}},"/api/contracts/mine":{"get":{"operationId":"contracts_mine","summary":"Every program this wallet owns (wallet session required).","tags":["contracts"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"security":[{"WalletSession":[]}]}},"/api/contracts/{contract_id}":{"get":{"operationId":"contracts_get","summary":"One program. Full source/state/compiler/fees for the owner (or admin); a public summary for anyone else.","tags":["contracts"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"contract_id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/contracts/{contract_id}/call":{"post":{"operationId":"contracts_call","summary":"Manage a program: the owner (wallet session) or an admin applies a function; state is stored and audited.","tags":["contracts"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"contract_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"function":{"type":"string"},"args":{"type":"object"}}}}}}}},"/api/contracts/nodes":{"get":{"operationId":"contracts_nodes","summary":"Which nodes may deploy contracts (address + fingerprint; the token is never shown).","tags":["contracts"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/auth/signup":{"post":{"operationId":"auth_signup","summary":"Create a username + password account and a real Ed25519 wallet; the private key is returned ONCE.","tags":["auth"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"}}}}}}}},"/api/auth/login":{"post":{"operationId":"auth_login","summary":"Sign in with username + password and receive a 1-hour wallet session (x-wallet-session).","tags":["auth"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"}}}}}}}},"/api/auth/me":{"get":{"operationId":"auth_me","summary":"The signed-in wallet's account, address, balance and session expiry.","tags":["auth"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"security":[{"WalletSession":[]}]}},"/api/auth/logout":{"post":{"operationId":"auth_logout","summary":"Drop the presented wallet session.","tags":["auth"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"security":[{"WalletSession":[]}]}},"/api/auth/support":{"get":{"operationId":"auth_support","summary":"The support email shown on the wallet and admin pages.","tags":["auth"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/auth/wallets":{"get":{"operationId":"auth_wallets","summary":"Up to five wallets this account owns (generated + imported) with live public balances, primary flag and labels.","tags":["auth"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"security":[{"WalletSession":[]}]},"post":{"operationId":"auth_wallet_generate","summary":"Generate another Phantom-compatible wallet for this account (password required, 5 wallets max).","tags":["auth"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string"},"label":{"type":"string"},"words":{"type":"integer"}}}}}},"security":[{"WalletSession":[]}]}},"/api/auth/wallets/import":{"post":{"operationId":"auth_wallet_import","summary":"Import an existing wallet (Phantom private key or 12-24 word recovery phrase) into this account (password required).","tags":["auth"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string"},"secret_key_base58":{"type":"string"},"mnemonic":{"type":"string"},"label":{"type":"string"}}}}}},"security":[{"WalletSession":[]}]}},"/api/auth/wallets/{name}/export":{"post":{"operationId":"auth_wallet_export","summary":"PASSWORD-AUTHORIZED private key export for one of the account's wallets (key + mnemonic if present).","tags":["auth"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string"}}}}}},"security":[{"WalletSession":[]}]}},"/api/auth/wallets/{name}/select":{"post":{"operationId":"auth_wallet_select","summary":"Move the wallet session onto another wallet the same account owns.","tags":["auth"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"WalletSession":[]}]}},"/api/auth/wallets/{name}/primary":{"post":{"operationId":"auth_wallet_primary","summary":"Make another owned wallet the default that a login opens (every wallet stays spendable).","tags":["auth"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"WalletSession":[]}]}},"/api/admin/account":{"get":{"operationId":"admin_account","summary":"Is an admin account registered? Public status drives the register/login panel.","tags":["admin"],"responses":{"200":{"description":"envelope {ok, data, error}"}}},"delete":{"operationId":"admin_account_delete","summary":"Delete the admin account and re-enable registration; the wallet file is kept so funds survive.","tags":["admin"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string"}}}}}},"security":[{"AdminToken":[]}]}},"/api/admin/account/register":{"post":{"operationId":"admin_account_register","summary":"First-run admin registration (username + password, optional chain admin token). Closed once an account exists.","tags":["admin"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"},"admin_token":{"type":"string"}}}}}}}},"/api/admin/account/login":{"post":{"operationId":"admin_account_login","summary":"Admin login with username + password \u2192 x-admin-session (2 hours).","tags":["admin"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"}}}}}}}},"/api/admin/account/logout":{"post":{"operationId":"admin_account_logout","summary":"End the admin session.","tags":["admin"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"security":[{"AdminToken":[]}]}},"/api/admin/account/password":{"post":{"operationId":"admin_account_password","summary":"Change the admin password (closes every existing session).","tags":["admin"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"current_password":{"type":"string"},"new_password":{"type":"string"}}}}}},"security":[{"AdminToken":[]}]}},"/api/admin/account/username":{"post":{"operationId":"admin_account_username","summary":"Change the admin username (password unchanged).","tags":["admin"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string"},"username":{"type":"string"}}}}}},"security":[{"AdminToken":[]}]}},"/api/admin/account/api-key":{"post":{"operationId":"admin_account_api_key","summary":"Rotate the platform API key (x-admin-token); the previous key stops working immediately.","tags":["admin"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"security":[{"AdminToken":[]}]}},"/api/admin/account/wallet":{"post":{"operationId":"admin_account_wallet","summary":"Generate a new admin wallet, delete the account's previous wallet and make the new one the fee collector.","tags":["admin"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/admin/fee-receiver":{"post":{"operationId":"admin_fee_receiver","summary":"Point every platform/service fee at another wallet (the chain admin token authorizes it).","tags":["admin"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"string"}}}}}}}},"/api/workbench/projects":{"get":{"operationId":"workbench_projects","summary":"Every DarkWeb web app and Rust program on this node \u2014 kind, entry point, size and whether its preview server is running.","tags":["workbench"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}}]},"post":{"operationId":"workbench_create","summary":"Scaffold a real project on disk: index.html/styles.css/app.js for a web app, Cargo.toml/src/main.rs for a Rust program.","tags":["workbench"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["web","rust"]},"description":{"type":"string"},"model":{"type":"string"}}}}}},"security":[{"WalletSession":[]}]}},"/api/workbench/projects/{build_id}":{"get":{"operationId":"workbench_project","summary":"One project with its live file tree and the model its builder uses.","tags":["workbench"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"build_id","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"workbench_delete","summary":"Delete a project and every file in it (stops its preview server first).","tags":["workbench"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"build_id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/workbench/projects/{build_id}/files":{"get":{"operationId":"workbench_file","summary":"Read one text file of the project (path is relative to the project root).","tags":["workbench"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"build_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"path","in":"query","required":true,"schema":{"type":"string"}}]},"post":{"operationId":"workbench_file_write","summary":"Create, overwrite or append a text file \u2014 the editor's save and new-file buttons.","tags":["workbench"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"build_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string"},"content":{"type":"string"},"mode":{"type":"string","enum":["create","overwrite","append"]}}}}}}},"delete":{"operationId":"workbench_file_delete","summary":"Delete one file from the project.","tags":["workbench"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"build_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"path","in":"query","required":true,"schema":{"type":"string"}}]}},"/api/workbench/projects/{build_id}/run":{"post":{"operationId":"workbench_run","summary":"Run one command in the project directory (argv, no shell, allow-listed developer tools) and return its real output.","tags":["workbench"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"build_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"command":{"type":"string"},"timeout":{"type":"number"}}}}}}}},"/api/workbench/projects/{build_id}/deploy":{"post":{"operationId":"workbench_deploy","summary":"Deploy for real. DarkWeb (web) \u2192 ADD_ONION on Tor and a live http://<id>.onion/builds/<id>/ URL; Rust \u2192 cargo build --release, binary sha3 and an owner-only program record.","tags":["workbench"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"build_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"owner_wallet":{"type":"string"}}}}}}}},"/api/workbench/projects/{build_id}/deployment":{"get":{"operationId":"workbench_deployment","summary":"The project's deployment record: onion URL or program id, owner wallet and when it deployed.","tags":["workbench"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"build_id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/workbench/projects/{build_id}/install":{"post":{"operationId":"workbench_install","summary":"Install dependencies for real: pip, npm, or cargo add / cargo fetch.","tags":["workbench"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"build_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"manager":{"type":"string","enum":["pip","npm","cargo"]},"packages":{"type":"string"}}}}}}}},"/api/workbench/projects/{build_id}/ai":{"post":{"operationId":"workbench_ai","summary":"Prompt the builder: the surface's model returns a JSON file plan (create/update/delete) and it is applied to the real files.","tags":["workbench"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"build_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string"},"model":{"type":"string"},"history":{"type":"object"},"apply":{"type":"boolean"}}}}}}}},"/api/workbench/projects/{build_id}/serve":{"post":{"operationId":"workbench_serve","summary":"Start the app for the preview window (static server for web, cargo run for Rust) on a free port.","tags":["workbench"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"build_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"command":{"type":"string"},"port":{"type":"integer"}}}}}}},"get":{"operationId":"workbench_serve_status","summary":"Preview server state plus the tail of its real stdout/stderr log.","tags":["workbench"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"build_id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/workbench/projects/{build_id}/serve/stop":{"post":{"operationId":"workbench_serve_stop","summary":"Stop the preview server (the whole process tree).","tags":["workbench"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"build_id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/meme/tools":{"get":{"operationId":"meme_tools","summary":"Every launcher tool with its real state \u2014 live vs placeholder (501).","tags":["meme"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/meme/tokens":{"get":{"operationId":"meme_tokens","summary":"On-chain tokens: price, pool, market cap, 24h volume, supply, circulating supply, holder count, owner \u2014 launcher metadata only while its 30-day window is open.","tags":["meme"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}}]},"post":{"operationId":"meme_token_create","summary":"Create a token on the ledger (the chain charges 5 TOR in the token_create tx).","tags":["meme"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"symbol":{"type":"string"},"name":{"type":"string"},"supply":{"type":"integer"},"description":{"type":"string"},"image":{"type":"string"},"socials":{"type":"object"},"wallet":{"type":"string"},"promo_code":{"type":"string"}}}}}}}},"/api/meme/tokens/{symbol}":{"get":{"operationId":"meme_token","summary":"One token: ledger record, pool, market, supply totals, every holder with its balance, temporary launcher metadata and promotions.","tags":["meme"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/meme/tokens/{symbol}/market":{"get":{"operationId":"meme_market","summary":"Price, liquidity, market cap and the swaps inside the public window.","tags":["meme"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/meme/pools":{"post":{"operationId":"meme_pool_create","summary":"Seed the AMM pool (10 TOR charged by the chain, reserves moved on-chain).","tags":["meme"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"symbol":{"type":"string"},"token_amount":{"type":"integer"},"tor_amount":{"type":"number"},"wallet":{"type":"string"}}}}}}}},"/api/meme/pools/{symbol}/swap":{"post":{"operationId":"meme_swap","summary":"Buy or sell against the pool \u2014 a real signed swap at 0.30%.","tags":["meme"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"side":{"type":"string","enum":["buy","sell"]},"amount":{"type":"number"},"wallet":{"type":"string"}}}}}}}},"/api/meme/quote":{"get":{"operationId":"meme_quote","summary":"Constant-product quote using the same integer math as the chain.","tags":["meme"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"symbol","in":"query","required":true,"schema":{"type":"string"}},{"name":"side","in":"query","required":false,"schema":{"type":"string","enum":["buy","sell"]}},{"name":"amount","in":"query","required":true,"schema":{"type":"number"}}]}},"/api/meme/promo":{"get":{"operationId":"meme_promo","summary":"Validate a launcher promo code (API-layer fees only; chain fees are fixed).","tags":["meme"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"code","in":"query","required":false,"schema":{"type":"string"}}]}},"/api/meme/trending":{"get":{"operationId":"meme_trending","summary":"Trending board ranked by active promotion, then liquidity, then supply.","tags":["meme"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/meme/promotions":{"get":{"operationId":"meme_promotions","summary":"Active paid promotions with their expiry and price table.","tags":["meme"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}}]},"post":{"operationId":"meme_promote","summary":"Buy a trending slot (5 TOR/day) or the 7-day banner (30 TOR).","tags":["meme"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"symbol":{"type":"string"},"kind":{"type":"string","enum":["trending","banner"]},"days":{"type":"integer"},"wallet":{"type":"string"},"promo_code":{"type":"string"}}}}}}}},"/api/meme/volume-sessions":{"get":{"operationId":"meme_volume_sessions","summary":"Queued/paid volume sessions (the engine is not deployed).","tags":["meme"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}}]},"post":{"operationId":"meme_volume_session_create","summary":"Pay for a 15-minute volume session and queue it honestly.","tags":["meme"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"symbol":{"type":"string"},"rounds":{"type":"integer"},"wallet":{"type":"string"},"promo_code":{"type":"string"}}}}}}}},"/api/meme/volume-sessions/{session_id}/run":{"post":{"operationId":"meme_volume_run","summary":"Placeholder: answers ENGINE_NOT_DEPLOYED and places no trades.","tags":["meme"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/meme/tokens/{symbol}/landing":{"post":{"operationId":"meme_landing","summary":"Generate + host a token landing page with Ollama (10 TOR).","tags":["meme"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"wallet":{"type":"string"},"prompt":{"type":"string"},"model":{"type":"string"},"promo_code":{"type":"string"}}}}}}}},"/api/meme/dex/venues":{"get":{"operationId":"meme_dex_venues","summary":"Planned DEX venues: the internal AMM is live, external ones are placeholders.","tags":["meme"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/meme/dex/quote":{"get":{"operationId":"meme_dex_quote","summary":"Placeholder external-DEX quote \u2014 501 DEX_NOT_DEPLOYED (use meme.quote).","tags":["meme"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"symbol","in":"query","required":false,"schema":{"type":"string"}},{"name":"side","in":"query","required":false,"schema":{"type":"string","enum":["buy","sell"]}},{"name":"amount","in":"query","required":false,"schema":{"type":"number"}}]}},"/api/meme/dex/swap":{"post":{"operationId":"meme_dex_swap","summary":"Placeholder external-DEX swap \u2014 501 DEX_NOT_DEPLOYED (use meme.swap).","tags":["meme"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"symbol":{"type":"string"},"side":{"type":"string","enum":["buy","sell"]},"amount":{"type":"number"},"wallet":{"type":"string"}}}}}}}},"/api/meme/dex/link":{"get":{"operationId":"meme_dex_link","summary":"Parse any pasted DEX link into its source, mint and pair (pure, no network).","tags":["meme"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string"}}]}},"/api/nft/catalogue":{"get":{"operationId":"nft_catalogue","summary":"Every 1-of-1 minted on this node with its metadata and 3 TOR price.","tags":["nft"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}}]}},"/api/nft/catalogue/{nft_id}":{"get":{"operationId":"nft_get","summary":"One catalogue record plus the resolved metadata and persona block.","tags":["nft"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"nft_id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/nft/mint":{"post":{"operationId":"nft_mint","summary":"Mint a 1-of-1 AI-NFT (3 TOR on-chain, metadata stored by this node).","tags":["nft"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string"},"symbol":{"type":"string"},"attributes":{"type":"object"},"animation_url":{"type":"string"},"external_url":{"type":"string"},"wallet":{"type":"string"}}}}}}}},"/api/nft/metadata":{"get":{"operationId":"nft_metadata","summary":"Resolve real metadata: local registry \u2192 Solana Metaplex \u2192 metadata URI.","tags":["nft"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"address","in":"query","required":false,"schema":{"type":"string"}},{"name":"token_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"metadata_uri","in":"query","required":false,"schema":{"type":"string"}}]}},"/api/nft/chat":{"post":{"operationId":"nft_chat","summary":"Chat as the NFT: its metadata is injected right after I AM THIS NFT.","tags":["nft"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"string"},"token_id":{"type":"string"},"prompt":{"type":"string"},"model":{"type":"string"},"messages":{"type":"object"}}}}}}}},"/api/tor/status":{"get":{"operationId":"tor_status","summary":"Tor daemon reachability, control port, SOCKS port and published services.","tags":["tor"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/tor/new-identity":{"post":{"operationId":"tor_new_identity","summary":"Ask Tor for a new circuit (SIGNAL NEWNYM).","tags":["tor"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"security":[{"AdminToken":[]}]}},"/api/tor/node":{"get":{"operationId":"tor_node","summary":"The onion link THIS NODE is published at (ADD_ONION state, service id, port, docs/token URLs). Never invented: published=false until Tor accepted ADD_ONION.","tags":["tor"],"responses":{"200":{"description":"envelope {ok, data, error}"}}},"post":{"operationId":"tor_node_publish","summary":"Publish the whole API as a Tor hidden service (ADD_ONION): the onion link you browse the node at. Reuses the recorded service unless refresh=true.","tags":["tor"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"port":{"type":"integer"},"refresh":{"type":"boolean"}}}}}},"security":[{"AdminToken":[]}]}},"/api/ollama/status":{"get":{"operationId":"ollama_status","summary":"Ollama install state, API URL, version, model count, running models and the default model.","tags":["ollama"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/ollama/models":{"get":{"operationId":"ollama_models","summary":"Installed models.","tags":["ollama"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/ollama/pull":{"post":{"operationId":"ollama_pull","summary":"Download a model (streams NDJSON progress, exactly like `ollama pull`).","tags":["ollama"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"}}}}}},"security":[{"AdminToken":[]}]}},"/api/ollama/start":{"post":{"operationId":"ollama_start","summary":"Start `ollama serve` when the API is not answering yet.","tags":["ollama"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"security":[{"AdminToken":[]}]}},"/api/ollama/run":{"post":{"operationId":"ollama_run","summary":"Run one prompt against a model \u2014 the API behind the `ollama run <model>` box.","tags":["ollama"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"prompt":{"type":"string"},"stream":{"type":"boolean"}}}}}},"security":[{"AdminToken":[]}]}},"/api/ollama/chat":{"post":{"operationId":"ollama_chat","summary":"Chat with the command brain: live API schema + real tool calls + real responses.","tags":["ollama"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string"},"messages":{"type":"object"},"model":{"type":"string"},"use_tools":{"type":"boolean"}}}}}}}},"/api/ollama/prompt":{"get":{"operationId":"ollama_prompt","summary":"The exact system prompt handed to the model (schema + live chain snapshot).","tags":["ollama"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/ollama/routing":{"get":{"operationId":"ollama_routing","summary":"Which model each AI surface uses \u2014 the blockchain interface, the AI-NFT, the DarkWeb App Builder and the Rust Program Builder \u2014 with whether that model is installed.","tags":["ollama"],"responses":{"200":{"description":"envelope {ok, data, error}"}}},"post":{"operationId":"ollama_routing_set","summary":"Admin: point one AI surface at an installed model (stored on this node; empty model clears the override).","tags":["ollama"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"purpose":{"type":"string","enum":["brain","nft","web_builder","rust_builder"]},"model":{"type":"string"}}}}}},"security":[{"AdminToken":[]}]}},"/api/ollama/ps":{"get":{"operationId":"ollama_ps","summary":"Models currently loaded in memory.","tags":["ollama"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/ollama/models/{model}":{"delete":{"operationId":"ollama_delete","summary":"Delete a model from disk.","tags":["ollama"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"AdminToken":[]}]}},"/api/ollama/install":{"post":{"operationId":"ollama_install","summary":"Auto-install Ollama on this machine (winget on Windows, install.sh elsewhere).","tags":["ollama"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"security":[{"AdminToken":[]}]}},"/api/ollama/suggested":{"get":{"operationId":"ollama_suggested","summary":"The download buttons: curated models with size, tool support and whether each is installed.","tags":["ollama"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/ollama/bootstrap":{"post":{"operationId":"ollama_bootstrap","summary":"One click: install Ollama if missing, start `ollama serve`, pull the default model. Reports every real step.","tags":["ollama"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"pull":{"type":"boolean"},"model":{"type":"string"}}}}}},"security":[{"AdminToken":[]}]}},"/api/ollama/command":{"post":{"operationId":"ollama_command","summary":"Run a typed `ollama ...` CLI line \u2014 run, pull, list, ps, show, rm or serve.","tags":["ollama"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"command":{"type":"string"},"prompt":{"type":"string"}}}}}},"security":[{"AdminToken":[]}]}},"/api/tools":{"get":{"operationId":"tools_catalog","summary":"The fetch-data tool description: every callable endpoint with its schema.","tags":["tools"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/tools/fetch":{"post":{"operationId":"tools_fetch","summary":"THE FETCH-DATA TOOL \u2014 call any endpoint by name and get the real HTTP response.","tags":["tools"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"endpoint":{"type":"string"},"params":{"type":"object"}}}}}}}},"/api/ai/command":{"post":{"operationId":"ai_command","summary":"Natural-language command deck: asks Ollama, executes real API calls, returns the answer.","tags":["ai"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string"},"model":{"type":"string"},"use_tools":{"type":"boolean"}}}}}}}},"/api/policy":{"get":{"operationId":"policy_get","summary":"THE 30-DAY DATA POLICY \u2014 the window, the permanent public allow-list (the token table and the public balance sheet), what expires, and how much of every store is already expired.","tags":["policy"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/policy/sweep":{"post":{"operationId":"policy_sweep","summary":"ENFORCE THE POLICY NOW \u2014 delete service records, files and previews older than the window, then seal expired chain records into the private archive. dry_run=true only reports.","tags":["policy"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dry_run":{"type":"boolean"}}}}}},"security":[{"AdminToken":[]}]}},"/api/ipfs/status":{"get":{"operationId":"ipfs_status","summary":"IPFS pinning health: is a Pinata credential configured, which gateway, and the last pin (never a secret).","tags":["ipfs"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/ipfs/resolve":{"get":{"operationId":"ipfs_resolve","summary":"Resolve ipfs:// or ar:// to the HTTPS gateway URL used by pages and listings.","tags":["ipfs"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"uri","in":"query","required":true,"schema":{"type":"string"}}]}},"/api/ipfs/pin":{"post":{"operationId":"ipfs_pin","summary":"Pin a JSON document or a base64 image to IPFS through Pinata (admin).","tags":["ipfs"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"document":{"type":"object"},"data_url":{"type":"string"},"filename":{"type":"string"},"name":{"type":"string"}}}}}},"security":[{"AdminToken":[]}]}},"/api/dev/keys/pricing":{"get":{"operationId":"dev_pricing","summary":"DEVELOPER KEYS \u2014 the price (25 TOR / 30 days), rate limits, header name and how to buy.","tags":["dev"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/dev/keys":{"get":{"operationId":"dev_keys","summary":"Every developer key this account bought (masked hints, usage, expiry).","tags":["dev"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"security":[{"WalletSession":[]}]},"post":{"operationId":"dev_keys_create","summary":"BUY A DEVELOPER KEY \u2014 charged on-chain from the signed-in wallet (25 TOR / 30 days), returned once.","tags":["dev"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"},"days":{"type":"integer"},"wallet":{"type":"string"}}}}}},"security":[{"WalletSession":[]}]}},"/api/dev/keys/{key_id}":{"delete":{"operationId":"dev_keys_revoke","summary":"Revoke one of this account's developer keys (immediate; no refund).","tags":["dev"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"WalletSession":[]}]}},"/api/v1/{endpoint}":{"get":{"operationId":"dev_call","summary":"THE KEYED DEVELOPER API \u2014 call any public endpoint by catalog name with x-api-key (the website uses wallet sessions).","tags":["dev"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"endpoint","in":"path","required":true,"schema":{"type":"string"}},{"name":"api_key","in":"query","required":false,"schema":{"type":"string"}}],"security":[{"ApiKey":[]}]},"post":{"operationId":"dev_call_write","summary":"The keyed developer API for POST endpoints; JSON body or query params are forwarded.","tags":["dev"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"endpoint","in":"path","required":true,"schema":{"type":"string"}},{"name":"api_key","in":"query","required":false,"schema":{"type":"string"}}],"security":[{"ApiKey":[]}]}},"/api/market/overview":{"get":{"operationId":"market_overview","summary":"TOR at its USD anchor, cross-platform totals, movers, newest listings, deepest pools.","tags":["market"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/market/tokens":{"get":{"operationId":"market_tokens","summary":"Every token priced in USD: price, market cap, liquidity, 24 h volume and change.","tags":["market"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}}]}},"/api/market/tokens/{symbol}":{"get":{"operationId":"market_token","summary":"One token: USD price, market cap, both pools, 24 h change and observations.","tags":["market"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/market/chart/{symbol}":{"get":{"operationId":"market_chart","summary":"Candles generated from real sampled AMM prices (the chart tool every app renders).","tags":["market"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string"}},{"name":"points","in":"query","required":false,"schema":{"type":"integer"}}]}},"/api/market/tor":{"get":{"operationId":"market_tor","summary":"TOR alone: the $3.60 anchor, the turnover drift applied, the resulting price and cap.","tags":["market"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/market/pools":{"get":{"operationId":"market_pools","summary":"Every pool: TOR pools from the Rust ledger plus the USDC books, deepest first.","tags":["market"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"base","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}}]}},"/api/market/quote":{"get":{"operationId":"market_quote","summary":"Constant-product quote on the deeper pool for a symbol.","tags":["market"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"symbol","in":"query","required":true,"schema":{"type":"string"}},{"name":"side","in":"query","required":false,"schema":{"type":"string"}},{"name":"amount","in":"query","required":true,"schema":{"type":"number"}},{"name":"base","in":"query","required":false,"schema":{"type":"string"}}]}},"/api/market/swap":{"post":{"operationId":"market_swap","summary":"Swap on a TOR pool (chain tx) or a USDC book (two signed transfers); wallet session required.","tags":["market"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"symbol":{"type":"string"},"side":{"type":"string"},"amount":{"type":"number"},"base":{"type":"string"},"wallet":{"type":"string"}}}}}}}},"/api/projects":{"get":{"operationId":"market_projects","summary":"The six TOR platforms: logo, folder, dev URL, onion URL, clearnet URL, fee wallets.","tags":["market"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/ads":{"get":{"operationId":"market_ads","summary":"Banner rotation: the permanent 1Ness banner first, then paid slots (50 TOR/week).","tags":["market"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}}]},"post":{"operationId":"market_ads_buy","summary":"Buy a 7-day banner slot for 50 TOR from the caller's wallet.","tags":["market"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"symbol":{"type":"string"},"title":{"type":"string"},"image":{"type":"string"},"link":{"type":"string"},"promo_code":{"type":"string"}}}}}}}},"/api/ai/models":{"get":{"operationId":"market_ai_models","summary":"Every FREE OpenRouter model (the ChatBox dropdown) with context length.","tags":["market"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"refresh","in":"query","required":false,"schema":{"type":"boolean"}}]}},"/api/ai/status":{"get":{"operationId":"market_ai_status","summary":"Gateway readiness \u2014 configured, free model count, never the key.","tags":["market"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/ai/chat":{"post":{"operationId":"market_ai_chat","summary":"The AI-NFT ChatBox: a free OpenRouter model answers with the TOR persona.","tags":["market"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string"},"messages":{"type":"object"},"model":{"type":"string"},"nft":{"type":"object"}}}}}}}},"/api/pump/launches":{"get":{"operationId":"market_pump_list","summary":"Every TOR Pump launch with its live bonding curve.","tags":["market"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}}]}},"/api/pump/launches/{symbol}":{"get":{"operationId":"market_pump","summary":"One launch: pool, market cap, progress to $25 000, creator fees due.","tags":["market"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/pump/launch":{"post":{"operationId":"market_pump_launch","summary":"Free mint: the platform funds the chain fee, seeds $5 000 of liquidity, creator buys first.","tags":["market"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"symbol":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"image":{"type":"string"},"supply":{"type":"integer"},"first_buy_tor":{"type":"number"}}}}}}}},"/api/pump/launches/{symbol}/claim":{"post":{"operationId":"market_pump_claim","summary":"Claim the creator's 20% share of the pool fee as a real TOR transfer.","tags":["market"],"responses":{"200":{"description":"envelope {ok, data, error}"}},"parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"wallet":{"type":"string"}}}}}}}},"/api/docs":{"get":{"operationId":"docs_catalog","summary":"This catalog + the live base URL(s) + live node snapshot.","tags":["docs"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/docs/endpoints":{"get":{"operationId":"docs_endpoints","summary":"Just the endpoint list.","tags":["docs"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}},"/api/openapi.json":{"get":{"operationId":"docs_openapi","summary":"Generated OpenAPI 3.1 document.","tags":["docs"],"responses":{"200":{"description":"envelope {ok, data, error}"}}}}}}
