{"openapi":"3.1.0","info":{"title":"stampthisfile","version":"1.0.0","description":"Timestamp SHA-256 hashes in Bitcoin with OpenTimestamps. 0.05 USDC per hash on Base, paid with x402 v2 (no account). An MCP server with the same capabilities is at POST /mcp. Full guide: https://stampthisfile.com/llms.txt","contact":{"name":"stampthisfile (XP Farm Studio)","url":"https://xpfarmstudio.com"},"x-guidance":"Hash the file yourself (SHA-256, hex) and never send the file. POST /v1/stamps {\"hashes\": [\"<sha256>\"]}: the 402 answer carries the x402 price (per hash). Pay with an x402 client (exact scheme, USDC) and repeat the request with PAYMENT-SIGNATURE. Save each stamp's base64 `ots` proof; it completes in Bitcoin within hours (GET /v1/stamps/{id}.ots again, or pass webhook.url). Read /evidence.md before stamping for what a stamp proves and when it is enough as evidence."},"servers":[{"url":"https://stampthisfile.com"}],"paths":{"/v1/stamps":{"post":{"operationId":"createStamps","summary":"Stamp 1–100 hashes (paid with x402)","x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.05"},"protocols":[{"x402":{}}]},"security":[],"description":"Without PAYMENT-SIGNATURE: 402 with the x402 PaymentRequired (also in the PAYMENT-REQUIRED header). With it: 200 with a pending .ots proof per hash and a signed receipt; PAYMENT-RESPONSE carries the settlement.","parameters":[{"name":"PAYMENT-SIGNATURE","in":"header","required":false,"schema":{"type":"string"},"description":"base64 x402 v2 PaymentPayload"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StampRequest"}}}},"responses":{"200":{"description":"Stamped (pending in Bitcoin)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StampResponse"}}}},"400":{"description":"Invalid input; never charged","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment required, or payment failed","content":{"application/json":{"schema":{"type":"object","description":"x402 PaymentRequired"}}}},"503":{"description":"Calendars or facilitator unavailable; nothing charged","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/stamps/{id}":{"get":{"operationId":"getStamp","security":[],"summary":"Stamp status (free). Append .ots to the id for the proof file.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^stp_[a-z2-7]{26}(\\.ots)?$"}}],"responses":{"200":{"description":"Status JSON, or the .ots proof when the id ends in .ots","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StampStatus"}},"application/vnd.opentimestamps.v1":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"No such stamp","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/verify":{"post":{"operationId":"verifyProof","security":[],"summary":"Verify an .ots proof against a file hash (free)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["hash","ots"],"properties":{"hash":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"},"ots":{"type":"string","description":"base64 .ots, at most 64 KB"}}}}}},"responses":{"200":{"description":"The verdict","content":{"application/json":{"schema":{"type":"object","properties":{"valid":{"type":"boolean"},"status":{"enum":["complete","pending","invalid"]},"bitcoin":{"type":"object","properties":{"height":{"type":"integer"},"block_time":{"type":"string","format":"date-time"}}},"statement":{"type":"string"},"calendars":{"type":"array","items":{"type":"string"}},"reason":{"type":"string"},"upgraded":{"type":"boolean","description":"The proof sent was pending; its Bitcoin path was fetched from the calendars"},"ots":{"type":"string","description":"When upgraded: the completed .ots, base64. Keep it instead of the pending one."}}}}}}}}}},"webhooks":{"stampsEvent":{"post":{"summary":"stamps.completed / stamps.failed, one per batch (Standard Webhooks; v1a Ed25519 always, v1 HMAC when signing_key was given)","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"2xx":{"description":"Delivered"}}}}},"components":{"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}}}}},"StampRequest":{"type":"object","required":["hashes"],"additionalProperties":false,"properties":{"hashes":{"type":"array","minItems":1,"maxItems":100,"uniqueItems":true,"items":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}},"webhook":{"type":"object","required":["url"],"additionalProperties":false,"properties":{"url":{"type":"string","format":"uri","description":"Public https URL"},"signing_key":{"type":"string","pattern":"^whsec_[A-Za-z0-9+/]+={0,2}$","description":"Optional: also sign deliveries with HMAC (Standard Webhooks v1); 24–64 bytes"}}}}},"StampResponse":{"type":"object","properties":{"batch_id":{"type":"string"},"stamps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hash":{"type":"string"},"status":{"enum":["pending","complete","failed"]},"ots":{"type":"string","description":"base64 .ots"},"ots_url":{"type":"string"},"status_url":{"type":"string"}}}},"receipt":{"type":"object","description":"Signed: \"stampthisfile-receipt-v1\\n\" + RFC 8785 JSON of the receipt without signature"}}},"StampStatus":{"type":"object","properties":{"id":{"type":"string"},"hash":{"type":"string"},"status":{"enum":["pending","complete","failed"]},"bitcoin":{"type":"object","properties":{"height":{"type":"integer"},"block_time":{"type":"string","format":"date-time"}}},"statement":{"type":"string"},"ots_url":{"type":"string"}}},"WebhookEvent":{"type":"object","properties":{"type":{"enum":["stamps.completed","stamps.failed"]},"timestamp":{"type":"string","format":"date-time"},"data":{"type":"object"}}}}}}