# US Capital Gains Tax Estimator

> US Capital Gains Tax Estimator is a paid API for AI agents from api.agentstools.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-15).

Estimates US capital gains tax liability using long-term (0/15/20%) or short-term ordinary rates, plus net investment income tax, given gain amount, filing status, and income context.

## Facts

- Endpoint: GET https://api.agentstools.dev/tax/capgains
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/us-capital-gains-tax-estimator-ff4f7351
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Vl45ROUJRq4s5A084C4Zv

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 us-capital-gains-tax-estimator-ff4f7351
```

Example prompt: I sold stock I'd held for two years and made a $85,000 long-term capital gain — I'm a single filer with about $120,000 in ordinary income for 2026. Can you estimate my total capital gains tax including any net investment income tax?

## When to prefer this

Use this endpoint when you need a fast, pure-computation capital gains tax estimate for a US taxpayer without calling a full tax engine. Ideal for investment decision tools, financial planning assistants, or pre-sale tax impact calculators. Prefer this over generic tax APIs when you specifically need LTCG bracket stacking logic and NIIT computation in a single lightweight call.

## Known failure modes

- Missing required 'gain' parameter returns a 400 error
- Negative gain value rejected as invalid input
- Unrecognized filing_status enum value returns validation error
- Non-numeric gain or ordinary_income value returns a parse error
- Unsupported tax_year value may return an error or fall back to default

## How this service works

US capital gains tax estimate: long-term 0/15/20 percent rates or short-term ordinary rates, plus the net investment income tax. Pure computation over your inputs, not tax advice.

## Output

Returns a computed breakdown of US capital gains tax liability, including the applicable long-term rate tier (0%, 15%, or 20%) or short-term ordinary rate applied to the gain, net investment income tax (3.8%) if applicable, and total estimated tax owed — based purely on the provided inputs.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "gain"
     ],
     "properties": {
      "gain": {
       "type": "number",
       "description": "Capital gain amount (>= 0)"
      },
      "tax_year": {
       "type": "integer",
       "description": "Tax year, default 2026"
      },
      "filing_status": {
       "enum": [
        "single",
        "married_jointly",
        "married_separately",
        "head_of_household"
       ],
       "type": "string",
       "description": "Filing status, default single"
      },
      "holding_period": {
       "enum": [
        "long",
        "short"
       ],
       "type": "string",
       "description": "long uses 0/15/20 rates; short uses ordinary rates"
      },
      "ordinary_income": {
       "type": "number",
       "description": "Other taxable income, used to stack the gain into brackets"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/us-capital-gains-tax-estimator-ff4f7351/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.agentstools.dev](https://www.zero.xyz/host/api.agentstools.dev/llms.txt)
