# Bond Price & Yield Calculator (24K Labs)

> Bond Price & Yield Calculator (24K Labs) 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).

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

## Facts

- Endpoint: POST https://api.24klabs.ai/api/v1/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-calculator-24k-labs-d2091d4f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Yq8CP_SEXV5V4YmzPxdPA

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-calculator-24k-labs-d2091d4f -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, $1,000 face value, 10 years to maturity, and semi-annual coupon payments, given a yield of 4.5%.

## When to prefer this

Choose this endpoint when you need fast, precise fixed-income analytics — price, yield, duration, and convexity — without running a full Bloomberg terminal or building your own bond math. Ideal for portfolio risk tools, agent-driven financial analysis, or any workflow that needs bond sensitivity metrics on demand at low per-call cost.

## Known failure modes

- Invalid coupon frequency causes computation error
- Maturity date in the past yields undefined results
- Yield or price inputs out of realistic bounds return errors
- Missing required fields (coupon, face, maturity) return 400 validation errors
- Negative coupon rate or face value rejected

## 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 computed bond price or yield-to-maturity, current yield, Macaulay duration, modified duration, and convexity as numerical values, enabling full fixed-income analytics from basic 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-calculator-24k-labs-d2091d4f/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)
