Skip to main content

Pay-per-run with crypto

Machine Payments let any program call Subconscious agents and pay per run with USDC on Base. No account, no API key. Just an HTTP request and an on-chain payment. Built on the open x402 protocol, machine payment endpoints return a standard 402 Payment Required response when called without payment. Any x402-compatible client handles the payment flow automatically.

Search run

$0.10 per run. Run a deep search with a preselected engine and search tools.

Full agent run

$0.50 per run. Full control over the engine, instructions, and tools to kick off an agent.

How it works

1

Make a request

POST to a machine endpoint without any auth headers.
2

Receive a 402

The server responds with 402 Payment Required and payment details (amount, network, deposit address).
3

Pay on-chain

Send the required USDC amount on Base to the provided address.
4

Retry with payment proof

Re-send the same request with the X-Payment header containing the payment proof. The server verifies payment and returns a runId.
5

Poll for results

Use the runId to poll the GET endpoint until the run succeeds or fails. Polling is free.
Use any x402-compatible client (like purl) to handle steps 2–4 automatically.

Endpoints

Search run ($0.10)

Runs a web search agent against your query. The engine and tools are managed for you. Just provide a description.
instructions
string
required
The search query or task instructions for the agent.
POST /v1/machines/searches
Request body
{
  "instructions": "Latest news on frontier AI models"
}

Full agent run ($0.50)

Full control over engine, instructions, and tools. Mirrors the shape of POST /v1/runs without org-specific fields.
POST /v1/machines/runs
Request body
{
  "engine": "tim-gpt",
  "input": {
    "instructions": "Summarize the top 5 AI papers from Feb 2026",
    "tools": ["web_search"],
    "answerFormat": { "type": "object" }
  }
}
FieldRequiredNotes
engineYestim, tim-edge, timini, tim-gpt, or tim-gpt-heavy
input.instructionsYesTask for the agent
input.toolsNoOmit for pure reasoning
input.answerFormatNoJSON schema to shape the response
input.reasoningFormatNoJSON schema for reasoning output
output.callbackUrlNoWebhook URL called on completion

Response

Both endpoints return 202 Accepted immediately with a runId:
{
  "runId": "550e8400-e29b-41d4-a716-446655440000",
  "status": "queued"
}

Polling for results

GET /v1/machines/searches/:runId
GET /v1/machines/runs/:runId
Free, no payment required. Poll until status is succeeded or failed.
{
  "runId": "550e8400-e29b-41d4-a716-446655440000",
  "status": "succeeded",
  "result": {
    "answer": "...",
    "reasoning": "..."
  },
  "usage": {
    "inputTokens": 120,
    "outputTokens": 340,
    "durationMs": 4200
  }
}

Status values

StatusMeaning
queuedRun is waiting to be processed
processingAgent is actively working
succeededRun completed. result is available.
failedRun errored. Check the error field.

Example with curl

# 1. Hit the endpoint (returns 402 with payment details)
curl -X POST https://api.subconscious.dev/v1/machines/searches \
  -H "Content-Type: application/json" \
  -d '{"instructions": "Latest AI news"}'

# 2. Pay with purl (x402 CLI), which handles payment and returns runId
purl -X POST https://api.subconscious.dev/v1/machines/searches \
  -d '{"instructions": "Latest AI news"}'

# 3. Poll for result (free, no payment needed)
curl https://api.subconscious.dev/v1/machines/searches/<runId>

x402 Protocol

Machine Payments use the x402 protocol, an open standard for HTTP-native payments. When a request arrives without a valid X-Payment header, the server returns:
HTTP/1.1 402 Payment Required
The response body contains everything a client needs to complete the payment: amount, network (Base), token (USDC), and deposit address. After paying on-chain, the client retries the original request with the payment proof in the X-Payment header. Any x402-compatible HTTP client (like purl) handles this automatically — your code just makes a normal HTTP request.