# chainquery createrawtransaction

> chainquery createrawtransaction is a paid API for AI agents from x402.chainquery.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Builds an unsigned raw Bitcoin transaction hex from specified inputs and outputs via Bitcoin Core's createrawtransaction RPC, pay-per-call over x402.

## Facts

- Endpoint: GET https://x402.chainquery.com/v1/rpc/createrawtransaction
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/chainquery-createrawtransaction-0debbbfc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_H3kCMpk5glYJLHjnncWLH

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability chainquery-createrawtransaction-0debbbfc
```

Example prompt: Build me an unsigned raw Bitcoin transaction using input txid a1b2c3...d4e5 vout 0 and output bc1qxyz...abc with 0.001 BTC — I need the raw hex to sign manually.

## When to prefer this

Use this endpoint when you need to programmatically construct an unsigned raw Bitcoin transaction from known UTXOs and target addresses without running your own Bitcoin Core node. Ideal for wallet builders, signing workflows, PSBT pipelines, or any automation that needs a raw transaction hex prior to signing. Prefer over local node setup when you want pay-per-call access with no API key management.

## Known failure modes

- Invalid or malformed UTXO input (txid format wrong) — RPC error response
- Invalid Bitcoin address in outputs — RPC error with address validation message
- Negative or zero amount in outputs — RPC error
- Malformed JSON in params query parameter — HTTP 400 or RPC parse error
- Payment not received / x402 payment required — HTTP 402 response
- Insufficient USDC for x402 payment — HTTP 402
- Node unavailable or RPC timeout — HTTP 503 or timeout error

## How this service works

chainquery Bitcoin RPC: pay-per-call Bitcoin Core over x402, no API key. Build an unsigned raw transaction hex from inputs and outputs. Bitcoin Core createrawtransaction.

## Output

Returns a JSON object with a `result` field containing the unsigned raw transaction as a hex-encoded string, ready to be signed with signrawtransactionwithkey or used in a PSBT workflow.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "params": {
       "type": "string",
       "description": "optional: JSON-encoded array of positional RPC params"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "result": {
       "description": "createrawtransaction result"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/chainquery-createrawtransaction-0debbbfc/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.chainquery.com](https://www.zero.xyz/host/x402.chainquery.com/llms.txt)
