{
  "openapi": "3.0.3",
  "info": {
    "title": "statlyte",
    "version": "1",
    "description": "A public record of AI API list prices and every change to them, read from each vendor's own published pricing page. No key required for current prices; the historical archive (full observation series, filtered change streams, CSV export) needs a Pro key.",
    "contact": {
      "url": "https://statlyte.com/about"
    },
    "license": {
      "name": "Data: sourced from public vendor pricing pages. API: open, CORS enabled."
    }
  },
  "servers": [
    {
      "url": "https://statlyte.com/api/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Pro API key, issued at /pricing."
      }
    },
    "schemas": {
      "Model": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "anthropic/claude-opus-5",
            "description": "{provider}/{slug}"
          },
          "provider": {
            "type": "string",
            "example": "anthropic"
          },
          "name": {
            "type": "string",
            "example": "Claude Opus 5"
          },
          "api_id": {
            "type": "string",
            "description": "The vendor's own model identifier for API calls."
          },
          "status": {
            "type": "string",
            "enum": [
              "ga",
              "preview",
              "retired"
            ]
          },
          "modality": {
            "type": "string",
            "example": "text"
          },
          "context_window": {
            "type": "integer",
            "nullable": true
          },
          "usd_per_mtok": {
            "type": "object",
            "description": "USD per million tokens, keyed by metric. Only metrics the vendor publishes are present.",
            "properties": {
              "input": {
                "type": "number"
              },
              "output": {
                "type": "number"
              },
              "cache_read": {
                "type": "number"
              },
              "cache_write_5m": {
                "type": "number"
              },
              "cache_write_1h": {
                "type": "number"
              },
              "batch_input": {
                "type": "number"
              },
              "batch_output": {
                "type": "number"
              }
            }
          },
          "scheduled_change": {
            "type": "object",
            "nullable": true,
            "description": "A future price change the vendor has already announced.",
            "properties": {
              "effective_on": {
                "type": "string",
                "format": "date"
              },
              "reason": {
                "type": "string"
              },
              "prices": {
                "type": "object",
                "description": "USD per million tokens, keyed by metric. Only metrics the vendor publishes are present.",
                "properties": {
                  "input": {
                    "type": "number"
                  },
                  "output": {
                    "type": "number"
                  },
                  "cache_read": {
                    "type": "number"
                  },
                  "cache_write_5m": {
                    "type": "number"
                  },
                  "cache_write_1h": {
                    "type": "number"
                  },
                  "batch_input": {
                    "type": "number"
                  },
                  "batch_output": {
                    "type": "number"
                  }
                }
              }
            }
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        }
      }
    }
  },
  "paths": {
    "/models": {
      "get": {
        "summary": "Every tracked model with current prices",
        "operationId": "listModels",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "updated_at": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "models": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "anthropic/claude-opus-5",
                            "description": "{provider}/{slug}"
                          },
                          "provider": {
                            "type": "string",
                            "example": "anthropic"
                          },
                          "name": {
                            "type": "string",
                            "example": "Claude Opus 5"
                          },
                          "api_id": {
                            "type": "string",
                            "description": "The vendor's own model identifier for API calls."
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "ga",
                              "preview",
                              "retired"
                            ]
                          },
                          "modality": {
                            "type": "string",
                            "example": "text"
                          },
                          "context_window": {
                            "type": "integer",
                            "nullable": true
                          },
                          "usd_per_mtok": {
                            "type": "object",
                            "description": "USD per million tokens, keyed by metric. Only metrics the vendor publishes are present.",
                            "properties": {
                              "input": {
                                "type": "number"
                              },
                              "output": {
                                "type": "number"
                              },
                              "cache_read": {
                                "type": "number"
                              },
                              "cache_write_5m": {
                                "type": "number"
                              },
                              "cache_write_1h": {
                                "type": "number"
                              },
                              "batch_input": {
                                "type": "number"
                              },
                              "batch_output": {
                                "type": "number"
                              }
                            }
                          },
                          "scheduled_change": {
                            "type": "object",
                            "nullable": true,
                            "description": "A future price change the vendor has already announced.",
                            "properties": {
                              "effective_on": {
                                "type": "string",
                                "format": "date"
                              },
                              "reason": {
                                "type": "string"
                              },
                              "prices": {
                                "type": "object",
                                "description": "USD per million tokens, keyed by metric. Only metrics the vendor publishes are present.",
                                "properties": {
                                  "input": {
                                    "type": "number"
                                  },
                                  "output": {
                                    "type": "number"
                                  },
                                  "cache_read": {
                                    "type": "number"
                                  },
                                  "cache_write_5m": {
                                    "type": "number"
                                  },
                                  "cache_write_1h": {
                                    "type": "number"
                                  },
                                  "batch_input": {
                                    "type": "number"
                                  },
                                  "batch_output": {
                                    "type": "number"
                                  }
                                }
                              }
                            }
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/models/{id}": {
      "get": {
        "summary": "One model by statlyte id",
        "operationId": "getModel",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "anthropic/claude-opus-5",
            "description": "{provider}/{slug}, e.g. openai/gpt-5-mini"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "anthropic/claude-opus-5",
                      "description": "{provider}/{slug}"
                    },
                    "provider": {
                      "type": "string",
                      "example": "anthropic"
                    },
                    "name": {
                      "type": "string",
                      "example": "Claude Opus 5"
                    },
                    "api_id": {
                      "type": "string",
                      "description": "The vendor's own model identifier for API calls."
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "ga",
                        "preview",
                        "retired"
                      ]
                    },
                    "modality": {
                      "type": "string",
                      "example": "text"
                    },
                    "context_window": {
                      "type": "integer",
                      "nullable": true
                    },
                    "usd_per_mtok": {
                      "type": "object",
                      "description": "USD per million tokens, keyed by metric. Only metrics the vendor publishes are present.",
                      "properties": {
                        "input": {
                          "type": "number"
                        },
                        "output": {
                          "type": "number"
                        },
                        "cache_read": {
                          "type": "number"
                        },
                        "cache_write_5m": {
                          "type": "number"
                        },
                        "cache_write_1h": {
                          "type": "number"
                        },
                        "batch_input": {
                          "type": "number"
                        },
                        "batch_output": {
                          "type": "number"
                        }
                      }
                    },
                    "scheduled_change": {
                      "type": "object",
                      "nullable": true,
                      "description": "A future price change the vendor has already announced.",
                      "properties": {
                        "effective_on": {
                          "type": "string",
                          "format": "date"
                        },
                        "reason": {
                          "type": "string"
                        },
                        "prices": {
                          "type": "object",
                          "description": "USD per million tokens, keyed by metric. Only metrics the vendor publishes are present.",
                          "properties": {
                            "input": {
                              "type": "number"
                            },
                            "output": {
                              "type": "number"
                            },
                            "cache_read": {
                              "type": "number"
                            },
                            "cache_write_5m": {
                              "type": "number"
                            },
                            "cache_write_1h": {
                              "type": "number"
                            },
                            "batch_input": {
                              "type": "number"
                            },
                            "batch_output": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No such model",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/changes": {
      "get": {
        "summary": "The change feed — launches, retirements, coverage, and price moves when they happen",
        "operationId": "listChanges",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 1000
            },
            "description": "Capped at 50 without a Pro key, 1000 with one."
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "coverage",
                "new_model",
                "price_drop",
                "price_rise",
                "deprecation",
                "retirement",
                "spec_change",
                "status_change"
              ]
            },
            "description": "Filtering by kind or provider requires a Pro key."
          },
          {
            "name": "provider",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "example": "openai"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "pro": {
                      "type": "boolean"
                    },
                    "changes": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Filter requested without a Pro key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/history/{id}": {
      "get": {
        "summary": "Full observation series for one model — Pro only",
        "operationId": "getHistory",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "anthropic/claude-sonnet-5"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "model_id": {
                      "type": "string"
                    },
                    "points": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "metric": {
                            "type": "string"
                          },
                          "usd_per_mtok": {
                            "type": "number"
                          },
                          "observed_at": {
                            "type": "string"
                          },
                          "source_url": {
                            "type": "string",
                            "format": "uri"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Pro key required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No history recorded for this model",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/export.csv": {
      "get": {
        "summary": "The full observation history as CSV — Pro only",
        "operationId": "exportCsv",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "CSV file",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "402": {
            "description": "Pro key required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}