0xBS
Getting started

Quickstart

Discover a device contract, then invoke a service. The same path an agent uses to settle USDC and move hardware.

Discover a device

Every device has a public deviceId. Ask the API what it offers:

curl https://device-controller.0xbs.org/public/device/DEVICE_ID

You get the device name, description, and every service with its argument schema, whether it is free or paid, and whether it needs a password. See Discover devices for the full response shape.

Call a free service

Free services return the device result directly — no wallet needed:

curl -X POST \  https://device-controller.0xbs.org/quote/device/DEVICE_ID/service/SERVICE_ID \  -H "content-type: application/json" \  -d '{"params":{"room":"100","floor":"5"}}'

Call a paid service (x402)

Paid services reply 402 with standard x402 requirements. Wrap fetch with an x402 adapter and it pays + retries automatically:

import {  createSigner, wrapFetchWithPayment, decodeXPaymentResponse,  type MultiNetworkSigner,} from "x402-fetch";const evm = await createSigner("base", process.env.AGENT_EVM_PRIVATE_KEY!);const svm = await createSigner("solana", process.env.AGENT_SOLANA_PRIVATE_KEY!);const wallet = { evm, svm } as MultiNetworkSigner;const fetchWithPay = wrapFetchWithPayment(fetch, wallet, 1_000_000n); // cap 1 USDCconst res = await fetchWithPay(  "https://device-controller.0xbs.org/quote/device/DEVICE_ID/service/SERVICE_ID",  { method: "POST",    headers: { "content-type": "application/json" },    body: JSON.stringify({ params: { room: "100", floor: "5" } }) },);const xpr = res.headers.get("x-payment-response");if (xpr) console.log("settled:", decodeXPaymentResponse(xpr));console.log(await res.json());

Password-protected services

If discovery shows passwordProtected: true, add the credentials the owner gave you:

{  "username": "agent-alice",  "password": "s3cr3t",  "params": { "room": "100", "floor": "5" }}

Agents

Wiring Claude or ChatGPT so a prompt can settle and actuate? See Claude & ChatGPT.