{
  "openapi": "3.1.0",
  "info": {
    "title": "PromptSpend Pricing API",
    "version": "1.0.0",
    "summary": "Current published API prices for large language models.",
    "description": "A read-only, unauthenticated, CORS-open view of the pricing catalog behind promptspend.com.\n\nThe catalog is re-checked every morning against each vendor and two independent third-party\nsources; every row records which source it came from and when it was last confirmed. Prices are\nstandard-tier, global-endpoint list prices in USD per 1,000,000 tokens. Regional premiums,\npriority tiers, server-side tool fees and negotiated discounts are not included.\n\nNo key, no rate limit, no logging of who calls it. Attribution is appreciated, not required.",
    "license": {
      "name": "MIT",
      "url": "https://github.com/AndrewAvery7/promptspend/blob/main/LICENSE"
    },
    "contact": {
      "name": "PromptSpend",
      "url": "https://github.com/AndrewAvery7/promptspend"
    }
  },
  "servers": [
    {
      "url": "https://promptspend.dev"
    }
  ],
  "paths": {
    "/v1/models": {
      "get": {
        "summary": "Every model, in full",
        "operationId": "listModels",
        "parameters": [
          {
            "name": "provider",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Restrict to one provider id, e.g. `anthropic`."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "current",
                "legacy",
                "deprecated"
              ]
            }
          },
          {
            "name": "aliases",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "include",
                "exclude"
              ],
              "default": "exclude"
            },
            "description": "Routing aliases are excluded by default so one product is not counted twice."
          }
        ],
        "responses": {
          "200": {
            "description": "The catalog.",
            "headers": {
              "X-PromptSpend-Generated-At": {
                "schema": {
                  "type": "string",
                  "format": "date-time"
                },
                "description": "When the underlying catalog was generated."
              },
              "X-PromptSpend-Stale": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                },
                "description": "Present only when the origin was unreachable and a retained copy was served."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "generatedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "models": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "providerId",
                          "displayName",
                          "status",
                          "contextWindow",
                          "pricing",
                          "provenance"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "claude-opus-5"
                          },
                          "providerId": {
                            "type": "string",
                            "example": "anthropic"
                          },
                          "displayName": {
                            "type": "string",
                            "example": "Claude Opus 5"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "current",
                              "legacy",
                              "deprecated"
                            ]
                          },
                          "aliasOf": {
                            "type": "string",
                            "description": "Present when this id is a routing alias for another entry."
                          },
                          "contextWindow": {
                            "type": "integer",
                            "example": 1000000
                          },
                          "maxOutput": {
                            "type": "integer",
                            "example": 128000
                          },
                          "releaseDate": {
                            "type": "string",
                            "format": "date"
                          },
                          "capabilityIndex": {
                            "type": "number",
                            "description": "Rough 0–100 estimate. Absent means unscored; do not substitute a number."
                          },
                          "pricing": {
                            "type": "object",
                            "required": [
                              "input",
                              "output"
                            ],
                            "description": "USD per 1,000,000 tokens.",
                            "properties": {
                              "input": {
                                "type": "number",
                                "example": 5
                              },
                              "output": {
                                "type": "number",
                                "example": 25
                              },
                              "cachedInput": {
                                "type": "number"
                              },
                              "cacheWrite": {
                                "type": "number"
                              },
                              "batchDiscount": {
                                "type": "number",
                                "description": "Multiplier, e.g. 0.5 for half price."
                              },
                              "intro": {
                                "type": "object",
                                "description": "Promotional rates, with the date they lapse."
                              },
                              "longContext": {
                                "type": "object",
                                "description": "Rates that replace the base ones once a single request exceeds thresholdTokens. The whole request is billed at these rates, not just the excess."
                              }
                            }
                          },
                          "capabilities": {
                            "type": "object",
                            "properties": {
                              "reasoning": {
                                "type": "boolean"
                              },
                              "vision": {
                                "type": "boolean"
                              }
                            }
                          },
                          "tokenizer": {
                            "type": "object",
                            "description": "Either an exact tiktoken encoding or a characters-per-token estimate."
                          },
                          "provenance": {
                            "type": "object",
                            "required": [
                              "source",
                              "lastVerified"
                            ],
                            "properties": {
                              "source": {
                                "type": "string",
                                "enum": [
                                  "vendor",
                                  "litellm",
                                  "openrouter"
                                ]
                              },
                              "lastVerified": {
                                "type": "string",
                                "format": "date"
                              },
                              "lastChanged": {
                                "type": "string",
                                "format": "date"
                              },
                              "verifiedUrl": {
                                "type": "string",
                                "format": "uri"
                              },
                              "needsReview": {
                                "type": "boolean"
                              },
                              "stale": {
                                "type": "boolean"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/models/{id}": {
      "get": {
        "summary": "One model",
        "operationId": "getModel",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The model.",
            "headers": {
              "X-PromptSpend-Generated-At": {
                "schema": {
                  "type": "string",
                  "format": "date-time"
                },
                "description": "When the underlying catalog was generated."
              },
              "X-PromptSpend-Stale": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                },
                "description": "Present only when the origin was unreachable and a retained copy was served."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "providerId",
                    "displayName",
                    "status",
                    "contextWindow",
                    "pricing",
                    "provenance"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "claude-opus-5"
                    },
                    "providerId": {
                      "type": "string",
                      "example": "anthropic"
                    },
                    "displayName": {
                      "type": "string",
                      "example": "Claude Opus 5"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "current",
                        "legacy",
                        "deprecated"
                      ]
                    },
                    "aliasOf": {
                      "type": "string",
                      "description": "Present when this id is a routing alias for another entry."
                    },
                    "contextWindow": {
                      "type": "integer",
                      "example": 1000000
                    },
                    "maxOutput": {
                      "type": "integer",
                      "example": 128000
                    },
                    "releaseDate": {
                      "type": "string",
                      "format": "date"
                    },
                    "capabilityIndex": {
                      "type": "number",
                      "description": "Rough 0–100 estimate. Absent means unscored; do not substitute a number."
                    },
                    "pricing": {
                      "type": "object",
                      "required": [
                        "input",
                        "output"
                      ],
                      "description": "USD per 1,000,000 tokens.",
                      "properties": {
                        "input": {
                          "type": "number",
                          "example": 5
                        },
                        "output": {
                          "type": "number",
                          "example": 25
                        },
                        "cachedInput": {
                          "type": "number"
                        },
                        "cacheWrite": {
                          "type": "number"
                        },
                        "batchDiscount": {
                          "type": "number",
                          "description": "Multiplier, e.g. 0.5 for half price."
                        },
                        "intro": {
                          "type": "object",
                          "description": "Promotional rates, with the date they lapse."
                        },
                        "longContext": {
                          "type": "object",
                          "description": "Rates that replace the base ones once a single request exceeds thresholdTokens. The whole request is billed at these rates, not just the excess."
                        }
                      }
                    },
                    "capabilities": {
                      "type": "object",
                      "properties": {
                        "reasoning": {
                          "type": "boolean"
                        },
                        "vision": {
                          "type": "boolean"
                        }
                      }
                    },
                    "tokenizer": {
                      "type": "object",
                      "description": "Either an exact tiktoken encoding or a characters-per-token estimate."
                    },
                    "provenance": {
                      "type": "object",
                      "required": [
                        "source",
                        "lastVerified"
                      ],
                      "properties": {
                        "source": {
                          "type": "string",
                          "enum": [
                            "vendor",
                            "litellm",
                            "openrouter"
                          ]
                        },
                        "lastVerified": {
                          "type": "string",
                          "format": "date"
                        },
                        "lastChanged": {
                          "type": "string",
                          "format": "date"
                        },
                        "verifiedUrl": {
                          "type": "string",
                          "format": "uri"
                        },
                        "needsReview": {
                          "type": "boolean"
                        },
                        "stale": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No model with that id."
          }
        }
      }
    },
    "/v1/providers": {
      "get": {
        "summary": "Every provider, with a model count",
        "operationId": "listProviders",
        "responses": {
          "200": {
            "description": "The providers.",
            "headers": {
              "X-PromptSpend-Generated-At": {
                "schema": {
                  "type": "string",
                  "format": "date-time"
                },
                "description": "When the underlying catalog was generated."
              },
              "X-PromptSpend-Stale": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                },
                "description": "Present only when the origin was unreachable and a retained copy was served."
              }
            }
          }
        }
      }
    },
    "/v1/prices": {
      "get": {
        "summary": "Flat price rows — the numbers and nothing else",
        "operationId": "listPrices",
        "parameters": [
          {
            "name": "provider",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Restrict to one provider id, e.g. `anthropic`."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "current",
                "legacy",
                "deprecated"
              ]
            }
          },
          {
            "name": "aliases",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "include",
                "exclude"
              ],
              "default": "exclude"
            },
            "description": "Routing aliases are excluded by default so one product is not counted twice."
          }
        ],
        "responses": {
          "200": {
            "description": "One row per model.",
            "headers": {
              "X-PromptSpend-Generated-At": {
                "schema": {
                  "type": "string",
                  "format": "date-time"
                },
                "description": "When the underlying catalog was generated."
              },
              "X-PromptSpend-Stale": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                },
                "description": "Present only when the origin was unreachable and a retained copy was served."
              }
            }
          }
        }
      }
    },
    "/v1/prices.csv": {
      "get": {
        "summary": "The same rows as CSV, for a spreadsheet",
        "operationId": "listPricesCsv",
        "parameters": [
          {
            "name": "provider",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Restrict to one provider id, e.g. `anthropic`."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "current",
                "legacy",
                "deprecated"
              ]
            }
          },
          {
            "name": "aliases",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "include",
                "exclude"
              ],
              "default": "exclude"
            },
            "description": "Routing aliases are excluded by default so one product is not counted twice."
          }
        ],
        "responses": {
          "200": {
            "description": "CSV, RFC 4180.",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/health": {
      "get": {
        "summary": "Whether this API can see a valid, current catalog",
        "operationId": "health",
        "responses": {
          "200": {
            "description": "Healthy."
          },
          "503": {
            "description": "The catalog could not be read or did not validate."
          }
        }
      }
    }
  }
}
