{"openapi":"3.1.0","info":{"title":"Crypto Tax Computation API","version":"1.0.0","description":"Cost-basis lots, specific ID, Form 8949, UK share pooling, Canada ACB, Australia CGT discount, German §23 holding, income valuation, transfer matching, fee allocation, tax-loss harvest, derivatives P/L, unrealised snapshots, CSV normalize and missing-basis checks — pure computation on caller ledgers and prices. Paid with x402 exact USDC on Base. No account is required.","contact":{"email":"support@brainiac.software"},"x-guidance":"BRAINIAC.software is a pay-per-call API for software agents. No account or API key is required.\nPayment uses x402 with exact USDC on Base (8453). Each paid resource accepts POST for the call; unpaid GET/HEAD return the same 402 payment challenge for discovery.\nHow to call an operation:\n1. POST JSON matching the requestBody. An unpaid POST (including empty body) returns 402 payment terms before body validation.\n2. Compare 402 payTo, asset, and network with /api/v1/catalog and /.well-known/x402 — not only with the 402 itself.\n3. Pay and retry with payment-signature. Invalid JSON/schema after payment-signature returns 400 and is not charged. Settlement (a charge) only on 2xx. payment-signature attached ≠ charged.\nIdempotency-Key: 64 hex chars from 32 random bytes. Reuse only for the same operation and body (replays stored response, including status=partial). A new key runs a fresh call.\nIdempotency after errors: unpaid 402 does not store the key. Post-signature 402/503 release it (retry same key). Pre-reserve schema 400 does not store it. Other post-signature responses (2xx/4xx/5xx) are stored: same key+body replays; different body → 409. Stored 4xx/5xx replays are not a second charge. Prefer a new key after fixing a 4xx; after 5xx reuse the same key only for the stored error.\nPost-signature 402/503 include prior-payment-attempt (nonce, settled false|unknown). A facilitator 502 is SETTLEMENT_UNKNOWN (stored under the Idempotency-Key; cross-instance replay needs the shared store; may already be charged) — check USDC authorizationState(payer, nonce) on Base before re-signing.\nSettlement signal: settled 2xx include payment-response. 4xx/5xx do not. Do not book a cost from payment-signature alone.\nCoverage billing: HTTP 200 with status complete, partial, or failed is charged at the full listed price. Retrying missing checks needs a new settled call. 4xx/5xx are not charged.\nmissing_items.reason: timeout/rate_limited → one delayed retry (new key); upstream_down → after recovery; not_supported → never.\nInvariants: any missing_items ⇒ not status complete; sources[] is provenance only (source, url, retrievedAt), never success/error keyed by check.\nFree lookup: GET /api/v1/results/{result_id} returns stored coverage JSON (404 RESULT_NOT_FOUND if unknown/expired; not a 402). Prior-Result-Id sets replaces_result_id.\nOutputs are prechecks/drafts for human review — not official determinations, legal advice, or certified filings."},"servers":[{"url":"https://www.brainiac.software"}],"paths":{"/api/v1/crypto-tax/cost-basis-lots":{"post":{"operationId":"match_disposals_to_acquisition_lots","summary":"Match disposals to acquisition lots","description":"Match disposals to acquisition lots by FIFO, LIFO, HIFO or average cost and compute gains from a caller-supplied ledger and fiat values. No market prices are fetched.","tags":["crypto-tax"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"fiatCurrency":{"type":"string","minLength":3,"maxLength":3},"method":{"type":"string","enum":["FIFO","LIFO","HIFO","AVERAGE"]},"feePolicy":{"default":"add_to_basis_and_deduct_from_proceeds","type":"string","enum":["add_to_basis_and_deduct_from_proceeds","ignore"]},"ledger":{"minItems":1,"maxItems":100000,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"ts":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"type":{"type":"string","enum":["buy","sell","transfer_in","transfer_out","income","fee","trade"]},"asset":{"type":"string","minLength":1,"maxLength":32},"qty":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"fiatValue":{"type":"integer","minimum":0,"maximum":9007199254740991},"feeFiat":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"wallet":{"type":"string","minLength":1,"maxLength":128},"txHash":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]},"counterAsset":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]},"counterQty":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]}},"required":["id","ts","type","asset","qty","fiatValue","wallet"],"additionalProperties":false}}},"required":["fiatCurrency","method","ledger"],"additionalProperties":false},"example":{"fiatCurrency":"USD","method":"FIFO","feePolicy":"add_to_basis_and_deduct_from_proceeds","ledger":[{"id":"b1","ts":"2025-01-01T00:00:00Z","type":"buy","asset":"BTC","qty":"1","fiatValue":1000000,"feeFiat":0,"wallet":"w1"},{"id":"b2","ts":"2025-02-01T00:00:00Z","type":"buy","asset":"BTC","qty":"1","fiatValue":2000000,"feeFiat":0,"wallet":"w1"},{"id":"s1","ts":"2025-03-01T00:00:00Z","type":"sell","asset":"BTC","qty":"1.5","fiatValue":4500000,"feeFiat":0,"wallet":"w1"}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. For coverage operations, HTTP 200 is used for status complete, partial, and failed; all three settle and are charged at the full listed price. A settled 2xx includes a payment-response response header (facilitator settlement receipt; may include a transaction reference). Conditional fields depend on the result and data-source availability.","headers":{"payment-response":{"description":"Present on settled 2xx only. Facilitator settlement receipt for the x402 payment (not present on 4xx/5xx, which are not charged).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"disposals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"asset":{"type":"string"},"qty":{"type":"string"},"proceeds":{"type":"number"},"basis":{"type":"number"},"gain":{"type":"number"},"matches":{"type":"array","items":{"type":"object","properties":{"lotId":{"type":"string"},"qty":{"type":"string"},"basis":{"type":"number"},"acquiredTs":{"type":"string"}},"additionalProperties":true}}},"additionalProperties":true}},"openLots":{"type":"array","items":{"type":"object","properties":{"lotId":{"type":"string"},"asset":{"type":"string"},"qty":{"type":"string"},"basis":{"type":"number"},"acquiredTs":{"type":"string"},"wallet":{"type":"string"}},"additionalProperties":true}},"warnings":{"type":"array","items":{}},"fiatCurrency":{"type":"string"},"method":{"type":"string"},"sources":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"url":{"type":"string"},"retrievedAt":{"type":"string"},"status":{"type":"string"}},"additionalProperties":true},"description":"Provenance only (source, url, retrievedAt). Not keyed by check id and does not carry success or error. A check in missing_items does not remove its upstream from sources[]; unavailability is only in missing_items (and unavailable findings)."},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"disposals":[{"id":"s1","asset":"BTC","qty":"1.5","proceeds":4500000,"basis":2000000,"gain":2500000,"matches":[{"lotId":"b1","qty":"1","basis":1000000,"acquiredTs":"2025-01-01T00:00:00Z"},{"lotId":"b2","qty":"0.5","basis":1000000,"acquiredTs":"2025-02-01T00:00:00Z"}]}],"openLots":[{"lotId":"b2","asset":"BTC","qty":"0.5","basis":1000000,"acquiredTs":"2025-02-01T00:00:00Z","wallet":"w1"}],"warnings":[],"fiatCurrency":"USD","method":"FIFO","sources":[{"source":"Caller-supplied ledger, prices and jurisdiction inputs processed locally","url":"https://www.brainiac.software/api/v1/crypto-tax","retrievedAt":"2026-11-14","status":"ok"}],"limitations":["Lot matching uses FIFO. Partial-lot basis uses half-even rounding to the minor unit; the final slice of a lot takes the…","Pure computation on caller input: no exchange, wallet, market-price or tax-authority API is called at request time.","…"]}}}},"400":{"description":"Invalid JSON or request schema. Not charged (no payment-response). If this 400 is returned before the Idempotency-Key is reserved, the key is not stored — fix the body and you may reuse the key. If an operation-path 400 was stored after a payment-signature was attached, the same key + same body replays it; the same key + a different body returns 409."},"402":{"description":"Payment required. The JSON body is the x402 PaymentRequired object. An unpaid 402 does not store the Idempotency-Key. A 402 after payment-signature releases the key and includes prior-payment-attempt (nonce, settled false|unknown). Not charged; no payment-response. Before re-signing after a post-signature 402, check USDC authorizationState(payer, nonce) on Base."},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Same key with a different body after a stored result returns conflict. Reusing the key cannot trigger a second charge. Not charged when settlement did not occur."},"413":{"description":"Request body exceeds the 24 MB limit. Not charged."},"500":{"description":"Operation failed before settlement, so no payment is taken (no payment-response). The error is stored: reuse the same Idempotency-Key and body to retrieve it without paying again. Use a new key for a fresh attempt with a new payment-signature."},"502":{"description":"Facilitator verify/settle transport failure (often timeout). After payment-signature this is returned as SETTLEMENT_UNKNOWN with prior-payment-attempt; the outcome is stored under the Idempotency-Key. With the shared store configured, other instances replay it instead of settling again; without it, each instance keeps its own memory. The authorization may already be settled on-chain — do not re-sign until USDC authorizationState(payer, nonce) on Base is false."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run. Not charged; no payment-response. A 503 after payment-signature releases the Idempotency-Key and includes prior-payment-attempt."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.05"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/crypto-tax/specific-id-select":{"post":{"operationId":"apply_specific_identification_lot_selections","summary":"Apply specific-identification lot selections","description":"Apply caller-chosen lot identifications to disposals, validate timing and quantities, and return matched basis or structured selection errors.","tags":["crypto-tax"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"fiatCurrency":{"default":"USD","type":"string","minLength":3,"maxLength":3},"feePolicy":{"default":"add_to_basis_and_deduct_from_proceeds","type":"string","enum":["add_to_basis_and_deduct_from_proceeds","ignore"]},"ledger":{"minItems":1,"maxItems":100000,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"ts":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"type":{"type":"string","enum":["buy","sell","transfer_in","transfer_out","income","fee","trade"]},"asset":{"type":"string","minLength":1,"maxLength":32},"qty":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"fiatValue":{"type":"integer","minimum":0,"maximum":9007199254740991},"feeFiat":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"wallet":{"type":"string","minLength":1,"maxLength":128},"txHash":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]},"counterAsset":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]},"counterQty":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]}},"required":["id","ts","type","asset","qty","fiatValue","wallet"],"additionalProperties":false}},"selections":{"minItems":1,"maxItems":100000,"type":"array","items":{"type":"object","properties":{"disposalId":{"type":"string","minLength":1},"lots":{"minItems":1,"type":"array","items":{"type":"object","properties":{"lotId":{"type":"string","minLength":1},"qty":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"}},"required":["lotId","qty"],"additionalProperties":false}}},"required":["disposalId","lots"],"additionalProperties":false}}},"required":["ledger","selections"],"additionalProperties":false},"example":{"fiatCurrency":"USD","ledger":[{"id":"b1","ts":"2025-01-01T00:00:00Z","type":"buy","asset":"BTC","qty":"1","fiatValue":1000000,"feeFiat":0,"wallet":"w1"},{"id":"b2","ts":"2025-02-01T00:00:00Z","type":"buy","asset":"BTC","qty":"1","fiatValue":2000000,"feeFiat":0,"wallet":"w1"},{"id":"s1","ts":"2025-03-01T00:00:00Z","type":"sell","asset":"BTC","qty":"1.5","fiatValue":4500000,"feeFiat":0,"wallet":"w1"}],"selections":[{"disposalId":"s1","lots":[{"lotId":"b1","qty":"1"},{"lotId":"b2","qty":"0.5"}]}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. For coverage operations, HTTP 200 is used for status complete, partial, and failed; all three settle and are charged at the full listed price. A settled 2xx includes a payment-response response header (facilitator settlement receipt; may include a transaction reference). Conditional fields depend on the result and data-source availability.","headers":{"payment-response":{"description":"Present on settled 2xx only. Facilitator settlement receipt for the x402 payment (not present on 4xx/5xx, which are not charged).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"disposals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"asset":{"type":"string"},"qty":{"type":"string"},"proceeds":{"type":"number"},"basis":{"type":"number"},"gain":{"type":"number"},"matches":{"type":"array","items":{"type":"object","properties":{"lotId":{"type":"string"},"qty":{"type":"string"},"basis":{"type":"number"},"acquiredTs":{"type":"string"}},"additionalProperties":true}}},"additionalProperties":true}},"openLots":{"type":"array","items":{"type":"object","properties":{"lotId":{"type":"string"},"asset":{"type":"string"},"qty":{"type":"string"},"basis":{"type":"number"},"acquiredTs":{"type":"string"},"wallet":{"type":"string"}},"additionalProperties":true}},"warnings":{"type":"array","items":{}},"errors":{"type":"array","items":{}},"sources":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"url":{"type":"string"},"retrievedAt":{"type":"string"},"status":{"type":"string"}},"additionalProperties":true},"description":"Provenance only (source, url, retrievedAt). Not keyed by check id and does not carry success or error. A check in missing_items does not remove its upstream from sources[]; unavailability is only in missing_items (and unavailable findings)."},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"disposals":[{"id":"s1","asset":"BTC","qty":"1.5","proceeds":4500000,"basis":2000000,"gain":2500000,"matches":[{"lotId":"b1","qty":"1","basis":1000000,"acquiredTs":"2025-01-01T00:00:00Z"},{"lotId":"b2","qty":"0.5","basis":1000000,"acquiredTs":"2025-02-01T00:00:00Z"}]}],"openLots":[{"lotId":"b2","asset":"BTC","qty":"0.5","basis":1000000,"acquiredTs":"2025-02-01T00:00:00Z","wallet":"w1"}],"warnings":[],"errors":[],"sources":[{"source":"Caller-supplied ledger, prices and jurisdiction inputs processed locally","url":"https://www.brainiac.software/api/v1/crypto-tax","retrievedAt":"2026-11-14","status":"ok"}],"limitations":["Specific identification requires selected lots to exist, predate the disposal, match the asset, and sum exactly to the …","Pure computation on caller input: no exchange, wallet, market-price or tax-authority API is called at request time.","…"]}}}},"400":{"description":"Invalid JSON or request schema. Not charged (no payment-response). If this 400 is returned before the Idempotency-Key is reserved, the key is not stored — fix the body and you may reuse the key. If an operation-path 400 was stored after a payment-signature was attached, the same key + same body replays it; the same key + a different body returns 409."},"402":{"description":"Payment required. The JSON body is the x402 PaymentRequired object. An unpaid 402 does not store the Idempotency-Key. A 402 after payment-signature releases the key and includes prior-payment-attempt (nonce, settled false|unknown). Not charged; no payment-response. Before re-signing after a post-signature 402, check USDC authorizationState(payer, nonce) on Base."},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Same key with a different body after a stored result returns conflict. Reusing the key cannot trigger a second charge. Not charged when settlement did not occur."},"413":{"description":"Request body exceeds the 24 MB limit. Not charged."},"500":{"description":"Operation failed before settlement, so no payment is taken (no payment-response). The error is stored: reuse the same Idempotency-Key and body to retrieve it without paying again. Use a new key for a fresh attempt with a new payment-signature."},"502":{"description":"Facilitator verify/settle transport failure (often timeout). After payment-signature this is returned as SETTLEMENT_UNKNOWN with prior-payment-attempt; the outcome is stored under the Idempotency-Key. With the shared store configured, other instances replay it instead of settling again; without it, each instance keeps its own memory. The authorization may already be settled on-chain — do not re-sign until USDC authorizationState(payer, nonce) on Base is false."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run. Not charged; no payment-response. A 503 after payment-signature releases the Idempotency-Key and includes prior-payment-attempt."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.05"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/crypto-tax/us-form-8949-rows":{"post":{"operationId":"build_irs_form_8949_rows","summary":"Build IRS Form 8949 rows","description":"Produce Form 8949 rows and Schedule D box totals from caller disposals using 2025 short/long-term and 1099-B / 1099-DA box rules.","tags":["crypto-tax"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"taxYear":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"roundToDollars":{"default":false,"type":"boolean"},"disposals":{"minItems":1,"maxItems":100000,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"description":{"type":"string","minLength":1,"maxLength":256},"acquired":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"sold":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"proceeds":{"type":"integer","minimum":0,"maximum":9007199254740991},"basis":{"type":"integer","minimum":0,"maximum":9007199254740991},"adjustmentCode":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}]},"adjustment":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reportedOn":{"type":"string","enum":["1099-DA","1099-B","none"]},"basisReported":{"type":"boolean"}},"required":["id","description","acquired","sold","proceeds","basis","reportedOn","basisReported"],"additionalProperties":false}}},"required":["taxYear","disposals"],"additionalProperties":false},"example":{"taxYear":2025,"disposals":[{"id":"s1","description":"1.5 BTC","acquired":"2024-01-10","sold":"2025-01-11","proceeds":4500000,"basis":2000000,"adjustmentCode":null,"adjustment":0,"reportedOn":"1099-DA","basisReported":true}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. For coverage operations, HTTP 200 is used for status complete, partial, and failed; all three settle and are charged at the full listed price. A settled 2xx includes a payment-response response header (facilitator settlement receipt; may include a transaction reference). Conditional fields depend on the result and data-source availability.","headers":{"payment-response":{"description":"Present on settled 2xx only. Facilitator settlement receipt for the x402 payment (not present on 4xx/5xx, which are not charged).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"part":{"type":"string"},"box":{"type":"string"},"description":{"type":"string"},"dateAcquired":{"type":"string"},"dateSold":{"type":"string"},"proceeds":{"type":"number"},"basis":{"type":"number"},"code":{"type":"null"},"adjustment":{"type":"number"},"gain":{"type":"number"},"term":{"type":"string"},"id":{"type":"string"}},"additionalProperties":true}},"totalsByBox":{"type":"object","properties":{"J":{"type":"object","properties":{"proceeds":{"type":"number"},"basis":{"type":"number"},"adjustment":{"type":"number"},"gain":{"type":"number"}},"additionalProperties":true}},"additionalProperties":true},"taxYear":{"type":"number"},"sources":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"url":{"type":"string"},"retrievedAt":{"type":"string"},"status":{"type":"string"}},"additionalProperties":true},"description":"Provenance only (source, url, retrievedAt). Not keyed by check id and does not carry success or error. A check in missing_items does not remove its upstream from sources[]; unavailability is only in missing_items (and unavailable findings)."},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"rows":[{"part":"II","box":"J","description":"1.5 BTC","dateAcquired":"01/10/2024","dateSold":"01/11/2025","proceeds":4500000,"basis":2000000,"code":null,"adjustment":0,"gain":2500000,"term":"long","id":"s1"}],"totalsByBox":{"J":{"proceeds":4500000,"basis":2000000,"adjustment":0,"gain":2500000}},"taxYear":2025,"sources":[{"source":"IRS Instructions for Form 8949 (2025)","url":"https://www.irs.gov/instructions/i8949","retrievedAt":"2026-11-14","status":"ok"}],"limitations":["Long-term when the sale date is after the one-year anniversary of the acquisition date (holding period starts the day a…","Boxes follow IRS Form 8949 (2025) for 1099-B (A–F) and 1099-DA (G–L).","…"]}}}},"400":{"description":"Invalid JSON or request schema. Not charged (no payment-response). If this 400 is returned before the Idempotency-Key is reserved, the key is not stored — fix the body and you may reuse the key. If an operation-path 400 was stored after a payment-signature was attached, the same key + same body replays it; the same key + a different body returns 409."},"402":{"description":"Payment required. The JSON body is the x402 PaymentRequired object. An unpaid 402 does not store the Idempotency-Key. A 402 after payment-signature releases the key and includes prior-payment-attempt (nonce, settled false|unknown). Not charged; no payment-response. Before re-signing after a post-signature 402, check USDC authorizationState(payer, nonce) on Base."},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Same key with a different body after a stored result returns conflict. Reusing the key cannot trigger a second charge. Not charged when settlement did not occur."},"413":{"description":"Request body exceeds the 24 MB limit. Not charged."},"500":{"description":"Operation failed before settlement, so no payment is taken (no payment-response). The error is stored: reuse the same Idempotency-Key and body to retrieve it without paying again. Use a new key for a fresh attempt with a new payment-signature."},"502":{"description":"Facilitator verify/settle transport failure (often timeout). After payment-signature this is returned as SETTLEMENT_UNKNOWN with prior-payment-attempt; the outcome is stored under the Idempotency-Key. With the shared store configured, other instances replay it instead of settling again; without it, each instance keeps its own memory. The authorization may already be settled on-chain — do not re-sign until USDC authorizationState(payer, nonce) on Base is false."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run. Not charged; no payment-response. A 503 after payment-signature releases the Idempotency-Key and includes prior-payment-attempt."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.04"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/crypto-tax/uk-share-pooling":{"post":{"operationId":"uk_share_pooling_for_cryptoassets","summary":"UK share pooling for cryptoassets","description":"Apply same-day, 30-day and section 104 share-pooling rules to a GBP ledger and return allowable cost, gains, pool balances and AEA.","tags":["crypto-tax"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ledger":{"minItems":1,"maxItems":100000,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"ts":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"type":{"type":"string","enum":["buy","sell","transfer_in","transfer_out","income","fee","trade"]},"asset":{"type":"string","minLength":1,"maxLength":32},"qty":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"fiatValue":{"type":"integer","minimum":0,"maximum":9007199254740991},"feeFiat":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"wallet":{"type":"string","minLength":1,"maxLength":128},"txHash":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]},"counterAsset":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]},"counterQty":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]}},"required":["id","ts","type","asset","qty","fiatValue","wallet"],"additionalProperties":false}},"taxYear":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"fiatCurrency":{"default":"GBP","type":"string","minLength":3,"maxLength":3},"feePolicy":{"default":"add_to_basis_and_deduct_from_proceeds","type":"string","enum":["add_to_basis_and_deduct_from_proceeds","ignore"]}},"required":["ledger","taxYear"],"additionalProperties":false},"example":{"taxYear":"2025-26","fiatCurrency":"GBP","ledger":[{"id":"b1","ts":"2025-01-01T00:00:00Z","type":"buy","asset":"BTC","qty":"10","fiatValue":1000000,"feeFiat":0,"wallet":"w1"},{"id":"s1","ts":"2025-06-01T00:00:00Z","type":"sell","asset":"BTC","qty":"5","fiatValue":1000000,"feeFiat":0,"wallet":"w1"},{"id":"b3","ts":"2025-06-15T00:00:00Z","type":"buy","asset":"BTC","qty":"5","fiatValue":750000,"feeFiat":0,"wallet":"w1"}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. For coverage operations, HTTP 200 is used for status complete, partial, and failed; all three settle and are charged at the full listed price. A settled 2xx includes a payment-response response header (facilitator settlement receipt; may include a transaction reference). Conditional fields depend on the result and data-source availability.","headers":{"payment-response":{"description":"Present on settled 2xx only. Facilitator settlement receipt for the x402 payment (not present on 4xx/5xx, which are not charged).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"disposals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"matches":{"type":"array","items":{"type":"object","properties":{"rule":{"type":"string"},"acqId":{"type":"string"},"qty":{"type":"string"},"cost":{"type":"number"}},"additionalProperties":true}},"proceeds":{"type":"number"},"allowableCost":{"type":"number"},"gain":{"type":"number"}},"additionalProperties":true}},"pool":{"type":"object","properties":{"BTC":{"type":"object","properties":{"qty":{"type":"string"},"cost":{"type":"number"}},"additionalProperties":true}},"additionalProperties":true},"netGain":{"type":"number"},"annualExemptAmount":{"type":"number"},"taxableAfterAea":{"type":"number"},"taxYear":{"type":"string"},"warnings":{"type":"array","items":{}},"sources":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"url":{"type":"string"},"retrievedAt":{"type":"string"},"status":{"type":"string"}},"additionalProperties":true},"description":"Provenance only (source, url, retrievedAt). Not keyed by check id and does not carry success or error. A check in missing_items does not remove its upstream from sources[]; unavailability is only in missing_items (and unavailable findings)."},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"disposals":[{"id":"s1","matches":[{"rule":"30_day","acqId":"b3","qty":"5","cost":750000}],"proceeds":1000000,"allowableCost":750000,"gain":250000}],"pool":{"BTC":{"qty":"10","cost":1000000}},"netGain":250000,"annualExemptAmount":300000,"taxableAfterAea":0,"taxYear":"2025-26","warnings":[],"sources":[{"source":"TCGA 1992 ss.104–106A / HMRC CRYPTO22200; GOV.UK CGT annual exempt amount","url":"https://www.gov.uk/guidance/capital-gains-tax-rates-and-allowances","retrievedAt":"2026-11-14","status":"ok"}],"limitations":["Matching order: same-day (s.105), then 30-day acquisitions after the disposal (s.106A), then the s.104 pool at average …","AEA bundled for 2024-25 and 2025-26 only (£3,000).","…"]}}}},"400":{"description":"Invalid JSON or request schema. Not charged (no payment-response). If this 400 is returned before the Idempotency-Key is reserved, the key is not stored — fix the body and you may reuse the key. If an operation-path 400 was stored after a payment-signature was attached, the same key + same body replays it; the same key + a different body returns 409."},"402":{"description":"Payment required. The JSON body is the x402 PaymentRequired object. An unpaid 402 does not store the Idempotency-Key. A 402 after payment-signature releases the key and includes prior-payment-attempt (nonce, settled false|unknown). Not charged; no payment-response. Before re-signing after a post-signature 402, check USDC authorizationState(payer, nonce) on Base."},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Same key with a different body after a stored result returns conflict. Reusing the key cannot trigger a second charge. Not charged when settlement did not occur."},"413":{"description":"Request body exceeds the 24 MB limit. Not charged."},"500":{"description":"Operation failed before settlement, so no payment is taken (no payment-response). The error is stored: reuse the same Idempotency-Key and body to retrieve it without paying again. Use a new key for a fresh attempt with a new payment-signature."},"502":{"description":"Facilitator verify/settle transport failure (often timeout). After payment-signature this is returned as SETTLEMENT_UNKNOWN with prior-payment-attempt; the outcome is stored under the Idempotency-Key. With the shared store configured, other instances replay it instead of settling again; without it, each instance keeps its own memory. The authorization may already be settled on-chain — do not re-sign until USDC authorizationState(payer, nonce) on Base is false."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run. Not charged; no payment-response. A 503 after payment-signature releases the Idempotency-Key and includes prior-payment-attempt."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.05"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/crypto-tax/canada-acb":{"post":{"operationId":"canadian_adjusted_cost_base","summary":"Canadian adjusted cost base","description":"Compute Canadian ACB and capital gains with superficial-loss detection for identical properties on a CAD ledger.","tags":["crypto-tax"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ledger":{"minItems":1,"maxItems":100000,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"ts":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"type":{"type":"string","enum":["buy","sell","transfer_in","transfer_out","income","fee","trade"]},"asset":{"type":"string","minLength":1,"maxLength":32},"qty":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"fiatValue":{"type":"integer","minimum":0,"maximum":9007199254740991},"feeFiat":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"wallet":{"type":"string","minLength":1,"maxLength":128},"txHash":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]},"counterAsset":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]},"counterQty":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]}},"required":["id","ts","type","asset","qty","fiatValue","wallet"],"additionalProperties":false}},"treatment":{"default":"capital","type":"string","const":"capital"},"fiatCurrency":{"default":"CAD","type":"string","minLength":3,"maxLength":3},"feePolicy":{"default":"add_to_basis_and_deduct_from_proceeds","type":"string","enum":["add_to_basis_and_deduct_from_proceeds","ignore"]}},"required":["ledger"],"additionalProperties":false},"example":{"treatment":"capital","fiatCurrency":"CAD","ledger":[{"id":"b1","ts":"2025-01-01T00:00:00Z","type":"buy","asset":"BTC","qty":"10","fiatValue":100000,"feeFiat":0,"wallet":"w1"},{"id":"b2","ts":"2025-02-01T00:00:00Z","type":"buy","asset":"BTC","qty":"10","fiatValue":200000,"feeFiat":0,"wallet":"w1"},{"id":"s1","ts":"2025-03-01T00:00:00Z","type":"sell","asset":"BTC","qty":"5","fiatValue":150000,"feeFiat":0,"wallet":"w1"}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. For coverage operations, HTTP 200 is used for status complete, partial, and failed; all three settle and are charged at the full listed price. A settled 2xx includes a payment-response response header (facilitator settlement receipt; may include a transaction reference). Conditional fields depend on the result and data-source availability.","headers":{"payment-response":{"description":"Present on settled 2xx only. Facilitator settlement receipt for the x402 payment (not present on 4xx/5xx, which are not charged).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"disposals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"proceeds":{"type":"number"},"acbUsed":{"type":"number"},"gain":{"type":"number"},"superficialLossDenied":{"type":"number"}},"additionalProperties":true}},"acb":{"type":"object","properties":{"BTC":{"type":"object","properties":{"qty":{"type":"string"},"acb":{"type":"number"}},"additionalProperties":true}},"additionalProperties":true},"warnings":{"type":"array","items":{}},"treatment":{"type":"string"},"sources":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"url":{"type":"string"},"retrievedAt":{"type":"string"},"status":{"type":"string"}},"additionalProperties":true},"description":"Provenance only (source, url, retrievedAt). Not keyed by check id and does not carry success or error. A check in missing_items does not remove its upstream from sources[]; unavailability is only in missing_items (and unavailable findings)."},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"disposals":[{"id":"s1","proceeds":150000,"acbUsed":75000,"gain":75000,"superficialLossDenied":0}],"acb":{"BTC":{"qty":"15","acb":225000}},"warnings":[],"treatment":"capital","sources":[{"source":"Income Tax Act (Canada) s.47 identical properties and s.54 superficial loss","url":"https://laws-lois.justice.gc.ca/eng/acts/I-3.3/","retrievedAt":"2026-11-14","status":"ok"}],"limitations":["Identical properties use average ACB (s.47). Superficial losses in the ±30-day window that remain held at day +30 are d…","Pure computation on caller input: no exchange, wallet, market-price or tax-authority API is called at request time.","…"]}}}},"400":{"description":"Invalid JSON or request schema. Not charged (no payment-response). If this 400 is returned before the Idempotency-Key is reserved, the key is not stored — fix the body and you may reuse the key. If an operation-path 400 was stored after a payment-signature was attached, the same key + same body replays it; the same key + a different body returns 409."},"402":{"description":"Payment required. The JSON body is the x402 PaymentRequired object. An unpaid 402 does not store the Idempotency-Key. A 402 after payment-signature releases the key and includes prior-payment-attempt (nonce, settled false|unknown). Not charged; no payment-response. Before re-signing after a post-signature 402, check USDC authorizationState(payer, nonce) on Base."},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Same key with a different body after a stored result returns conflict. Reusing the key cannot trigger a second charge. Not charged when settlement did not occur."},"413":{"description":"Request body exceeds the 24 MB limit. Not charged."},"500":{"description":"Operation failed before settlement, so no payment is taken (no payment-response). The error is stored: reuse the same Idempotency-Key and body to retrieve it without paying again. Use a new key for a fresh attempt with a new payment-signature."},"502":{"description":"Facilitator verify/settle transport failure (often timeout). After payment-signature this is returned as SETTLEMENT_UNKNOWN with prior-payment-attempt; the outcome is stored under the Idempotency-Key. With the shared store configured, other instances replay it instead of settling again; without it, each instance keeps its own memory. The authorization may already be settled on-chain — do not re-sign until USDC authorizationState(payer, nonce) on Base is false."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run. Not charged; no payment-response. A 503 after payment-signature releases the Idempotency-Key and includes prior-payment-attempt."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.04"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/crypto-tax/australia-cgt-discount":{"post":{"operationId":"australian_cgt_discount","summary":"Australian CGT discount","description":"Apply the Australian 12-month CGT discount by entity type after losses, from caller event proceeds and cost base.","tags":["crypto-tax"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"entity":{"type":"string","enum":["individual","trust","super_fund","company"]},"resident":{"type":"boolean"},"events":{"minItems":1,"maxItems":100000,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"acquired":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"eventDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"capitalProceeds":{"type":"integer","minimum":0,"maximum":9007199254740991},"costBase":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","acquired","eventDate","capitalProceeds","costBase"],"additionalProperties":false}},"carriedForwardLosses":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["entity","resident","events"],"additionalProperties":false},"example":{"entity":"individual","resident":true,"events":[{"id":"s1","acquired":"2024-01-01","eventDate":"2025-01-02","capitalProceeds":2000000,"costBase":1000000}],"carriedForwardLosses":200000}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. For coverage operations, HTTP 200 is used for status complete, partial, and failed; all three settle and are charged at the full listed price. A settled 2xx includes a payment-response response header (facilitator settlement receipt; may include a transaction reference). Conditional fields depend on the result and data-source availability.","headers":{"payment-response":{"description":"Present on settled 2xx only. Facilitator settlement receipt for the x402 payment (not present on 4xx/5xx, which are not charged).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"gain":{"type":"number"},"discountEligible":{"type":"boolean"}},"additionalProperties":true}},"grossGains":{"type":"number"},"lossesApplied":{"type":"number"},"discountRate":{"type":"number"},"netCapitalGain":{"type":"number"},"sources":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"url":{"type":"string"},"retrievedAt":{"type":"string"},"status":{"type":"string"}},"additionalProperties":true},"description":"Provenance only (source, url, retrievedAt). Not keyed by check id and does not carry success or error. A check in missing_items does not remove its upstream from sources[]; unavailability is only in missing_items (and unavailable findings)."},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"events":[{"id":"s1","gain":1000000,"discountEligible":true}],"grossGains":1000000,"lossesApplied":200000,"discountRate":0.5,"netCapitalGain":400000,"sources":[{"source":"ATO CGT discount (updated 29 Jun 2026)","url":"https://www.ato.gov.au/individuals-and-families/investments-and-assets/capital-gains-tax/cgt-discount","retrievedAt":"2026-11-14","status":"ok"}],"limitations":["Discount requires ownership of at least 12 months excluding the acquisition day and the CGT event day.","Losses apply to non-discountable gains first, then discountable gains, before the discount.","…"]}}}},"400":{"description":"Invalid JSON or request schema. Not charged (no payment-response). If this 400 is returned before the Idempotency-Key is reserved, the key is not stored — fix the body and you may reuse the key. If an operation-path 400 was stored after a payment-signature was attached, the same key + same body replays it; the same key + a different body returns 409."},"402":{"description":"Payment required. The JSON body is the x402 PaymentRequired object. An unpaid 402 does not store the Idempotency-Key. A 402 after payment-signature releases the key and includes prior-payment-attempt (nonce, settled false|unknown). Not charged; no payment-response. Before re-signing after a post-signature 402, check USDC authorizationState(payer, nonce) on Base."},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Same key with a different body after a stored result returns conflict. Reusing the key cannot trigger a second charge. Not charged when settlement did not occur."},"413":{"description":"Request body exceeds the 24 MB limit. Not charged."},"500":{"description":"Operation failed before settlement, so no payment is taken (no payment-response). The error is stored: reuse the same Idempotency-Key and body to retrieve it without paying again. Use a new key for a fresh attempt with a new payment-signature."},"502":{"description":"Facilitator verify/settle transport failure (often timeout). After payment-signature this is returned as SETTLEMENT_UNKNOWN with prior-payment-attempt; the outcome is stored under the Idempotency-Key. With the shared store configured, other instances replay it instead of settling again; without it, each instance keeps its own memory. The authorization may already be settled on-chain — do not re-sign until USDC authorizationState(payer, nonce) on Base is false."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run. Not charged; no payment-response. A 503 after payment-signature releases the Idempotency-Key and includes prior-payment-attempt."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.03"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/crypto-tax/germany-holding-period":{"post":{"operationId":"german_23_holding_period_screen","summary":"German §23 holding-period screen","description":"Classify crypto private sales under §23 EStG with FIFO (or caller method), one-year holding and the €1,000 Freigrenze.","tags":["crypto-tax"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ledger":{"minItems":1,"maxItems":100000,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"ts":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"type":{"type":"string","enum":["buy","sell","transfer_in","transfer_out","income","fee","trade"]},"asset":{"type":"string","minLength":1,"maxLength":32},"qty":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"fiatValue":{"type":"integer","minimum":0,"maximum":9007199254740991},"feeFiat":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"wallet":{"type":"string","minLength":1,"maxLength":128},"txHash":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]},"counterAsset":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]},"counterQty":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]}},"required":["id","ts","type","asset","qty","fiatValue","wallet"],"additionalProperties":false}},"calendarYear":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"method":{"default":"FIFO","type":"string","enum":["FIFO","LIFO","HIFO","AVERAGE"]},"fiatCurrency":{"default":"EUR","type":"string","minLength":3,"maxLength":3},"feePolicy":{"default":"add_to_basis_and_deduct_from_proceeds","type":"string","enum":["add_to_basis_and_deduct_from_proceeds","ignore"]}},"required":["ledger","calendarYear"],"additionalProperties":false},"example":{"calendarYear":2026,"method":"FIFO","fiatCurrency":"EUR","ledger":[{"id":"b1","ts":"2025-03-01T00:00:00Z","type":"buy","asset":"BTC","qty":"1","fiatValue":100000,"feeFiat":0,"wallet":"w1"},{"id":"s1","ts":"2026-03-02T00:00:00Z","type":"sell","asset":"BTC","qty":"1","fiatValue":150000,"feeFiat":0,"wallet":"w1"}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. For coverage operations, HTTP 200 is used for status complete, partial, and failed; all three settle and are charged at the full listed price. A settled 2xx includes a payment-response response header (facilitator settlement receipt; may include a transaction reference). Conditional fields depend on the result and data-source availability.","headers":{"payment-response":{"description":"Present on settled 2xx only. Facilitator settlement receipt for the x402 payment (not present on 4xx/5xx, which are not charged).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"disposals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"holdingDays":{"type":"number"},"taxable":{"type":"boolean"},"gain":{"type":"number"},"acquired":{"type":"string"},"sold":{"type":"string"}},"additionalProperties":true}},"taxableGainTotal":{"type":"number"},"exempt":{"type":"boolean"},"reason":{"type":"string"},"method":{"type":"string"},"calendarYear":{"type":"number"},"sources":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"url":{"type":"string"},"retrievedAt":{"type":"string"},"status":{"type":"string"}},"additionalProperties":true},"description":"Provenance only (source, url, retrievedAt). Not keyed by check id and does not carry success or error. A check in missing_items does not remove its upstream from sources[]; unavailability is only in missing_items (and unavailable findings)."},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"disposals":[{"id":"s1","holdingDays":366,"taxable":false,"gain":50000,"acquired":"2025-03-01","sold":"2026-03-02"}],"taxableGainTotal":0,"exempt":true,"reason":"no_taxable_gain","method":"FIFO","calendarYear":2026,"sources":[{"source":"§23 EStG private sales (Freigrenze €1,000)","url":"https://www.gesetze-im-internet.de/estg/__23.html","retrievedAt":"2026-11-14","status":"ok"}],"limitations":["Private sales are taxable when the period between acquisition and sale is not more than one year (§23 Abs. 1).","Freigrenze: total taxable private-sale gains under €1,000 are exempt; at €1,000 the whole amount is taxable.","…"]}}}},"400":{"description":"Invalid JSON or request schema. Not charged (no payment-response). If this 400 is returned before the Idempotency-Key is reserved, the key is not stored — fix the body and you may reuse the key. If an operation-path 400 was stored after a payment-signature was attached, the same key + same body replays it; the same key + a different body returns 409."},"402":{"description":"Payment required. The JSON body is the x402 PaymentRequired object. An unpaid 402 does not store the Idempotency-Key. A 402 after payment-signature releases the key and includes prior-payment-attempt (nonce, settled false|unknown). Not charged; no payment-response. Before re-signing after a post-signature 402, check USDC authorizationState(payer, nonce) on Base."},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Same key with a different body after a stored result returns conflict. Reusing the key cannot trigger a second charge. Not charged when settlement did not occur."},"413":{"description":"Request body exceeds the 24 MB limit. Not charged."},"500":{"description":"Operation failed before settlement, so no payment is taken (no payment-response). The error is stored: reuse the same Idempotency-Key and body to retrieve it without paying again. Use a new key for a fresh attempt with a new payment-signature."},"502":{"description":"Facilitator verify/settle transport failure (often timeout). After payment-signature this is returned as SETTLEMENT_UNKNOWN with prior-payment-attempt; the outcome is stored under the Idempotency-Key. With the shared store configured, other instances replay it instead of settling again; without it, each instance keeps its own memory. The authorization may already be settled on-chain — do not re-sign until USDC authorizationState(payer, nonce) on Base is false."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run. Not charged; no payment-response. A 503 after payment-signature releases the Idempotency-Key and includes prior-payment-attempt."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.04"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/crypto-tax/income-events-value":{"post":{"operationId":"value_staking_and_income_events","summary":"Value staking and income events","description":"Value staking, mining, airdrop and interest receipts in fiat using caller-supplied prices within a max lag window.","tags":["crypto-tax"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"events":{"minItems":1,"maxItems":100000,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"ts":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"asset":{"type":"string","minLength":1,"maxLength":32},"qty":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"kind":{"type":"string","enum":["staking","mining","airdrop","interest","other"]}},"required":["id","ts","asset","qty","kind"],"additionalProperties":false}},"prices":{"minItems":1,"maxItems":100000,"type":"array","items":{"type":"object","properties":{"asset":{"type":"string","minLength":1,"maxLength":32},"ts":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"price":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["asset","ts","price"],"additionalProperties":false}},"maxPriceLagHours":{"type":"number","exclusiveMinimum":0,"maximum":8760},"fiatCurrency":{"type":"string","minLength":3,"maxLength":3}},"required":["events","prices","maxPriceLagHours","fiatCurrency"],"additionalProperties":false},"example":{"events":[{"id":"i1","ts":"2026-02-01T10:00:00Z","asset":"ETH","qty":"0.1","kind":"staking"}],"prices":[{"asset":"ETH","ts":"2026-02-01T00:00:00Z","price":250000}],"maxPriceLagHours":24,"fiatCurrency":"USD"}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. For coverage operations, HTTP 200 is used for status complete, partial, and failed; all three settle and are charged at the full listed price. A settled 2xx includes a payment-response response header (facilitator settlement receipt; may include a transaction reference). Conditional fields depend on the result and data-source availability.","headers":{"payment-response":{"description":"Present on settled 2xx only. Facilitator settlement receipt for the x402 payment (not present on 4xx/5xx, which are not charged).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{"type":"number"},"priceTs":{"type":"string"},"kind":{"type":"string"},"asset":{"type":"string"}},"additionalProperties":true}},"totalsByKind":{"type":"object","properties":{"staking":{"type":"number"}},"additionalProperties":true},"missingPrices":{"type":"array","items":{}},"fiatCurrency":{"type":"string"},"sources":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"url":{"type":"string"},"retrievedAt":{"type":"string"},"status":{"type":"string"}},"additionalProperties":true},"description":"Provenance only (source, url, retrievedAt). Not keyed by check id and does not carry success or error. A check in missing_items does not remove its upstream from sources[]; unavailability is only in missing_items (and unavailable findings)."},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"events":[{"id":"i1","value":25000,"priceTs":"2026-02-01T00:00:00Z","kind":"staking","asset":"ETH"}],"totalsByKind":{"staking":25000},"missingPrices":[],"fiatCurrency":"USD","sources":[{"source":"Caller-supplied ledger, prices and jurisdiction inputs processed locally","url":"https://www.brainiac.software/api/v1/crypto-tax","retrievedAt":"2026-11-14","status":"ok"}],"limitations":["Uses the latest caller price at or before the event within maxPriceLagHours. Missing prices are listed and never guesse…","Pure computation on caller input: no exchange, wallet, market-price or tax-authority API is called at request time.","…"]}}}},"400":{"description":"Invalid JSON or request schema. Not charged (no payment-response). If this 400 is returned before the Idempotency-Key is reserved, the key is not stored — fix the body and you may reuse the key. If an operation-path 400 was stored after a payment-signature was attached, the same key + same body replays it; the same key + a different body returns 409."},"402":{"description":"Payment required. The JSON body is the x402 PaymentRequired object. An unpaid 402 does not store the Idempotency-Key. A 402 after payment-signature releases the key and includes prior-payment-attempt (nonce, settled false|unknown). Not charged; no payment-response. Before re-signing after a post-signature 402, check USDC authorizationState(payer, nonce) on Base."},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Same key with a different body after a stored result returns conflict. Reusing the key cannot trigger a second charge. Not charged when settlement did not occur."},"413":{"description":"Request body exceeds the 24 MB limit. Not charged."},"500":{"description":"Operation failed before settlement, so no payment is taken (no payment-response). The error is stored: reuse the same Idempotency-Key and body to retrieve it without paying again. Use a new key for a fresh attempt with a new payment-signature."},"502":{"description":"Facilitator verify/settle transport failure (often timeout). After payment-signature this is returned as SETTLEMENT_UNKNOWN with prior-payment-attempt; the outcome is stored under the Idempotency-Key. With the shared store configured, other instances replay it instead of settling again; without it, each instance keeps its own memory. The authorization may already be settled on-chain — do not re-sign until USDC authorizationState(payer, nonce) on Base is false."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run. Not charged; no payment-response. A 503 after payment-signature releases the Idempotency-Key and includes prior-payment-attempt."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.03"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/crypto-tax/transfer-match":{"post":{"operationId":"match_internal_wallet_transfers","summary":"Match internal wallet transfers","description":"Pair outgoing and incoming transfers between the caller's own wallets by txHash or amount/time so they are not treated as disposals.","tags":["crypto-tax"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ledger":{"minItems":1,"maxItems":100000,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"ts":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"type":{"type":"string","enum":["buy","sell","transfer_in","transfer_out","income","fee","trade"]},"asset":{"type":"string","minLength":1,"maxLength":32},"qty":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"fiatValue":{"type":"integer","minimum":0,"maximum":9007199254740991},"feeFiat":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"wallet":{"type":"string","minLength":1,"maxLength":128},"txHash":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]},"counterAsset":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]},"counterQty":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]}},"required":["id","ts","type","asset","qty","fiatValue","wallet"],"additionalProperties":false}},"windowMinutes":{"default":120,"type":"number","exclusiveMinimum":0,"maximum":43200},"maxFeeRatio":{"default":0.02,"type":"number","minimum":0,"maximum":1}},"required":["ledger"],"additionalProperties":false},"example":{"windowMinutes":120,"maxFeeRatio":0.02,"ledger":[{"id":"t1","ts":"2026-01-01T10:00:00Z","type":"transfer_out","asset":"BTC","qty":"1.0000","fiatValue":0,"feeFiat":0,"wallet":"a"},{"id":"t2","ts":"2026-01-01T10:20:00Z","type":"transfer_in","asset":"BTC","qty":"0.9998","fiatValue":0,"feeFiat":0,"wallet":"b"}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. For coverage operations, HTTP 200 is used for status complete, partial, and failed; all three settle and are charged at the full listed price. A settled 2xx includes a payment-response response header (facilitator settlement receipt; may include a transaction reference). Conditional fields depend on the result and data-source availability.","headers":{"payment-response":{"description":"Present on settled 2xx only. Facilitator settlement receipt for the x402 payment (not present on 4xx/5xx, which are not charged).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"pairs":{"type":"array","items":{"type":"object","properties":{"outId":{"type":"string"},"inId":{"type":"string"},"asset":{"type":"string"},"fee":{"type":"string"},"matchedBy":{"type":"string"}},"additionalProperties":true}},"unmatchedOut":{"type":"array","items":{}},"unmatchedIn":{"type":"array","items":{}},"warnings":{"type":"array","items":{}},"sources":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"url":{"type":"string"},"retrievedAt":{"type":"string"},"status":{"type":"string"}},"additionalProperties":true},"description":"Provenance only (source, url, retrievedAt). Not keyed by check id and does not carry success or error. A check in missing_items does not remove its upstream from sources[]; unavailability is only in missing_items (and unavailable findings)."},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"pairs":[{"outId":"t1","inId":"t2","asset":"BTC","fee":"0.0002","matchedBy":"amount_time"}],"unmatchedOut":[],"unmatchedIn":[],"warnings":[],"sources":[{"source":"Caller-supplied ledger, prices and jurisdiction inputs processed locally","url":"https://www.brainiac.software/api/v1/crypto-tax","retrievedAt":"2026-11-14","status":"ok"}],"limitations":["Pairs by identical txHash first, then earliest same-asset in on a different wallet within windowMinutes where 0 ≤ out−i…","Pure computation on caller input: no exchange, wallet, market-price or tax-authority API is called at request time.","…"]}}}},"400":{"description":"Invalid JSON or request schema. Not charged (no payment-response). If this 400 is returned before the Idempotency-Key is reserved, the key is not stored — fix the body and you may reuse the key. If an operation-path 400 was stored after a payment-signature was attached, the same key + same body replays it; the same key + a different body returns 409."},"402":{"description":"Payment required. The JSON body is the x402 PaymentRequired object. An unpaid 402 does not store the Idempotency-Key. A 402 after payment-signature releases the key and includes prior-payment-attempt (nonce, settled false|unknown). Not charged; no payment-response. Before re-signing after a post-signature 402, check USDC authorizationState(payer, nonce) on Base."},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Same key with a different body after a stored result returns conflict. Reusing the key cannot trigger a second charge. Not charged when settlement did not occur."},"413":{"description":"Request body exceeds the 24 MB limit. Not charged."},"500":{"description":"Operation failed before settlement, so no payment is taken (no payment-response). The error is stored: reuse the same Idempotency-Key and body to retrieve it without paying again. Use a new key for a fresh attempt with a new payment-signature."},"502":{"description":"Facilitator verify/settle transport failure (often timeout). After payment-signature this is returned as SETTLEMENT_UNKNOWN with prior-payment-attempt; the outcome is stored under the Idempotency-Key. With the shared store configured, other instances replay it instead of settling again; without it, each instance keeps its own memory. The authorization may already be settled on-chain — do not re-sign until USDC authorizationState(payer, nonce) on Base is false."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run. Not charged; no payment-response. A 503 after payment-signature releases the Idempotency-Key and includes prior-payment-attempt."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.04"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/crypto-tax/network-fee-allocate":{"post":{"operationId":"allocate_network_and_gas_fees","summary":"Allocate network and gas fees","description":"Assign network/gas fees to acquisition basis, disposal proceeds, expense or fee-asset disposal per caller policy.","tags":["crypto-tax"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"fees":{"minItems":1,"maxItems":100000,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"relatedId":{"type":"string","minLength":1},"context":{"type":"string","enum":["disposal","acquisition","transfer","failed_tx"]},"asset":{"type":"string","minLength":1,"maxLength":32},"qty":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"fiatValue":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","relatedId","context","asset","qty","fiatValue"],"additionalProperties":false}},"policy":{"type":"object","properties":{"acquisition":{"default":"add_to_basis","type":"string","enum":["add_to_basis"]},"disposal":{"default":"deduct_from_proceeds","type":"string","enum":["deduct_from_proceeds"]},"transfer":{"type":"string","enum":["add_to_basis","disposal_of_fee_asset","expense"]},"failed_tx":{"type":"string","enum":["expense","ignore"]}},"required":["transfer","failed_tx"],"additionalProperties":false}},"required":["fees","policy"],"additionalProperties":false},"example":{"fees":[{"id":"f1","relatedId":"s1","context":"disposal","asset":"ETH","qty":"0.002","fiatValue":500}],"policy":{"acquisition":"add_to_basis","disposal":"deduct_from_proceeds","transfer":"expense","failed_tx":"ignore"}}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. For coverage operations, HTTP 200 is used for status complete, partial, and failed; all three settle and are charged at the full listed price. A settled 2xx includes a payment-response response header (facilitator settlement receipt; may include a transaction reference). Conditional fields depend on the result and data-source availability.","headers":{"payment-response":{"description":"Present on settled 2xx only. Facilitator settlement receipt for the x402 payment (not present on 4xx/5xx, which are not charged).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"adjustments":{"type":"array","items":{"type":"object","properties":{"feeId":{"type":"string"},"target":{"type":"string"},"action":{"type":"string"},"amount":{"type":"number"}},"additionalProperties":true}},"feeAssetDisposals":{"type":"array","items":{}},"sources":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"url":{"type":"string"},"retrievedAt":{"type":"string"},"status":{"type":"string"}},"additionalProperties":true},"description":"Provenance only (source, url, retrievedAt). Not keyed by check id and does not carry success or error. A check in missing_items does not remove its upstream from sources[]; unavailability is only in missing_items (and unavailable findings)."},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"adjustments":[{"feeId":"f1","target":"s1","action":"deduct_from_proceeds","amount":500}],"feeAssetDisposals":[],"sources":[{"source":"Caller-supplied ledger, prices and jurisdiction inputs processed locally","url":"https://www.brainiac.software/api/v1/crypto-tax","retrievedAt":"2026-11-14","status":"ok"}],"limitations":["Maps each fee context to the caller policy. disposal_of_fee_asset emits a disposal of the fee asset at fiatValue for la…","Pure computation on caller input: no exchange, wallet, market-price or tax-authority API is called at request time.","…"]}}}},"400":{"description":"Invalid JSON or request schema. Not charged (no payment-response). If this 400 is returned before the Idempotency-Key is reserved, the key is not stored — fix the body and you may reuse the key. If an operation-path 400 was stored after a payment-signature was attached, the same key + same body replays it; the same key + a different body returns 409."},"402":{"description":"Payment required. The JSON body is the x402 PaymentRequired object. An unpaid 402 does not store the Idempotency-Key. A 402 after payment-signature releases the key and includes prior-payment-attempt (nonce, settled false|unknown). Not charged; no payment-response. Before re-signing after a post-signature 402, check USDC authorizationState(payer, nonce) on Base."},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Same key with a different body after a stored result returns conflict. Reusing the key cannot trigger a second charge. Not charged when settlement did not occur."},"413":{"description":"Request body exceeds the 24 MB limit. Not charged."},"500":{"description":"Operation failed before settlement, so no payment is taken (no payment-response). The error is stored: reuse the same Idempotency-Key and body to retrieve it without paying again. Use a new key for a fresh attempt with a new payment-signature."},"502":{"description":"Facilitator verify/settle transport failure (often timeout). After payment-signature this is returned as SETTLEMENT_UNKNOWN with prior-payment-attempt; the outcome is stored under the Idempotency-Key. With the shared store configured, other instances replay it instead of settling again; without it, each instance keeps its own memory. The authorization may already be settled on-chain — do not re-sign until USDC authorizationState(payer, nonce) on Base is false."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run. Not charged; no payment-response. A 503 after payment-signature releases the Idempotency-Key and includes prior-payment-attempt."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.02"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/crypto-tax/tax-loss-harvest":{"post":{"operationId":"list_tax_loss_harvest_candidates","summary":"List tax-loss harvest candidates","description":"List open lots with unrealised losses at caller prices and an estimated tax saving, with US/UK rule flags.","tags":["crypto-tax"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"openLots":{"minItems":1,"maxItems":100000,"type":"array","items":{"type":"object","properties":{"lotId":{"type":"string","minLength":1},"asset":{"type":"string","minLength":1,"maxLength":32},"qty":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"basis":{"type":"integer","minimum":0,"maximum":9007199254740991},"acquired":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["lotId","asset","qty","basis","acquired"],"additionalProperties":false}},"prices":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}},"marginalRate":{"type":"number","minimum":0,"maximum":1},"jurisdiction":{"type":"string","enum":["US","UK","other"]},"asOf":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["openLots","prices","marginalRate","jurisdiction","asOf"],"additionalProperties":false},"example":{"openLots":[{"lotId":"b2","asset":"BTC","qty":"1","basis":2000000,"acquired":"2025-06-01"}],"prices":{"BTC":1500000},"marginalRate":0.24,"jurisdiction":"US","asOf":"2026-11-14"}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. For coverage operations, HTTP 200 is used for status complete, partial, and failed; all three settle and are charged at the full listed price. A settled 2xx includes a payment-response response header (facilitator settlement receipt; may include a transaction reference). Conditional fields depend on the result and data-source availability.","headers":{"payment-response":{"description":"Present on settled 2xx only. Facilitator settlement receipt for the x402 payment (not present on 4xx/5xx, which are not charged).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"candidates":{"type":"array","items":{"type":"object","properties":{"lotId":{"type":"string"},"unrealisedLoss":{"type":"number"},"estimatedTaxSaving":{"type":"number"},"flags":{"type":"array","items":{"type":"string"}},"asset":{"type":"string"},"qty":{"type":"string"},"basis":{"type":"number"},"value":{"type":"number"}},"additionalProperties":true}},"totalLoss":{"type":"number"},"asOf":{"type":"string"},"sources":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"url":{"type":"string"},"retrievedAt":{"type":"string"},"status":{"type":"string"}},"additionalProperties":true},"description":"Provenance only (source, url, retrievedAt). Not keyed by check id and does not carry success or error. A check in missing_items does not remove its upstream from sources[]; unavailability is only in missing_items (and unavailable findings)."},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"candidates":[{"lotId":"b2","unrealisedLoss":500000,"estimatedTaxSaving":120000,"flags":["check_current_wash_sale_rules"],"asset":"BTC","qty":"1","basis":2000000,"value":1500000}],"totalLoss":500000,"asOf":"2026-11-14","sources":[{"source":"Caller-supplied ledger, prices and jurisdiction inputs processed locally","url":"https://www.brainiac.software/api/v1/crypto-tax","retrievedAt":"2026-11-14","status":"ok"}],"limitations":["Estimated tax saving is unrealisedLoss × marginalRate only; it is not a filing figure.","UK flags the 30-day bed-and-breakfast rule; US flags that wash-sale applicability to digital assets is not decided here.","…"]}}}},"400":{"description":"Invalid JSON or request schema. Not charged (no payment-response). If this 400 is returned before the Idempotency-Key is reserved, the key is not stored — fix the body and you may reuse the key. If an operation-path 400 was stored after a payment-signature was attached, the same key + same body replays it; the same key + a different body returns 409."},"402":{"description":"Payment required. The JSON body is the x402 PaymentRequired object. An unpaid 402 does not store the Idempotency-Key. A 402 after payment-signature releases the key and includes prior-payment-attempt (nonce, settled false|unknown). Not charged; no payment-response. Before re-signing after a post-signature 402, check USDC authorizationState(payer, nonce) on Base."},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Same key with a different body after a stored result returns conflict. Reusing the key cannot trigger a second charge. Not charged when settlement did not occur."},"413":{"description":"Request body exceeds the 24 MB limit. Not charged."},"500":{"description":"Operation failed before settlement, so no payment is taken (no payment-response). The error is stored: reuse the same Idempotency-Key and body to retrieve it without paying again. Use a new key for a fresh attempt with a new payment-signature."},"502":{"description":"Facilitator verify/settle transport failure (often timeout). After payment-signature this is returned as SETTLEMENT_UNKNOWN with prior-payment-attempt; the outcome is stored under the Idempotency-Key. With the shared store configured, other instances replay it instead of settling again; without it, each instance keeps its own memory. The authorization may already be settled on-chain — do not re-sign until USDC authorizationState(payer, nonce) on Base is false."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run. Not charged; no payment-response. A 503 after payment-signature releases the Idempotency-Key and includes prior-payment-attempt."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.03"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/crypto-tax/derivatives-pnl":{"post":{"operationId":"derivatives_realised_p_l","summary":"Derivatives realised P/L","description":"Compute realised P/L for linear perpetuals/futures and options including fees and funding from caller trade inputs.","tags":["crypto-tax"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"trades":{"minItems":1,"maxItems":100000,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"instrument":{"type":"string","minLength":1,"maxLength":64},"kind":{"type":"string","enum":["linear_future","option"]},"side":{"type":"string","enum":["long","short"]},"qty":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"entryPrice":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"exitPrice":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fees":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"fundingPayments":{"default":[],"maxItems":10000,"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"premium":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"settlementValue":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","instrument","kind","side","qty","entryPrice","exitPrice"],"additionalProperties":false}}},"required":["trades"],"additionalProperties":false},"example":{"trades":[{"id":"p1","instrument":"BTC-PERP","kind":"linear_future","side":"long","qty":"0.5","entryPrice":6000000,"exitPrice":6200000,"fees":3000,"fundingPayments":[-1200,800]}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. For coverage operations, HTTP 200 is used for status complete, partial, and failed; all three settle and are charged at the full listed price. A settled 2xx includes a payment-response response header (facilitator settlement receipt; may include a transaction reference). Conditional fields depend on the result and data-source availability.","headers":{"payment-response":{"description":"Present on settled 2xx only. Facilitator settlement receipt for the x402 payment (not present on 4xx/5xx, which are not charged).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"trades":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"instrument":{"type":"string"},"grossPnl":{"type":"number"},"fees":{"type":"number"},"funding":{"type":"number"},"netPnl":{"type":"number"}},"additionalProperties":true}},"total":{"type":"number"},"sources":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"url":{"type":"string"},"retrievedAt":{"type":"string"},"status":{"type":"string"}},"additionalProperties":true},"description":"Provenance only (source, url, retrievedAt). Not keyed by check id and does not carry success or error. A check in missing_items does not remove its upstream from sources[]; unavailability is only in missing_items (and unavailable findings)."},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"trades":[{"id":"p1","instrument":"BTC-PERP","grossPnl":100000,"fees":3000,"funding":-400,"netPnl":96600}],"total":96600,"sources":[{"source":"Caller-supplied ledger, prices and jurisdiction inputs processed locally","url":"https://www.brainiac.software/api/v1/crypto-tax","retrievedAt":"2026-11-14","status":"ok"}],"limitations":["Linear futures: (exit−entry)×qty for long, reversed for short. Options use caller premium and settlement. Inverse/coin-…","Pure computation on caller input: no exchange, wallet, market-price or tax-authority API is called at request time.","…"]}}}},"400":{"description":"Invalid JSON or request schema. Not charged (no payment-response). If this 400 is returned before the Idempotency-Key is reserved, the key is not stored — fix the body and you may reuse the key. If an operation-path 400 was stored after a payment-signature was attached, the same key + same body replays it; the same key + a different body returns 409."},"402":{"description":"Payment required. The JSON body is the x402 PaymentRequired object. An unpaid 402 does not store the Idempotency-Key. A 402 after payment-signature releases the key and includes prior-payment-attempt (nonce, settled false|unknown). Not charged; no payment-response. Before re-signing after a post-signature 402, check USDC authorizationState(payer, nonce) on Base."},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Same key with a different body after a stored result returns conflict. Reusing the key cannot trigger a second charge. Not charged when settlement did not occur."},"413":{"description":"Request body exceeds the 24 MB limit. Not charged."},"500":{"description":"Operation failed before settlement, so no payment is taken (no payment-response). The error is stored: reuse the same Idempotency-Key and body to retrieve it without paying again. Use a new key for a fresh attempt with a new payment-signature."},"502":{"description":"Facilitator verify/settle transport failure (often timeout). After payment-signature this is returned as SETTLEMENT_UNKNOWN with prior-payment-attempt; the outcome is stored under the Idempotency-Key. With the shared store configured, other instances replay it instead of settling again; without it, each instance keeps its own memory. The authorization may already be settled on-chain — do not re-sign until USDC authorizationState(payer, nonce) on Base is false."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run. Not charged; no payment-response. A 503 after payment-signature releases the Idempotency-Key and includes prior-payment-attempt."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.03"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/crypto-tax/unrealized-snapshot":{"post":{"operationId":"unrealised_holdings_snapshot","summary":"Unrealised holdings snapshot","description":"Replay a ledger to a date with a cost-basis method and report holdings, basis, unrealised gain, dust and unpriced assets at caller prices.","tags":["crypto-tax"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ledger":{"minItems":1,"maxItems":100000,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"ts":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"type":{"type":"string","enum":["buy","sell","transfer_in","transfer_out","income","fee","trade"]},"asset":{"type":"string","minLength":1,"maxLength":32},"qty":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"fiatValue":{"type":"integer","minimum":0,"maximum":9007199254740991},"feeFiat":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"wallet":{"type":"string","minLength":1,"maxLength":128},"txHash":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]},"counterAsset":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]},"counterQty":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]}},"required":["id","ts","type","asset","qty","fiatValue","wallet"],"additionalProperties":false}},"asOf":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"prices":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}},"method":{"default":"FIFO","type":"string","enum":["FIFO","LIFO","HIFO","AVERAGE"]},"feePolicy":{"default":"add_to_basis_and_deduct_from_proceeds","type":"string","enum":["add_to_basis_and_deduct_from_proceeds","ignore"]},"dustThresholdFiat":{"default":100,"type":"integer","minimum":0,"maximum":9007199254740991},"fiatCurrency":{"default":"USD","type":"string","minLength":3,"maxLength":3}},"required":["ledger","asOf","prices"],"additionalProperties":false},"example":{"asOf":"2026-12-31T23:59:59Z","prices":{"BTC":9000000},"method":"FIFO","dustThresholdFiat":100,"fiatCurrency":"USD","ledger":[{"id":"b1","ts":"2025-01-01T00:00:00Z","type":"buy","asset":"BTC","qty":"1","fiatValue":1000000,"feeFiat":0,"wallet":"w1"},{"id":"b2","ts":"2025-02-01T00:00:00Z","type":"buy","asset":"BTC","qty":"1","fiatValue":2000000,"feeFiat":0,"wallet":"w1"},{"id":"s1","ts":"2025-03-01T00:00:00Z","type":"sell","asset":"BTC","qty":"1.5","fiatValue":4500000,"feeFiat":0,"wallet":"w1"}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. For coverage operations, HTTP 200 is used for status complete, partial, and failed; all three settle and are charged at the full listed price. A settled 2xx includes a payment-response response header (facilitator settlement receipt; may include a transaction reference). Conditional fields depend on the result and data-source availability.","headers":{"payment-response":{"description":"Present on settled 2xx only. Facilitator settlement receipt for the x402 payment (not present on 4xx/5xx, which are not charged).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"holdings":{"type":"array","items":{"type":"object","properties":{"asset":{"type":"string"},"qty":{"type":"string"},"basis":{"type":"number"},"value":{"type":"number"},"unrealised":{"type":"number"}},"additionalProperties":true}},"dust":{"type":"array","items":{}},"unpriced":{"type":"array","items":{}},"openLots":{"type":"array","items":{"type":"object","properties":{"lotId":{"type":"string"},"asset":{"type":"string"},"qty":{"type":"string"},"basis":{"type":"number"},"acquiredTs":{"type":"string"},"wallet":{"type":"string"}},"additionalProperties":true}},"asOf":{"type":"string"},"method":{"type":"string"},"sources":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"url":{"type":"string"},"retrievedAt":{"type":"string"},"status":{"type":"string"}},"additionalProperties":true},"description":"Provenance only (source, url, retrievedAt). Not keyed by check id and does not carry success or error. A check in missing_items does not remove its upstream from sources[]; unavailability is only in missing_items (and unavailable findings)."},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"holdings":[{"asset":"BTC","qty":"0.5","basis":1000000,"value":4500000,"unrealised":3500000}],"dust":[],"unpriced":[],"openLots":[{"lotId":"b2","asset":"BTC","qty":"0.5","basis":1000000,"acquiredTs":"2025-02-01T00:00:00Z","wallet":"w1"}],"asOf":"2026-12-31T23:59:59Z","method":"FIFO","sources":[{"source":"Caller-supplied ledger, prices and jurisdiction inputs processed locally","url":"https://www.brainiac.software/api/v1/crypto-tax","retrievedAt":"2026-11-14","status":"ok"}],"limitations":["Holdings replay the ledger to asOf with FIFO. Assets below dustThresholdFiat are listed under dust.","Pure computation on caller input: no exchange, wallet, market-price or tax-authority API is called at request time.","…"]}}}},"400":{"description":"Invalid JSON or request schema. Not charged (no payment-response). If this 400 is returned before the Idempotency-Key is reserved, the key is not stored — fix the body and you may reuse the key. If an operation-path 400 was stored after a payment-signature was attached, the same key + same body replays it; the same key + a different body returns 409."},"402":{"description":"Payment required. The JSON body is the x402 PaymentRequired object. An unpaid 402 does not store the Idempotency-Key. A 402 after payment-signature releases the key and includes prior-payment-attempt (nonce, settled false|unknown). Not charged; no payment-response. Before re-signing after a post-signature 402, check USDC authorizationState(payer, nonce) on Base."},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Same key with a different body after a stored result returns conflict. Reusing the key cannot trigger a second charge. Not charged when settlement did not occur."},"413":{"description":"Request body exceeds the 24 MB limit. Not charged."},"500":{"description":"Operation failed before settlement, so no payment is taken (no payment-response). The error is stored: reuse the same Idempotency-Key and body to retrieve it without paying again. Use a new key for a fresh attempt with a new payment-signature."},"502":{"description":"Facilitator verify/settle transport failure (often timeout). After payment-signature this is returned as SETTLEMENT_UNKNOWN with prior-payment-attempt; the outcome is stored under the Idempotency-Key. With the shared store configured, other instances replay it instead of settling again; without it, each instance keeps its own memory. The authorization may already be settled on-chain — do not re-sign until USDC authorizationState(payer, nonce) on Base is false."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run. Not charged; no payment-response. A 503 after payment-signature releases the Idempotency-Key and includes prior-payment-attempt."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.04"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/crypto-tax/exchange-csv-normalize":{"post":{"operationId":"normalize_exchange_csv_to_ledger","summary":"Normalize exchange CSV to ledger","description":"Convert a caller CSV export into the shared ledger schema using a caller column mapping, or return a mapping template from headers.","tags":["crypto-tax"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"csv":{"type":"string","maxLength":10485760},"mapping":{"type":"object","properties":{"ts":{"anyOf":[{"type":"string","minLength":1},{"type":"object","properties":{"column":{"type":"string","minLength":1},"format":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scale":{"type":"number","exclusiveMinimum":0}},"required":["column"],"additionalProperties":false}]},"type":{"anyOf":[{"type":"string","minLength":1},{"type":"object","properties":{"column":{"type":"string","minLength":1},"format":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scale":{"type":"number","exclusiveMinimum":0}},"required":["column"],"additionalProperties":false}]},"asset":{"anyOf":[{"type":"string","minLength":1},{"type":"object","properties":{"column":{"type":"string","minLength":1},"format":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scale":{"type":"number","exclusiveMinimum":0}},"required":["column"],"additionalProperties":false}]},"qty":{"anyOf":[{"type":"string","minLength":1},{"type":"object","properties":{"column":{"type":"string","minLength":1},"format":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scale":{"type":"number","exclusiveMinimum":0}},"required":["column"],"additionalProperties":false}]},"fiatValue":{"anyOf":[{"type":"string","minLength":1},{"type":"object","properties":{"column":{"type":"string","minLength":1},"format":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scale":{"type":"number","exclusiveMinimum":0}},"required":["column"],"additionalProperties":false}]},"feeFiat":{"anyOf":[{"type":"string","minLength":1},{"type":"object","properties":{"column":{"type":"string","minLength":1},"format":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scale":{"type":"number","exclusiveMinimum":0}},"required":["column"],"additionalProperties":false}]},"wallet":{"anyOf":[{"type":"string","minLength":1},{"type":"object","properties":{"column":{"type":"string","minLength":1},"format":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scale":{"type":"number","exclusiveMinimum":0}},"required":["column"],"additionalProperties":false}]},"txHash":{"anyOf":[{"type":"string","minLength":1},{"type":"object","properties":{"column":{"type":"string","minLength":1},"format":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scale":{"type":"number","exclusiveMinimum":0}},"required":["column"],"additionalProperties":false}]},"counterAsset":{"anyOf":[{"type":"string","minLength":1},{"type":"object","properties":{"column":{"type":"string","minLength":1},"format":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scale":{"type":"number","exclusiveMinimum":0}},"required":["column"],"additionalProperties":false}]},"counterQty":{"anyOf":[{"type":"string","minLength":1},{"type":"object","properties":{"column":{"type":"string","minLength":1},"format":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scale":{"type":"number","exclusiveMinimum":0}},"required":["column"],"additionalProperties":false}]},"id":{"anyOf":[{"type":"string","minLength":1},{"type":"object","properties":{"column":{"type":"string","minLength":1},"format":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"scale":{"type":"number","exclusiveMinimum":0}},"required":["column"],"additionalProperties":false}]}},"required":["ts","type","asset","qty","fiatValue"],"additionalProperties":false},"wallet":{"default":"exchange","type":"string","minLength":1,"maxLength":128},"fiatCurrency":{"default":"USD","type":"string","minLength":3,"maxLength":3}},"required":["csv"],"additionalProperties":false},"example":{"csv":"Date,Type,Asset,Amount,Total\n2026-01-02 10:00:00,Buy,BTC,0.1,4000.00\n","mapping":{"ts":{"column":"Date","format":"yyyy-MM-dd HH:mm:ss","timezone":"UTC"},"type":{"column":"Type","values":{"Buy":"buy","Sell":"sell"}},"asset":"Asset","qty":"Amount","fiatValue":{"column":"Total","scale":100}},"wallet":"exchange-1","fiatCurrency":"USD"}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. For coverage operations, HTTP 200 is used for status complete, partial, and failed; all three settle and are charged at the full listed price. A settled 2xx includes a payment-response response header (facilitator settlement receipt; may include a transaction reference). Conditional fields depend on the result and data-source availability.","headers":{"payment-response":{"description":"Present on settled 2xx only. Facilitator settlement receipt for the x402 payment (not present on 4xx/5xx, which are not charged).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"ledger":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ts":{"type":"string"},"type":{"type":"string"},"asset":{"type":"string"},"qty":{"type":"string"},"fiatValue":{"type":"number"},"feeFiat":{"type":"number"},"wallet":{"type":"string"},"txHash":{"type":"null"},"counterAsset":{"type":"null"},"counterQty":{"type":"null"}},"additionalProperties":true}},"rejectedRows":{"type":"array","items":{}},"mappingTemplate":{"type":"null"},"fiatCurrency":{"type":"string"},"sources":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"url":{"type":"string"},"retrievedAt":{"type":"string"},"status":{"type":"string"}},"additionalProperties":true},"description":"Provenance only (source, url, retrievedAt). Not keyed by check id and does not carry success or error. A check in missing_items does not remove its upstream from sources[]; unavailability is only in missing_items (and unavailable findings)."},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"ledger":[{"id":"row-2","ts":"2026-01-02T10:00:00+00:00","type":"buy","asset":"BTC","qty":"0.1","fiatValue":400000,"feeFiat":0,"wallet":"exchange-1","txHash":null,"counterAsset":null,"counterQty":null}],"rejectedRows":[],"mappingTemplate":null,"fiatCurrency":"USD","sources":[{"source":"Caller-supplied ledger, prices and jurisdiction inputs processed locally","url":"https://www.brainiac.software/api/v1/crypto-tax","retrievedAt":"2026-11-14","status":"ok"}],"limitations":["RFC 4180 CSV with caller column mapping only. Timestamps are emitted with an offset. No built-in exchange formats are s…","Pure computation on caller input: no exchange, wallet, market-price or tax-authority API is called at request time.","…"]}}}},"400":{"description":"Invalid JSON or request schema. Not charged (no payment-response). If this 400 is returned before the Idempotency-Key is reserved, the key is not stored — fix the body and you may reuse the key. If an operation-path 400 was stored after a payment-signature was attached, the same key + same body replays it; the same key + a different body returns 409."},"402":{"description":"Payment required. The JSON body is the x402 PaymentRequired object. An unpaid 402 does not store the Idempotency-Key. A 402 after payment-signature releases the key and includes prior-payment-attempt (nonce, settled false|unknown). Not charged; no payment-response. Before re-signing after a post-signature 402, check USDC authorizationState(payer, nonce) on Base."},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Same key with a different body after a stored result returns conflict. Reusing the key cannot trigger a second charge. Not charged when settlement did not occur."},"413":{"description":"Request body exceeds the 24 MB limit. Not charged."},"500":{"description":"Operation failed before settlement, so no payment is taken (no payment-response). The error is stored: reuse the same Idempotency-Key and body to retrieve it without paying again. Use a new key for a fresh attempt with a new payment-signature."},"502":{"description":"Facilitator verify/settle transport failure (often timeout). After payment-signature this is returned as SETTLEMENT_UNKNOWN with prior-payment-attempt; the outcome is stored under the Idempotency-Key. With the shared store configured, other instances replay it instead of settling again; without it, each instance keeps its own memory. The authorization may already be settled on-chain — do not re-sign until USDC authorizationState(payer, nonce) on Base is false."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run. Not charged; no payment-response. A 503 after payment-signature releases the Idempotency-Key and includes prior-payment-attempt."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.03"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/crypto-tax/missing-basis-detect":{"post":{"operationId":"detect_missing_basis_problems","summary":"Detect missing basis problems","description":"Replay balances to find disposal-without-acquisition, negative balance, unmatched transfer-in and unpriced events before gains are computed.","tags":["crypto-tax"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ledger":{"minItems":1,"maxItems":100000,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"ts":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"type":{"type":"string","enum":["buy","sell","transfer_in","transfer_out","income","fee","trade"]},"asset":{"type":"string","minLength":1,"maxLength":32},"qty":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"fiatValue":{"type":"integer","minimum":0,"maximum":9007199254740991},"feeFiat":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"wallet":{"type":"string","minLength":1,"maxLength":128},"txHash":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]},"counterAsset":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]},"counterQty":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]}},"required":["id","ts","type","asset","qty","fiatValue","wallet"],"additionalProperties":false}},"prices":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}}},"required":["ledger"],"additionalProperties":false},"example":{"ledger":[{"id":"s9","ts":"2026-01-01T00:00:00Z","type":"sell","asset":"SOL","qty":"1","fiatValue":100,"feeFiat":0,"wallet":"w1"}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. For coverage operations, HTTP 200 is used for status complete, partial, and failed; all three settle and are charged at the full listed price. A settled 2xx includes a payment-response response header (facilitator settlement receipt; may include a transaction reference). Conditional fields depend on the result and data-source availability.","headers":{"payment-response":{"description":"Present on settled 2xx only. Facilitator settlement receipt for the x402 payment (not present on 4xx/5xx, which are not charged).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"asset":{"type":"string"},"firstTxId":{"type":"string"},"kind":{"type":"string"}},"additionalProperties":true}},"ok":{"type":"boolean"},"sources":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"url":{"type":"string"},"retrievedAt":{"type":"string"},"status":{"type":"string"}},"additionalProperties":true},"description":"Provenance only (source, url, retrievedAt). Not keyed by check id and does not carry success or error. A check in missing_items does not remove its upstream from sources[]; unavailability is only in missing_items (and unavailable findings)."},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"issues":[{"asset":"SOL","firstTxId":"s9","kind":"disposal_without_acquisition"},{"asset":"SOL","firstTxId":"s9","kind":"negative_balance"}],"ok":false,"sources":[{"source":"Caller-supplied ledger, prices and jurisdiction inputs processed locally","url":"https://www.brainiac.software/api/v1/crypto-tax","retrievedAt":"2026-11-14","status":"ok"}],"limitations":["Replays balances per asset and reports the earliest offending transaction per asset and kind.","Pure computation on caller input: no exchange, wallet, market-price or tax-authority API is called at request time.","…"]}}}},"400":{"description":"Invalid JSON or request schema. Not charged (no payment-response). If this 400 is returned before the Idempotency-Key is reserved, the key is not stored — fix the body and you may reuse the key. If an operation-path 400 was stored after a payment-signature was attached, the same key + same body replays it; the same key + a different body returns 409."},"402":{"description":"Payment required. The JSON body is the x402 PaymentRequired object. An unpaid 402 does not store the Idempotency-Key. A 402 after payment-signature releases the key and includes prior-payment-attempt (nonce, settled false|unknown). Not charged; no payment-response. Before re-signing after a post-signature 402, check USDC authorizationState(payer, nonce) on Base."},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Same key with a different body after a stored result returns conflict. Reusing the key cannot trigger a second charge. Not charged when settlement did not occur."},"413":{"description":"Request body exceeds the 24 MB limit. Not charged."},"500":{"description":"Operation failed before settlement, so no payment is taken (no payment-response). The error is stored: reuse the same Idempotency-Key and body to retrieve it without paying again. Use a new key for a fresh attempt with a new payment-signature."},"502":{"description":"Facilitator verify/settle transport failure (often timeout). After payment-signature this is returned as SETTLEMENT_UNKNOWN with prior-payment-attempt; the outcome is stored under the Idempotency-Key. With the shared store configured, other instances replay it instead of settling again; without it, each instance keeps its own memory. The authorization may already be settled on-chain — do not re-sign until USDC authorizationState(payer, nonce) on Base is false."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run. Not charged; no payment-response. A 503 after payment-signature releases the Idempotency-Key and includes prior-payment-attempt."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.03"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}}},"components":{"schemas":{"ApiError":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}}}}}}}}