GpuFiles
One call

API and SDK

The app and the miner use the same public HTTP API as agents. JSON in, JSON out, CORS open. Base URL: https://gpufiles.com.

SDK

The SDK is one ES module served by this site. It shreds locally, pays with x402 when needed, and returns an in-memory index.

curl -sO https://gpufiles.com/sdk/gpufiles.mjs

import { GpuFiles } from "./gpufiles.mjs";
const pool = new GpuFiles({ key: process.env.AGENT_KEY }); // key only needed past the free tier

const job = await pool.embed([{ name: "handbook.md", text }]);
const index = await job.wait({ onProgress: (d, t) => console.log(d, "/", t) });

// embed the query with the same model (Xenova/all-MiniLM-L6-v2, mean pooling, normalised)
index.search(queryVector, 5); // [{ score, doc, position, text }]

Submit a job

POST /api/v1/jobs
{ "owner": sha256hex(secret),
  "fragments": [ { "id": "16 hex", "t": "text", "l": lane }, ... ] }

201 { "job": "a1b2...", "fragments": 412, "paid": { "kind": "free" | "x402" | "burn", ... } }
402 { "x402Version": 1, "accepts": [ { "scheme": "exact", "network": "eip155:4663",
      "asset": USDG, "payTo": vault, "maxAmountRequired": "20600", ... } ], "freeLeft": 0 }

Price: 0.05 USDG per 1,000 fragments, 0.01 USDG minimum. The first 600 fragments a day from a network are free. A job holds at most 2,000 fragments, decoys included.

Paying with x402

On a 402, sign an EIP-3009 TransferWithAuthorization for maxAmountRequired to payToagainst the USDG domain (name: "Global Dollar", version: "1", chainId: 4663), base64 the payload and retry with the X-PAYMENT header. The pool submits the authorization on-chain, waits for it, and answers 201 with an X-PAYMENT-RESPONSE receipt carrying the transaction hash. Your key pays no gas.

X-PAYMENT: base64({ x402Version: 1, scheme: "exact", network: "eip155:4663",
  payload: { signature, authorization: { from, to, value, validAfter, validBefore, nonce } } })

Follow and collect

GET    /api/v1/jobs/:id                    X-Job-Secret: secret   → { total, done, complete, miners, lanes }
GET    /api/v1/jobs/:id/vectors?after=&limit=500  X-Job-Secret: secret   → { vectors: [{ id, v }], next }
DELETE /api/v1/jobs/:id                    X-Job-Secret: secret   → deletes every fragment

v is a base64 little-endian Float32Array of 384 values.

Mining

POST /api/v1/mine/hello   { device }                    → { session, model, dims, lanes, k, ... }
POST /api/v1/mine/pull    { session, own?: [{ job, secret }] }   → { items: [{ id, j, t }], session }
POST /api/v1/mine/submit  { session, results: [{ id, j, v }] }   → { credited, events, session }
GET  /api/v1/mine/session?id=                           → { shares, minted, embedded, canary_pass, ... }

Notes and settlement

GET  /api/v1/notes/key                    → { suite, spki, keyId, noteValue }
POST /api/v1/notes/mint    { session, blinded: [b64] }   → { sigs: [b64], shares }
POST /api/v1/notes/redeem  { notes: [{ m, s }], to }     → { redemption, accepted, alreadySpent, value }
GET  /api/v1/notes/:redemption             → { notes, batch, tx, amount }
GET  /api/v1/batches                       → settled batches
GET  /api/v1/batches/:n?nullifier=hex      → leaves and a Merkle proof
GET  /api/v1/stats   GET /api/v1/params