Ai compute x402
Skill plagtech/ai-compute-x402
Pay-per-call AI inference for agents — 200+ LLMs, decentralized Bittensor models, image generation, embeddings, and GPU workloads. OpenAI-compatible, settled in USDC via x402 with no API keys or accounts. Powered by Spraay Protocol.From its SKILL.md
npx -y skills add plagtech/ai-compute-x402Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
3.5 KB, 891 tokens by cl100k_base, as published. Nobody here has run it
AI Compute
Run inference and GPU workloads without provider API keys or accounts. This skill wraps the Spraay x402 Gateway (gateway.spraay.app): OpenAI-compatible chat completions across 200+ models, decentralized inference via Bittensor, image generation, embeddings, and arbitrary GPU jobs. The agent pays per call in USDC over x402 — useful when you want a single wallet to cover compute across many providers.
When to use this skill
- Call an LLM (chat completions, function calling, vision) without holding an OpenAI/Anthropic key
- Run inference on decentralized Bittensor models (SN64 Chutes, SN19 Nineteen)
- Generate images or embeddings
- Submit a GPU job (image, video, audio, or LLM workloads via Replicate) and poll for results
OpenAI-compatible endpoints accept the standard request body, so existing SDKs work by pointing baseURL at the gateway path.
Setup
npm install x402-client
export EVM_PRIVATE_KEY=0x... # wallet holding USDC on Base
import { createClient } from "x402-client";
const client = createClient({
baseUrl: "https://gateway.spraay.app",
privateKey: process.env.EVM_PRIVATE_KEY,
});
Endpoints
Inference (200+ models)
| Method | Path | Price | Description |
|---|---|---|---|
| POST | /api/v1/chat/completions | $0.04 | OpenAI-compatible chat completions. 200+ models via BlockRun + OpenRouter. Streaming, function calling, vision. |
| GET | /api/v1/models | $0.001 | List available models with pricing and capability metadata. |
Bittensor — decentralized AI
| Method | Path | Price | Description |
|---|---|---|---|
| GET | /bittensor/v1/models | $0.001 | List decentralized models. OpenAI /v1/models compatible. |
| POST | /bittensor/v1/chat/completions | $0.03 | Chat completions via Bittensor SN64 (Chutes). 43+ models. |
| POST | /bittensor/v1/images/generations | $0.05 | Image generation via Bittensor SN19 (Nineteen AI). |
| POST | /bittensor/v1/embeddings | $0.005 | Text embeddings via Bittensor. OpenAI-compatible. |
GPU workloads
| Method | Path | Price | Description |
|---|---|---|---|
| POST | /api/v1/gpu/run | $0.06 | Run GPU inference via Replicate — image, video, audio, LLM. |
| GET | /api/v1/gpu/status/:id | $0.005 | Check status of a GPU prediction job by ID. |
| GET | /api/v1/gpu/models | FREE | Curated GPU model shortcuts (Flux, SDXL, Whisper, ...). |
Examples
Chat completion (OpenAI-shaped body):
const out = await client.post("/api/v1/chat/completions", {
model: "gpt-4o-mini",
messages: [{ role: "user", content: "Summarize Base in one sentence." }],
});
Decentralized inference on Bittensor:
const out = await client.post("/bittensor/v1/chat/completions", {
model: "chutes/...",
messages: [{ role: "user", content: "..." }],
});
GPU image job, then poll:
const job = await client.post("/api/v1/gpu/run", { model: "flux", input: { prompt: "..." } });
const status = await client.get(`/api/v1/gpu/status/${job.id}`);
Notes
- Endpoints are OpenAI-compatible where noted — point any OpenAI SDK's
baseURLat the gateway path. - Full catalog: https://docs.spraay.app · Live traffic: https://live.spraay.app
What ships with it: 5 files
4.9 KB alongside SKILL.md
.plugin/
- plugin.json697 B
commands/
- run-model.md817 B
rules/
- ai-compute.mdc2.6 KB