← 返回 Skills 市场
primer-dev

Bittensor Chutes x402

作者 primer-dev · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
100
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install chutes-x402
功能描述
Build a pay-per-inference proxy for Bittensor Chutes AI. Accept USDC payments for decentralized AI inference using x402.
使用说明 (SKILL.md)

Chutes AI Proxy (x402)

Build a pay-per-inference proxy for Bittensor Chutes (Subnet 64). Accept USDC payments on Base and forward requests to Chutes' decentralized AI network.

When to Use This Skill

Use this skill when the user wants to:

  • Build an AI inference API that accepts crypto payments
  • Wrap Chutes/Bittensor with their own pricing
  • Create a pay-per-request AI service without subscriptions
  • Monetize AI access using stablecoins
  • Set up a Bittensor-powered AI endpoint

How to Respond

User Says/Asks What to Do
"Create a Chutes proxy" Run x402 create chutes-proxy my-proxy
"I want to sell AI inference" Scaffold the proxy, explain the business model
"How do I accept payments for AI?" Explain x402 + Chutes, offer to scaffold
"Set up Bittensor integration" Run the create command
"What models does Chutes support?" List models (DeepSeek, Llama, Qwen, etc.)

Quick Start

Node.js / TypeScript

npx @primersystems/x402 create chutes-proxy my-ai-proxy
cd my-ai-proxy
npm install
cp .env.example .env
# Edit .env with your Chutes API key and wallet address
npm run dev

Python

pip install primer-x402
x402 create chutes-proxy my-ai-proxy
cd my-ai-proxy
pip install -r requirements.txt
cp .env.example .env
# Edit .env with your Chutes API key and wallet address
uvicorn main:app --reload

How It Works

User Request
     |
     v
[Your Proxy] -- No payment? --> Return 402 + price
     |
     v
User signs USDC payment (gasless)
     |
     v
[Your Proxy] -- Verify payment --> [Primer Facilitator]
     |
     v
[Chutes API] -- Forward request --> Bittensor Subnet 64
     |
     v
AI Response returned to user

You pre-pay Chutes with your API credits. Users pay YOU in USDC. You keep the margin.

Configuration

After scaffolding, edit .env:

