# x402toll Capital Gains Tax Calculator

> x402toll Capital Gains Tax Calculator is a paid API for AI agents from x402toll.com, paid per call via x402, $0.1/call, status unknown (last checked 2026-09-13).

Calculates US federal capital gains tax using 2026 long-term bracket stacking (0%/15%/20%), short-term ordinary rates, and the 3.8% Net Investment Income Tax

## Facts

- Endpoint: POST https://x402toll.com/v1/tax/capital-gains
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402toll-capital-gains-tax-calculator-9772dcb6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_GycMCT_R6MjjxYxvVCoug

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

## How to call it through Zero

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

```sh
zero fetch --capability x402toll-capital-gains-tax-calculator-9772dcb6 -d '<json body>'
```

Example prompt: I sold some stock this year — I have $80,000 in long-term capital gains and $15,000 in short-term gains. My MAGI is $220,000 and my ordinary taxable income is $175,000 and I file as single. What's my total federal capital gains tax including NIIT for 2026?

## When to prefer this

Use this endpoint when you need a precise, 2026-current federal capital gains tax estimate that correctly stacks long-term gains atop ordinary income across bracket breakpoints and applies NIIT — ideal when both long-term and short-term gains are present, or when MAGI may push income over the NIIT threshold. Prefer this over a generic tax calculator when you specifically need capital gains breakdown rather than a full income tax estimate.

## Known failure modes

- Missing required 'magi' field returns validation error
- Invalid filing status enum value returns 400 bad request
- Negative gain values may produce unexpected results if not handled
- Payment failure or insufficient USDC balance returns 402 Payment Required
- Extremely large gain values may hit numerical precision limits

## How this service works

Federal capital-gains tax: long-term stacked across the 2026 0%/15%/20% breakpoints, short-term at ordinary marginal rates, plus the 3.8% Net Investment Income Tax.

## Output

A breakdown of federal capital gains tax liability: long-term tax computed by stacking gains atop ordinary income across the 2026 0%/15%/20% bracket thresholds, short-term tax at applicable ordinary marginal rates, the 3.8% NIIT if MAGI exceeds applicable threshold, and a combined total federal capital gains tax owed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "magi": {
   "type": "number"
  },
  "filingStatus": {
   "enum": [
    "single",
    "mfj",
    "hoh",
    "mfs"
   ],
   "type": "string",
   "default": "single"
  },
  "longTermGain": {
   "type": "number",
   "default": 0
  },
  "shortTermGain": {
   "type": "number",
   "default": 0
  },
  "ordinaryTaxableIncome": {
   "type": "number",
   "default": 0
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402toll-capital-gains-tax-calculator-9772dcb6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402toll.com](https://www.zero.xyz/host/x402toll.com/llms.txt)
