# Bond Price, Yield & Duration Calculator

> Bond Price, Yield & Duration Calculator is a paid API for AI agents from api.24klabs.ai, paid per call via x402, $0.004/call, status unknown (last checked 2026-09-13).

Computes clean bond price, yield-to-maturity, current yield, Macaulay duration, modified duration, and convexity from coupon rate, face value, maturity date, and coupon frequency.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/bond-price-yield
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/bond-price-yield-duration-calculator-3e139286
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_nV5XPXaT1HbpON7CCDGkc

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 bond-price-yield-duration-calculator-3e139286 -d '<json body>'
```

Example prompt: Calculate the price, yield-to-maturity, Macaulay duration, modified duration, and convexity for a bond with a 5% annual coupon, $1000 face value, maturing in 10 years, with semi-annual coupon payments, priced at a 4.5% yield.

## When to prefer this

Choose this endpoint when you need a full suite of fixed-income analytics — price, yield, and duration measures — in a single call. Ideal for AI agents performing bond valuation, portfolio duration analysis, or interest rate risk assessment without maintaining financial math libraries. Particularly useful for standardized coupon bonds when you need both pricing and risk metrics simultaneously.

## Known failure modes

- Invalid or negative coupon rate returns a validation error
- Maturity date in the past or invalid date format causes a 400 error
- Unsupported coupon frequency (e.g. not annual/semi-annual/quarterly/monthly) returns an error
- Missing required fields (face value, maturity, coupon) cause a 422 unprocessable entity
- Extreme or nonsensical yield values may cause computation failure or non-convergence

## How this service works

Clean price or yield-to-maturity plus current yield, Macaulay and modified duration and convexity from coupon, face, maturity and coupon frequency.

## Output

Returns the clean bond price (or yield-to-maturity if price is provided as input), current yield, Macaulay duration, modified duration, and convexity — a complete set of fixed-income analytics for the specified bond parameters.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "ytm": {
   "type": "number"
  },
  "face": {
   "type": "number"
  },
  "frequency": {
   "type": "number"
  },
  "coupon_rate": {
   "type": "number"
  },
  "years_to_maturity": {
   "type": "number"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "price": 925.61,
  "current_yield": 5.4,
  "modified_duration": 7.66
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/bond-price-yield-duration-calculator-3e139286/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.24klabs.ai](https://www.zero.xyz/host/api.24klabs.ai/llms.txt)