Variable Description Required
CHUTES_API_KEY Your Chutes API key from chutes.ai Yes
WALLET_ADDRESS Your wallet to receive USDC Yes
PRICE_PER_1K_TOKENS Your price in USD (default: 0.001) No
FACILITATOR_URL x402 facilitator (default: Primer's) No

Getting a Chutes API Key

  1. Go to chutes.ai
  2. Sign up / connect wallet
  3. Subscribe to a tier ($3/month base)
  4. Generate API key (starts with cpk_)

Deployment

Cloudflare Workers (TypeScript - Free)

wrangler login
wrangler secret put CHUTES_API_KEY
wrangler secret put WALLET_ADDRESS
npm run deploy

Docker (Python)

docker build -t chutes-proxy .
docker run -p 8000:8000 --env-file .env chutes-proxy

Other Platforms

  • fly.io: fly launch && fly secrets set CHUTES_API_KEY=xxx
  • Railway/Render: Connect repo, set env vars in dashboard
  • Vercel Edge: Build and deploy TypeScript version

API Endpoints

Your proxy exposes:

Endpoint Description Payment
GET / Health check Free
POST /v1/chat/completions Chat completions (OpenAI-compatible) Required
GET /v1/models List available models Free

Supported Models

Any model on Chutes, including:

  • deepseek-ai/DeepSeek-V3
  • Qwen/Qwen3-235B-A22B
  • meta-llama/Llama-3.1-70B-Instruct
  • meta-llama/Llama-3.1-8B-Instruct

See chutes.ai for the full list.

Pricing Strategy

The proxy estimates tokens and charges upfront:

Price = (estimated_tokens / 1000) * PRICE_PER_1K_TOKENS

Set PRICE_PER_1K_TOKENS higher than Chutes' cost to make margin. Example:

  • Chutes costs you ~$0.0005/1K tokens
  • You charge $0.001/1K tokens
  • You keep 50% margin

Limitations

  • Streaming not supported - Template doesn't handle stream: true
  • Token estimation is approximate - Uses ~4 chars/token heuristic
  • Pre-payment only - No post-inference reconciliation

Use Cases

Who Why
AI agent operators Give agents paid AI access without API keys
API resellers Wrap Chutes with your branding/pricing
Privacy services AI without accounts or KYC
Bittensor miners Add stablecoin revenue stream

Testing Your Proxy

# Should return 402 Payment Required
curl http://localhost:8787/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"messages":[{"role":"user","content":"Hello"}]}'

# Pay and get response (using x402 CLI)
npx @primersystems/x402 pay http://localhost:8787/v1/chat/completions \
  --max-amount 0.01 \
  --method POST \
  --body '{"messages":[{"role":"user","content":"Hello"}]}'

Links

安全使用建议
Key things to consider before installing: 1) The SKILL.md requires CHUTES_API_KEY and WALLET_ADDRESS (and optionally FACILITATOR_URL) but the skill metadata did not declare required env vars — expect to provide secrets when you scaffold. 2) By default the template uses Primer's facilitator for payment verification — that means request and payment metadata may be sent to a third party; review Primer's privacy/security practices or set FACILITATOR_URL to a service you control. 3) The scaffold uses npx/pip to fetch packages (primer/x402); inspect the generated repository and the packages' GitHub/npm/pypi sources before running or deploying any code. 4) Do not place private wallet keys or other private keys in public or unsecured .env files; understand how payments are signed/verified and whether you need private keys. 5) Because this is instruction-only (no code to scan), a static scanner found nothing — but that also means there was nothing to audit; inspect generated code and network calls before production use. If you need higher assurance, request the upstream repository URL or the exact package manifests to review before running the scaffold commands.
功能分析
Type: OpenClaw Skill Name: chutes-x402 Version: 1.0.0 The skill bundle is a scaffolding tool designed to help users build a pay-per-inference AI proxy using the x402 protocol and Chutes AI (Bittensor Subnet 64). It provides instructions for the AI agent to execute legitimate setup commands using npx (@primersystems/x402) and pip (primer-x402). The logic is consistent with its stated purpose of monetizing AI inference via USDC payments on the Base network, and no indicators of data exfiltration, malicious execution, or prompt injection were found in SKILL.md or _meta.json.
能力评估
Purpose & Capability
The name/description (pay-per-inference proxy for Chutes/x402) aligns with the SKILL.md: it scaffolds a proxy, explains pricing, and shows deployment options. Requiring either Node or Python tooling is reasonable because the README provides both TypeScript and Python flows.
Instruction Scope
Runtime instructions tell the agent to scaffold code via npx/pip, copy/edit a .env, deploy with wrangler/docker/fly/etc., and to verify payments via a 'Primer Facilitator'. The SKILL.md implies your proxy will send payment verification and inference requests to external services (Primer facilitator, Chutes API). That means user requests and payment metadata will transit to third parties by default; the instructions do not detail what is sent or how to protect sensitive data.
Install Mechanism
This is an instruction-only skill with no install spec and no code files. That minimizes on-disk risk from the skill itself, but the scaffold step directs running npx/pip to fetch external packages (primer/x402). The skill does not itself download arbitrary archives.
Credentials
The SKILL.md requires CHUTES_API_KEY and WALLET_ADDRESS (marked as required) and mentions FACILITATOR_URL, but the registry metadata did not declare any required environment variables. The skill therefore fails to declare the secrets it needs. Also, defaulting FACILITATOR_URL to Primer's facilitator means payment verification data may flow to a third party unless the user overrides it.
Persistence & Privilege
The skill does not request always:true, does not modify other skills, and is user-invocable only. It does not request persistent platform privileges.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install chutes-x402
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /chutes-x402 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of primer-chutes for x402. - Enables creation of a pay-per-inference proxy for Bittensor Chutes AI (Subnet 64). - Accepts USDC payments on Base, forwarding requests to the decentralized Chutes AI network. - Provides scaffolding and deployment instructions for Node.js/TypeScript and Python. - Supports flexible pricing, model selection, and cloud deployment. - Ideal for monetizing AI endpoints and integrating crypto payments for AI services.
元数据
Slug chutes-x402
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Bittensor Chutes x402 是什么?

Build a pay-per-inference proxy for Bittensor Chutes AI. Accept USDC payments for decentralized AI inference using x402. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 100 次。

如何安装 Bittensor Chutes x402?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install chutes-x402」即可一键安装,无需额外配置。

Bittensor Chutes x402 是免费的吗?

是的,Bittensor Chutes x402 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Bittensor Chutes x402 支持哪些平台?

Bittensor Chutes x402 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Bittensor Chutes x402?

由 primer-dev(@primer-dev)开发并维护,当前版本 v1.0.0。

💬 留言讨论