---
title: "Typical year (TMY: Sandia, ISO 15927-4 or custom weights)"
method: POST
path: "/api/generate/tmy"
tags: ["Generate weather files"]
---

# Typical year (TMY: Sandia, ISO 15927-4 or custom weights)

`POST /api/generate/tmy`

## Request

- Base URL: `https://epw.tools`
- URL: `https://epw.tools/api/generate/tmy`
- Auth: API key in header `X-API-Key`

Typical year built from a range of actual years (Sandia by default; ISO 15927-4 and custom weights need a paid account). 1 credit.

Starts a background job and returns `{"job_id": ...}` immediately. Credits are charged on submission and refunded if the job fails; the balance after the call is in the `X-Credits-Remaining` response header. Then poll `GET /api/jobs/{job_id}`, stream `/api/jobs/{job_id}/stream`, or register a webhook.

## Headers

- `X-API-Key` string, nullable

## Request body

- TMYRequest
  - `lat` number, required
  - `lon` number, required
  - `location_name` string, required
  - `start_year` integer, required
  - `end_year` integer, required
  - `dc_edition` string
  - `weights` object
  - `data_source` string
  - `use_case` string
  - `recency_halflife_years` number, nullable
  - `tmy_method` string
  - `design_years` string

## Response `200`

Successful Response

- unknown

## Other responses

- `402`: Insufficient credits for this operation.
- `422`: Validation Error
- `429`: Rate limit exceeded — retry after a short delay.

---

[API](https://skmtc.dev/epw/apis/epw-tools-api.md) · [All operations](https://skmtc.dev/epw/apis/epw-tools-api/llms.txt) · [OpenAPI document](https://skmtc.dev/epw/apis/epw-tools-api/revisions/e6b60fc7a6d7?raw)
