# US Capital Gains Tax Estimator

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

Computes estimated US capital gains tax liability using long-term (0/15/20%) or short-term ordinary rates, plus net investment income tax (NIIT), based on gain amount, filing status, holding period, and other income.

## Facts

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

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-df30e74e
```

Example prompt: I sold some stock and realized a $75,000 long-term capital gain in 2026 — I'm single and my other taxable income is about $120,000. Can you estimate my federal capital gains tax, including any net investment income tax?

## When to prefer this

Use this endpoint when you need a fast, deterministic computation of US federal capital gains tax for a specific gain amount without calling a full tax engine or advisory service. Ideal for investment tools, financial planning agents, and portfolio dashboards that need quick bracket and NIIT estimates inline. Prefer over generic tax APIs when you specifically need long-term vs short-term rate differentiation and NIIT computation in one call.

## Known failure modes

- Missing required 'gain' parameter returns a validation error
- Negative gain value rejected (must be >= 0)
- Invalid filing_status enum value causes a 400-level error
- Non-integer tax_year or unsupported future/past year may produce unexpected results
- Invalid holding_period enum value ('long' or 'short' only) causes error

## 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 the estimated federal capital gains tax amount broken down by applicable rate bracket (0%, 15%, 20% for long-term; ordinary income brackets for short-term), the net investment income tax (3.8% NIIT) if applicable, and likely the total estimated tax owed — all computed purely from the provided inputs with no state tax or advice.

## 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-df30e74e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from payai.agentstools.dev](https://www.zero.xyz/host/payai.agentstools.dev/llms.txt)
