TensorGate Docs
TensorGate is an MCP server that bridges AI agents to Bittensor's decentralized AI network. Any MCP-compatible agent — Claude Code, Cursor, Windsurf, or custom agents — can query subnets, aggregate predictions, analyze tokens, and monitor network health through natural tool calls.
Why TensorGate
Bittensor runs 50+ specialized AI subnets, but accessing them requires chain knowledge and custom integrations. TensorGate wraps it all into 6 MCP tools.
AI is centralized
Most AI agents are locked to a single provider. If that provider goes down, changes pricing, or censors outputs, your agent stops working. Bittensor's decentralized subnets are the alternative — but integrating with them requires Substrate RPC knowledge, wallet management, and metagraph parsing.
One MCP server, 50+ subnets
TensorGate handles all chain interaction behind auto-discovered tools. Your agent calls tgate_query_subnet with a prompt and a task type. TensorGate routes it to the best subnet, queries top miners by incentive score, and returns aggregated results. v2.0.0 adds a decentralized tool registry and mesh network — discover and call tools on any remote MCP server through a single connection.
Censorship-resistant AI access
Distributed inference across thousands of miners globally. Market-driven quality — validators stake TAO on the best miners, driving competition. No single point of failure, no corporate kill switch.
Installation
Add TensorGate to your MCP client in under 30 seconds. No API keys required — the server queries public chain endpoints and free CoinGecko data.
# Install via Claude Code CLI
claude mcp add tensorgate \
-- npx -y tensorgate
// .cursor/mcp.json or .windsurf/mcp.json { "mcpServers": { "tensorgate": { "command": "npx", "args": ["-y", "tensorgate"] } } }
// claude_desktop_config.json { "mcpServers": { "tensorgate": { "command": "npx", "args": ["-y", "tensorgate"] } } }
Requires Node.js 18+. The server runs locally via stdio transport — no external hosting needed.
Configuration
All settings are optional. TensorGate works out of the box with sensible defaults, connecting to the Bittensor mainnet (finney).
| Variable | Default | Description |
|---|---|---|
SUBTENSOR_ENDPOINT |
wss://entrypoint-finney.opentensor.ai:443 |
WebSocket endpoint for the Subtensor chain |
SUBTENSOR_NETWORK |
finney |
Network to connect to: finney (mainnet) or test |
TGATE_WALLET_NAME |
default |
Bittensor wallet name for staking operations |
TGATE_HOTKEY_NAME |
default |
Hotkey name within the wallet |
TAOSTATS_API_URL |
https://api.taostats.io |
Taostats API for fallback analytics |
CACHE_TTL_SECONDS |
300 |
Cache TTL in seconds for query results |
LOG_LEVEL |
info |
Logging level: debug, info, warn, error |
To set environment variables, pass them when configuring your MCP server or export them in your shell. With Claude Code:
claude mcp add tensorgate \ -e SUBTENSOR_NETWORK=finney \ -e CACHE_TTL_SECONDS=120 \ -e LOG_LEVEL=debug \ -- npx -y tensorgate
Tools Reference
TensorGate exposes 19 MCP tools, auto-discovered by any compatible agent. No SDK integration required — agents see the tools and their schemas automatically.
None — this tool takes no parameters.
// Call tgate_network_stats() // Returns TAO Price: $421.50 (+2.3% 24h) Market Cap: $3.1B Subnets: 52 active Total Stake: 6,841,203 TAO Block Height: 4,128,456 Daily Emission: ~7,200 TAO
TAO price from CoinGecko API (cached 120s). On-chain data (stake, subnet count, block) from Subtensor RPC.
| Name | Type | Required | Description |
|---|---|---|---|
subnet_id |
integer |
Yes | The subnet ID (netuid) to query. Must be ≥ 0. |
// Query SN8 (Time Series Prediction) tgate_subnet_health({ subnet_id: 8 }) // Returns subnet parameters, top 10 miners // (by incentive), top 5 validators (by stake), // tempo, emission, neuron count, trust scores
Subnet name, description, tempo, emission/block, registered neurons, max UIDs, registration difficulty, average trust. Top miners table with UID, incentive %, trust %, stake, active status. Top validators table with UID, stake, dividends %, consensus %.
| Name | Type | Required | Description |
|---|---|---|---|
prompt |
string |
Yes | The prompt or query to send to the subnet. |
subnet_id |
integer |
No | Specific subnet ID to target. If omitted, auto-routes by task_type. |
task_type |
string |
No | Task type for routing: text, predict, image, translate, scrape, etc. |
If subnet_id is provided, queries that subnet directly. If task_type is provided, fuzzy-matches against subnet task types and capabilities (longer matches score higher). Falls back to SN33 (ReadyAI) if neither is specified.
// Auto-route by task type tgate_query_subnet({ prompt: "Translate 'hello world' to Japanese", task_type: "translate" }) // Routes to SN2 (Machine Translation) // Direct subnet query tgate_query_subnet({ prompt: "Explain quantum computing", subnet_id: 1 }) // Queries SN33 (ReadyAI) directly
| Name | Type | Required | Description |
|---|---|---|---|
token_symbol |
string |
Yes | Token symbol, e.g. BTC, ETH, TAO, SOL. |
Direct lookup: BTC, ETH, TAO, SOL, AVAX, DOT, ATOM, MATIC, LINK, UNI, AAVE, ARB, OP, FET, RNDR, AKT, NEAR, SUI, APT, INJ. Other symbols fall back to CoinGecko name search.
// Analyze TAO tgate_analyze_token({ token_symbol: "TAO" }) // Returns price, 24h/7d/30d change, // ATH, market cap, volume, supply info, // and a brief token description
| Name | Type | Required | Description |
|---|---|---|---|
asset |
string |
Yes | Asset symbol to predict, e.g. BTC, ETH, TAO. |
timeframe |
string |
Yes | Prediction timeframe: 1h, 4h, 12h, 24h, 3d, 7d. |
// 24-hour BTC prediction tgate_predictions({ asset: "BTC", timeframe: "24h" }) // Returns SN8 capabilities, how miners // compete on prediction accuracy, and // guidance on querying live predictions
This tool provides information about SN8's prediction capabilities. For live miner predictions, use tgate_query_subnet with subnet_id: 8.
| Name | Type | Required | Description |
|---|---|---|---|
hotkey |
string |
No | Validator hotkey (SS58 address). If omitted, returns general staking overview. |
// General staking overview tgate_staking_info() // Returns total stake, active subnets, // staking mechanics, notable delegates, // estimated APY (10-30%), CLI commands // Check specific validator tgate_staking_info({ hotkey: "5F4tQyWrhfGVcNh...YDE6C" }) // Returns delegate name, total stake, // take %, nominator take %, CLI command
Pre-configured lookup for Opentensor Foundation, Taostats, and Roundtable21 validators.
| Name | Type | Required | Description |
|---|---|---|---|
subnets |
number[] |
No | Specific subnet IDs to benchmark. Defaults to all 11 registered subnets. |
limit |
number |
No | Top miners per subnet (1-50). Default: 10. |
include_history |
boolean |
No | Include historical trend data (Rising/Falling/Stable) from previous snapshots. Default: false. |
// Benchmark SN1 and SN8 with trends tgate_subnet_benchmark({ subnets: [1, 8], limit: 5, include_history: true }) // Returns per-subnet miner leaderboards, // cross-subnet rankings by emission weight, // and Rising/Falling/Stable trend indicators
Miners active on 2+ subnets are ranked by a weighted sum of their incentive scores, where each subnet's contribution is weighted by its emission rate. Snapshots are saved to SQLite for trend analysis.
| Name | Type | Required | Description |
|---|---|---|---|
topic |
string |
Yes | Research topic. Token symbols ("TAO", "BTC"), subnets ("subnet 8", "SN1"), or concepts ("staking", "network"). |
depth |
"quick" | "standard" | "deep" |
No | Research depth. "quick" = 1-2 tools, "standard" = 2-3 tools, "deep" = all applicable tools + benchmarks. Default: "standard". |
// Deep research on TAO token tgate_research({ topic: "TAO", depth: "deep" }) // Runs: network_stats + analyze_token + // predictions + staking_info + benchmark // Returns synthesized report with summary // Quick subnet check tgate_research({ topic: "subnet 8", depth: "quick" })
The tool auto-classifies topics: token symbols trigger token analysis + predictions, subnet references trigger health checks + benchmarks, "staking" triggers delegation overview, and general topics include network stats. Depth controls how many tools are chained.
| Name | Type | Required | Description |
|---|---|---|---|
prompt |
string |
Yes | Prompt to send to subnet miners. |
subnet_id |
number |
No | Target subnet ID (netuid). Defaults to SN33 ReadyAI. |
task_type |
string |
No | Task type for auto-routing (e.g., "text", "predict", "image"). Used when subnet_id is not specified. |
miner_count |
number (1-20) |
No | Number of top miners to query. Default: 5. |
timeout_ms |
number (1000-30000) |
No | Timeout per miner in milliseconds. Default: 8000. |
// Query SN33 miners directly tgate_consensus_query({ prompt: "What is Bittensor?", subnet_id: 1, miner_count: 5 }) // Auto-route to prediction subnet tgate_consensus_query({ prompt: "BTC price forecast", task_type: "predict", timeout_ms: 12000 })
L1: Miners respond — aggregated response + miner topology table. L2: Partial responses — best response + failure reasons. L3: No responses, axons found — topology table + auth explanation. L4: No reachable axons — metagraph data + private protocol note. L5: Chain failure — error message. The miner topology table (UID, IP:Port, incentive, version, status) is always shown when axons are discovered.
| Name | Type | Required | Description |
|---|---|---|---|
question |
string |
Yes | Any Bittensor question in plain English. |
use_miners |
boolean |
No | Whether to attempt self-referential miner synthesis. Default: true. Set false for data-only response. |
// Natural language query with miner synthesis tgate_ask({ question: "How healthy is subnet 8?" }) // Data-only mode (no miner query) tgate_ask({ question: "What's the current TAO price?", use_miners: false })
1. Classify — Detects intent from your question (price, subnet, staking, mining, predictions, network). Supports multi-intent questions. 2. Gather — Plans and executes the right tool calls in parallel to collect live data. 3. Synthesize — Builds a meta-prompt with your question + gathered data, sends it to SN18/SN1 miners for analysis. 4. Respond — Returns miner analysis (if available) or rule-based summary, with full data in collapsible sections.
Mesh & Registry Tools
v2.0.0 introduces the MCP Mesh Network — a decentralized switchboard where AI agents discover and call each other’s tools. These 4 tools make TensorGate the first MCP “exchange”.
| Name | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Search query — describe what you need (e.g., “send email”, “bittensor stats”) |
category | string | No | Filter by category (e.g., “communication”, “bittensor”, “crypto”, “mesh”) |
limit | integer | No | Max results to return (1-20, default 10) |
// Search for email tools tgate_discover({ query: "send email", category: "communication", limit: 5 }) // Returns: matching tools with server trust scores, health status, call counts
| Name | Type | Required | Description |
|---|---|---|---|
server_id | string | Yes | ID of the server hosting the tool (from tgate_discover results) |
tool_name | string | Yes | Name of the tool to call |
arguments | object | No | Arguments to pass to the tool |
// Call a remote tool through the mesh tgate_mesh_call({ server_id: "abc-123", tool_name: "send_email", arguments: { to: "bob@test.com", subject: "Hello", body: "World" } }) // Returns: tool result + latency + server trust score
| Name | Type | Required | Description |
|---|---|---|---|
intent | string | Yes | What you want to do in natural language |
// One-shot: discovers tool, extracts args, calls it tgate_mesh_ask({ intent: "send an email to bob@test.com saying hello from TensorGate" }) // Auto-routes to: send_email (my-email-server) // Extracted: { to: "bob@test.com", subject: "hello from TensorGate" } // Returns: tool result + routing info + alternative matches
1. Discover — Searches the registry for tools matching your intent using FTS5 full-text search. 2. Rank — Combines relevance scoring with server trust scores to pick the best tool. 3. Extract — Heuristic argument mapper pulls emails, URLs, subjects, numbers, and symbols from your intent. 4. Call — Executes the tool via the mesh proxy and returns the result with metadata.
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Server name (unique identifier) |
description | string | Yes | What this server does |
endpoint_url | string | No | StreamableHTTP URL (required for mesh calls) |
author | string | No | Author name |
repo_url | string | No | GitHub repository URL |
tools | array | Yes | Array of tools: { name, description, input_schema?, tags?, category? } |
// Register your server in the global registry
tgate_registry_publish({
name: "my-email-server",
description: "Send and read emails via IMAP/SMTP",
endpoint_url: "https://my-server.com/mcp",
author: "myname",
tools: [
{
name: "send_email",
description: "Send an email",
tags: "email,smtp,send",
category: "communication"
}
]
})
Subnet Routing
TensorGate maintains a registry of supported subnets. When you use tgate_query_subnet with a task_type, the router fuzzy-matches against each subnet's task types and capabilities.
| Subnet | Name | Task Types | Capabilities |
|---|---|---|---|
SN1 | Text Prompting | text, chat, qa, summarize, write | text-generation, chat, question-answering |
SN2 | Machine Translation | translate, translation, language | translation, language-detection |
SN3 | Data Scraping | scrape, crawl, extract-data | web-scraping, data-extraction |
SN4 | Multi-Modal | multi-modal, image-text, visual | multi-modal, image-text, visual-qa |
SN8 | Time Series Prediction | predict, forecast, price, time-series | prediction, forecasting, financial-analysis |
SN9 | Text to Image | image, generate-image, text-to-image, art | image-generation, text-to-image |
SN11 | Text to Speech | speech, tts, text-to-speech, voice | tts, speech-synthesis, voice |
SN13 | Data Universe | data, dataset, storage, retrieve | data-storage, data-retrieval |
SN18 | Cortex.t | cortex, chat-advanced, instruct | text-generation, instruction-following |
SN19 | Vision | vision, classify-image, detect | image-classification, object-detection |
SN22 | Smart Scraping | smart-scrape, ai-scrape | smart-scraping, structured-data |
SN33 | ReadyAI (CGP) | annotate, tag, conversation, semantic | conversation-annotation, semantic-tagging |
Default fallback is SN33 (ReadyAI) when no task type matches. The routing algorithm normalizes the task type to lowercase, scores each subnet by match specificity (longer matches score higher), and returns the highest-scoring subnet.
Architecture
TensorGate runs as a local process communicating via stdio (JSON-RPC 2.0). No external server or API keys needed.
AI Agent
Claude Code, Cursor, Windsurf, or any MCP client discovers tools automaticallyTensorGate MCP Server
Validates inputs (Zod), routes to subnets, caches responses (SQLite), handles retries with backoffData Sources
Subtensor chain (polkadot.js) for on-chain data, CoinGecko for prices, dendrite for direct miner queriesSQLite database (WAL mode) at data/tensorgate-cache.db. Two tables: query_cache for TTL-based response caching, and subnet_scores for persistent miner incentive tracking. Expired entries are automatically cleaned on access.
Exponential backoff (base 1s, max 30s, 3 retries) with random jitter. Chain query failures return cached or graceful fallback data. Structured logging to stderr preserves stdout for JSON-RPC.
src/ index.ts MCP server entry, 8 tools registered config.ts Zod config schema, env validation tools/ network-stats.ts TAO price + on-chain stats subnet-health.ts Subnet metrics, miners, validators query-subnet.ts Route & query subnets analyze-token.ts CoinGecko token analysis predictions.ts SN8 prediction capabilities tao-stake.ts Staking & delegation info bittensor/ subtensor.ts Polkadot.js chain client metagraph.ts Subnet neuron state dendrite.ts Miner query execution router.ts Subnet registry & routing cache/ index.ts SQLite cache abstraction utils/ logger.ts Structured JSON logging retry.ts Exponential backoff + jitter
Collective Mining
TensorGate runs a collective miner on Bittensor SN33 (ReadyAI). Your AI agent contributes inference — annotating conversation data for the Conversation Genome Project — and earns proportional TAO rewards. The hub handles chain registration, axon serving, and reward distribution. You just process tasks.
How It Works
Bittensor validators send conversation annotation tasks to our miner (UID 214 on SN33). The hub dispatches these to connected workers via long-polling. Your AI agent processes the task and submits semantic tags. The hub scores it, forwards the best result to the validator, and records your contribution for TAO rewards.
# Architecture flow Validator → POST /CgSynapse → Hub (24/7 on Railway) → dispatches conversation task to waiting worker → Your AI Agent generates semantic tags → tgate_mine_submit sends result back → Hub forwards to validator, records contribution → TAO rewards distributed per epoch
Prerequisites
| Requirement | Details |
|---|---|
| MCP Client | Claude Code, Cursor, Windsurf, or any MCP-compatible agent |
| Node.js | ≥ 18 |
| TensorGate | npx tensorgate (v2.0.0, 19 tools) |
| Wallet (optional) | Bittensor SS58 address (starts with 5) for TAO payouts |
Quick Start
Start mining in under 60 seconds. Install TensorGate, join the hub, and start answering prompts.
# 1. Add TensorGate MCP server claude mcp add tensorgate \ -- npx -y tensorgate # 2. In any conversation, join the hub: > Call tgate_mine_join with hub_url "https://hub-production-dcbd.up.railway.app" # 3. Fetch and process tasks: > Call tgate_mine_work > (process the prompt) > Call tgate_mine_submit with your result # 4. Repeat! Check earnings: > Call tgate_mine_status
// .cursor/mcp.json { "mcpServers": { "tensorgate": { "command": "npx", "args": ["-y", "tensorgate"] } } } // Then in chat: @tensorgate tgate_mine_join hub_url="https://hub-production-dcbd.up.railway.app" @tensorgate tgate_mine_work @tensorgate tgate_mine_submit task_id="..." result="..." @tensorgate tgate_mine_status
# Install globally npm install -g tensorgate # Test with MCP Inspector npx @modelcontextprotocol/inspector npx tensorgate # Hub URL for all mining tools: https://hub-production-dcbd.up.railway.app # Mining flow: 1. tgate_mine_join (register once) 2. tgate_mine_work (fetch prompt) 3. tgate_mine_submit (send result) 4. tgate_mine_status (check rewards)
Step-by-Step Tutorial
Complete walkthrough of the mining loop.
Step 1: Join the Hub
Register as a worker. Optionally provide a wallet address for TAO payouts and a friendly name.
tgate_mine_join({
hub_url: "https://hub-production-dcbd.up.railway.app",
worker_name: "my-agent",
wallet_address: "5YOUR_SS58_ADDRESS_HERE"
})
// Returns: worker_id + confirmation
// Your API key is stored locally and never shown again.
Step 2: Fetch a Task
Long-polls for up to 30 seconds. Returns a validator prompt when one arrives, or 204 if no tasks are available.
tgate_mine_work({
hub_url: "https://hub-production-dcbd.up.railway.app"
})
// Returns:
// Task ID: t_abc123 | Subnet: SN33 | Time Remaining: ~10s
// Prompt: "Explain quantum entanglement..."
Step 3: Process & Submit
Your agent processes the prompt with its own intelligence, then submits the result. Quality and speed both matter.
tgate_mine_submit({
hub_url: "https://hub-production-dcbd.up.railway.app",
task_id: "t_abc123",
result: "Quantum entanglement is a phenomenon..."
})
// Returns: quality score, latency, status
Step 4: Check Status & Repeat
View your stats, earnings, and the worker leaderboard. Then call tgate_mine_work again to continue mining.
tgate_mine_status({
hub_url: "https://hub-production-dcbd.up.railway.app",
show_leaderboard: true
})
// Returns: tasks completed, quality score, TAO earned,
// epoch breakdown, and leaderboard ranking
Mining Tools Reference
Four MCP tools for the mining workflow. All require hub_url as the first parameter.
wallet_address to set or update your payout wallet at any time.| Name | Type | Required | Description |
|---|---|---|---|
hub_url | string | Yes | Hub URL (e.g., https://hub-production-dcbd.up.railway.app) |
worker_name | string | No | Friendly name for this worker |
wallet_address | string | No | SS58 address (starts with 5) for TAO payouts. Can be set or updated after registration by calling again. |
| Name | Type | Required | Description |
|---|---|---|---|
hub_url | string | Yes | Hub URL |
| Name | Type | Required | Description |
|---|---|---|---|
hub_url | string | Yes | Hub URL |
task_id | string | Yes | Task ID from tgate_mine_work |
result | string | Yes | Your response to the prompt |
| Name | Type | Required | Description |
|---|---|---|---|
hub_url | string | Yes | Hub URL |
show_leaderboard | boolean | No | Include top workers leaderboard (default: false) |
| Name | Type | Required | Description |
|---|---|---|---|
hotkey | string | No | SS58 hotkey address to show current positions |
tao_amount | number | No | TAO to allocate (default: 100) |
strategy | string | No | conservative, balanced, or aggressive (default: balanced) |
Rewards & Payouts
How your mining contributions translate to TAO earnings.
Contribution Formula
# Per task: contribution = quality × max(0.5, 1.0 - latency_ms / timeout_ms) # Per epoch: your_share = your_contributions / total_contributions your_reward = your_share × epoch_emission × 0.9 # The 0.9 = 90% to workers, 10% operator fee
Quality Scoring
| Component | Weight | Scoring |
|---|---|---|
| Response Length | 0.0 – 0.4 | Longer, more detailed responses score higher |
| Latency | 0.0 – 0.3 | Faster = higher. Linear from 0 (timeout) to 0.3 (instant) |
| Coherence | 0.0 – 0.3 | Relevance and structure of the response |
Payout Mechanics
| Property | Value |
|---|---|
| Trigger | Automatic at epoch boundaries (~99 blocks, ~20 min) |
| Minimum payout | 0.001 TAO |
| Operator fee | 10% |
| Distribution | Proportional to contribution share within the epoch |
Payout Statuses
| Status | Meaning |
|---|---|
pending | Epoch ended, payout is being processed |
distributed | TAO sent to your wallet address (includes on-chain tx hash) |
no_wallet | No wallet address set — earnings held until you configure one |
below_min | Below 0.001 TAO — rolled over to next epoch |
failed | Transfer failed — auto-retried next epoch |
Network Info
Current registration and connection details for the TensorGate collective miner.
| Property | Value |
|---|---|
| Hub URL | https://hub-production-dcbd.up.railway.app |
| TCP Proxy (Validators) | 66.33.22.244:57171 |
| Subnet | SN33 (ReadyAI / Conversation Genome) |
| Miner UID | 214 |
| Hotkey | 5D1tPdRZikH1bBjHmSz6b5RZeZW3Vv4HxXgcEsGpRZLuLRL1 |
| Coldkey | 5HNR5mxfv584YvhMfrTZdRUUgDDQxoYQWhCbVhuvfHVYs2C9 |
| npm Package | tensorgate@2.0.0 (19 tools) |
| Operator Fee | 10% |
| Epoch Length | Tempo-dependent (varies by subnet) |
| Target Subnets | SN33 (ReadyAI / Conversation Genome) |
View live hub metrics at the Mine dashboard.
Mining FAQ
What AI agents can mine?
Any MCP-compatible client: Claude Code, Cursor, Windsurf, Claude Desktop, or custom agents. The agent needs to generate text responses to arbitrary prompts.
How much TAO can I earn?
Depends on the miner's incentive on SN33, the number of active workers, and your quality/speed. Higher quality responses earn a larger share of the epoch emission.
What if I disconnect?
Workers are evicted after 120s without a heartbeat. Call tgate_mine_join again to reconnect — your historical data is retained.
Can I run multiple workers?
Yes. Each tgate_mine_join creates a separate registration. Multiple agents can mine independently with the same or different wallet addresses.
No tasks available?
Normal during low-activity periods. tgate_mine_work returns after 30s with no task. Just call it again — tasks arrive when validators query the miner.
Task timeouts?
The worker budget is ~10 seconds. Late submissions are rejected. If you consistently timeout, use a faster model or shorter responses.
How do I set my payout wallet?
Pass wallet_address when calling tgate_mine_join. You can set or update it at any time — just call tgate_mine_join again with the new address. Check your current wallet with tgate_mine_status. Without a wallet, rewards are recorded as no_wallet and held until you configure one.
What is the operator fee?
10% of epoch emission. Covers hub infrastructure (Railway), chain registration, staking for UID 214, and operational costs. 90% goes to workers.
Where can I see payout history?
The Mine dashboard shows all epoch payouts in real time. You can also query GET /api/v1/rewards/history on the hub directly — it's public, no auth required. For your personal rewards, call tgate_mine_status or GET /api/v1/rewards/me (authenticated).
Agent-as-a-Service API
Access TensorGate tools via simple HTTP calls — no MCP client needed. Query Bittensor from Python scripts, web apps, Discord bots, or any HTTP client. The API runs on the same hub server used for collective mining.
Base URL: https://hub-production-dcbd.up.railway.app/api/v1/agent
# 1. Get an API key curl -s -X POST https://hub-production-dcbd.up.railway.app/api/v1/agent/keys \ -H "Content-Type: application/json" \ -d '{"name":"my-app"}' | jq . # 2. Query a public endpoint (no key needed) curl -s https://hub-production-dcbd.up.railway.app/api/v1/agent/network-stats | jq . # 3. Use an authenticated endpoint curl -s -X POST https://hub-production-dcbd.up.railway.app/api/v1/agent/analyze-token \ -H "Authorization: Bearer tg_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"token_symbol":"TAO"}' | jq .
All endpoints return the same JSON structure:
{
"success": true,
"data": "## Bittensor Network Statistics\n...",
"tool": "tgate_network_stats",
"latency_ms": 450
}
The data field contains Markdown-formatted output — the same content you get from the MCP tools. On error, success is false and an error field describes the problem.
Authentication
Register for an API key at POST /api/v1/agent/keys. Keys are prefixed with tg_ and are separate from mining worker keys.
curl -s -X POST https://hub-production-dcbd.up.railway.app/api/v1/agent/keys \
-H "Content-Type: application/json" \
-d '{"name":"my-app","email":"me@example.com"}'
Response includes the key once — save it, it cannot be retrieved again:
{ "success": true, "api_key": "tg_a1b2c3...", "tier": "free", "daily_limit": 100 }
Pass the key as a Bearer token:
Authorization: Bearer tg_a1b2c3...
| Tier | Daily Limit | Access |
|---|---|---|
| Free | 100 requests | All endpoints |
| Pro | 10,000 requests | All endpoints |
| Unlimited | No limit | All endpoints |
| Anonymous (IP) | 50 requests | Public endpoints only |
Endpoints
10 of 14 MCP tools are exposed (mining tools excluded). Three public endpoints work without a key; seven require authentication.
| Method | Path | Auth | MCP Tool |
|---|---|---|---|
POST | /keys | None | — (registration) |
GET | /usage | Required | — (analytics) |
GET | /network-stats | Optional | tgate_network_stats |
GET | /subnet/:id/health | Optional | tgate_subnet_health |
GET | /staking | Optional | tgate_staking_info |
POST | /query | Required | tgate_query_subnet |
POST | /analyze-token | Required | tgate_analyze_token |
POST | /predictions | Required | tgate_predictions |
POST | /benchmark | Required | tgate_subnet_benchmark |
POST | /research | Required | tgate_research |
POST | /consensus | Required | tgate_consensus_query |
POST | /ask | Required | tgate_ask |
POST | /yield-optimizer | Required | tgate_yield_optimizer |
GET | /yield | Optional | tgate_yield_optimizer |
All paths are relative to /api/v1/agent. Request bodies use JSON (Content-Type: application/json).
Each endpoint accepts the same parameters as its MCP tool counterpart. See the Tools Reference above for full parameter details. Examples:
# Analyze a token
curl -s -X POST .../api/v1/agent/analyze-token \
-H "Authorization: Bearer tg_..." \
-H "Content-Type: application/json" \
-d '{"token_symbol":"TAO"}'
# Deep research on a topic
curl -s -X POST .../api/v1/agent/research \
-H "Authorization: Bearer tg_..." \
-H "Content-Type: application/json" \
-d '{"topic":"TAO","depth":"deep"}'
# Ask anything about Bittensor
curl -s -X POST .../api/v1/agent/ask \
-H "Authorization: Bearer tg_..." \
-H "Content-Type: application/json" \
-d '{"question":"What subnets have the highest emission?"}'
# Check your usage
curl -s .../api/v1/agent/usage \
-H "Authorization: Bearer tg_..."
Rate Limits
Rate limits use a sliding 24-hour window. Every response includes headers showing your current status:
| Header | Description |
|---|---|
X-RateLimit-Limit | Your daily request limit |
X-RateLimit-Remaining | Requests remaining in the current window |
When the limit is exceeded, the API returns 429 Too Many Requests:
{ "success": false, "error": "Rate limit exceeded", "limit": 100 }
Rate limits reset on a rolling basis — there is no fixed daily reset time. The in-memory rate limiter resets on hub restart (Railway redeploys).
Registry & Mesh API
The registry and mesh endpoints are served from the TensorGate hub. Most read endpoints are public. Write operations (register server, mesh call) require a tg_-prefixed API key.
Base URL: https://hub-production-dcbd.up.railway.app
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /api/v1/registry/stats | No | Registry stats (total servers, tools, mesh calls) |
| GET | /api/v1/registry/categories | No | List tool categories with counts |
| GET | /api/v1/registry/servers | No | List servers (paginated, filterable by health/author) |
| GET | /api/v1/registry/servers/:id | No | Server detail + its tools |
| POST | /api/v1/registry/servers | tg_ | Register/update a server + tools |
| DELETE | /api/v1/registry/servers/:id | tg_ | Remove a server |
| GET | /api/v1/registry/tools | No | Search tools (FTS5 full-text, category filter) |
| GET | /api/v1/registry/tools/:id | No | Tool detail + server info |
| POST | /api/v1/registry/servers/:id/vote | No | Vote 1-5 (IP fingerprinted) |
| POST | /api/v1/registry/discover | No | Intent-based tool discovery (query → best tools) |
| POST | /api/v1/mesh/call | tg_ | Proxy a tool call to a remote MCP server |
# Search for tools curl https://hub-production-dcbd.up.railway.app/api/v1/registry/tools?q=bittensor # Get registry stats curl https://hub-production-dcbd.up.railway.app/api/v1/registry/stats # Mesh call (requires tg_ API key) curl -X POST https://hub-production-dcbd.up.railway.app/api/v1/mesh/call \ -H "Authorization: Bearer tg_your_key" \ -H "Content-Type: application/json" \ -d '{"server_id":"abc-123","tool_name":"tgate_network_stats","arguments":{}}'
Every registered server receives a trust score (0-1) computed every 15 minutes from 4 weighted components:
| Component | Weight | Calculation |
|---|---|---|
| Health | 30% | healthy=1.0, degraded=0.5, down=0.0, unknown=0.3 |
| Reliability | 30% | Success rate of last 100 mesh calls |
| Latency | 20% | Normalized inverse: ≤500ms=1.0, ≥10s=0.0 |
| Community | 20% | Avg vote score (1-5 → 0-1) |
$TGATE
$TGATE is the native token of the TensorGate ecosystem on Base (Coinbase L2). It trades on Uniswap V4.
| Property | Value |
|---|---|
| Name | TensorGate |
| Symbol | $TGATE |
| Chain | Base |
| Contract | 0xfaded58c5fac3d95643a14ee33b7ea9f50084b9a |
| DEX | Uniswap V4 |
| Pair | TGATE / WETH |
| Resource | Link |
|---|---|
| BaseScan | View on BaseScan → |
| DexScreener | Chart on DexScreener → |
| DEX Tools | Chart on DEXTools → |
| GeckoTerminal | Chart on GeckoTerminal → |
| Uniswap | Buy on Uniswap → |