# US Treasury Yield Spread Calculator

> US Treasury Yield Spread Calculator is a paid API for AI agents from macro-data-api-313m.onrender.com, paid per call via x402, $0.01/call, status down (last checked 2026-10-31).

Returns the spread in percentage points between any two US Treasury yield curve tenors for a given date, and flags whether the spread is inverted.

## Facts

- Endpoint: GET https://macro-data-api-313m.onrender.com/v1/spread?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: down
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/us-treasury-yield-spread-calculator-4b853199
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__mDtIiZQYi-LG0AOEuGut

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-treasury-yield-spread-calculator-4b853199
```

Example prompt: What's the spread between the 2-year and 10-year US Treasury yields today, and is the curve inverted?

## When to prefer this

Use this endpoint when you need a precise, point-in-time spread between any two specific US Treasury tenors, especially for yield curve inversion analysis. Prefer this over fetching the full yield curve when you only need a single spread value. Ideal for recession signal monitoring, fixed income analysis, or any workflow that needs to programmatically detect yield curve inversion between arbitrary tenor pairs.

## Known failure modes

- Invalid tenor code returns an error — only specific tenors (1m, 1.5m, 2m, 3m, 4m, 6m, 1y, 2y, 3y, 5y, 7y, 10y, 20y, 30y) are accepted
- Date with no available Treasury data (weekends, federal holidays) may return an error or fall back to the nearest available date
- Future dates return an error as data is not yet available
- Render cold-start latency may cause occasional slow responses or timeouts
- Network errors from the underlying data source may result in 500-level errors

## How this service works

Returns the spread in percentage points between two US Treasury tenors on a date and whether it is inverted.

## Output

Returns the spread in percentage points between two specified US Treasury tenors (tenor A yield minus tenor B yield), whether the spread is currently inverted (negative), and the date of the data. Includes the individual yield values for each tenor.

## 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": [],
     "properties": {
      "a": {
       "type": "string",
       "description": "Tenor: 1m, 1.5m, 2m, 3m, 4m, 6m, 1y, 2y, 3y, 5y, 7y, 10y, 20y, 30y"
      },
      "b": {
       "type": "string",
       "description": "Tenor: 1m, 1.5m, 2m, 3m, 4m, 6m, 1y, 2y, 3y, 5y, 7y, 10y, 20y, 30y"
      },
      "date": {
       "type": "string",
       "description": "Optional date YYYY-MM-DD. Default: latest available."
      }
     }
    }
   },
   "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-treasury-yield-spread-calculator-4b853199/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from macro-data-api-313m.onrender.com](https://www.zero.xyz/host/macro-data-api-313m.onrender.com/llms.txt)
