# US Treasury Yield Curve API

> US Treasury Yield Curve API 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-30).

Returns the US Treasury par yield curve (1 month to 30 years) for a given date, including 2y-10y and 3m-10y spreads and yield curve shape classification (normal, flat, or inverted).

## Facts

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

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-curve-api-f9a03b93
```

Example prompt: Pull the US Treasury yield curve for today and tell me whether it's normal, flat, or inverted, and what the 2-year to 10-year and 3-month to 10-year spreads are.

## When to prefer this

Use this endpoint when you need a complete snapshot of the US Treasury yield curve for a specific date, including pre-computed spread calculations and a human-readable curve shape label. It is ideal when you need the full curve in one call rather than fetching individual tenors separately. Prefer this over a generic spread endpoint when you want both the raw rates and the spread in a single response.

## Known failure modes

- Date requested is a weekend or US market holiday — no Treasury data published for that day
- Date is in the future — data not yet available
- Date is before Treasury data history begins — returns error
- Malformed date format — expects YYYY-MM-DD
- Service temporarily unavailable on Render infrastructure (cold start delay)

## How this service works

Returns the US Treasury par yield curve (1 month to 30 years) for a date, with the 2y-10y and 3m-10y spreads and whether the curve is normal, flat or inverted.

## Output

Returns a structured response containing par yield rates for each Treasury maturity (1M, 2M, 3M, 6M, 1Y, 2Y, 3Y, 5Y, 7Y, 10Y, 20Y, 30Y), the 2y-10y spread in percentage points, the 3m-10y spread in percentage points, and a yield curve classification string (normal, flat, or inverted) for the requested date.

## 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": {
      "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-curve-api-f9a03b93/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)
