{"openapi":"3.1.0","info":{"title":"InferenceList API","version":"0.2.0","description":"Public catalog of inference providers, models, and prices. The Worker also serves HTML explore pages. Prices can be approximate. Each price has a confidence value: official, scraped, manual, or seed. A daily UTC cron writes one price_history row per model, unit, and date.","contact":{"url":"https://inferencelist.theserverless.dev"}},"servers":[{"url":"https://inferencelist.theserverless.dev","description":"Public custom domain"},{"url":"/","description":"Current origin (local wrangler dev or workers.dev)"}],"paths":{"/":{"get":{"summary":"Product home (HTML)","description":"Search, modality filters, featured providers, last snapshot time.","responses":{"200":{"description":"HTML home page"}}}},"/providers":{"get":{"summary":"Provider index (HTML)","responses":{"200":{"description":"HTML list of providers"}}}},"/providers/{id}":{"get":{"summary":"Provider detail (HTML)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"HTML provider page with models, prices, and history"}}}},"/models":{"get":{"summary":"Model explorer (HTML)","parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"provider","in":"query","schema":{"type":"string"}},{"name":"modality","in":"query","schema":{"type":"string","enum":["text","image","video","audio"]}},{"name":"sort","in":"query","schema":{"type":"string","enum":["name","provider","context","price"]}},{"name":"order","in":"query","schema":{"type":"string","enum":["asc","desc"]}}],"responses":{"200":{"description":"HTML model explorer"}}}},"/models/{id}":{"get":{"summary":"Model detail (HTML)","description":"Current price plus a history chart and table.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"openai/gpt-5.6-terra"}],"responses":{"200":{"description":"HTML model page"}}}},"/pricing":{"get":{"summary":"Pricing explorer (HTML)","responses":{"200":{"description":"HTML pricing table"}}}},"/compare":{"get":{"summary":"Compare 2–4 models (HTML)","parameters":[{"name":"ids","in":"query","schema":{"type":"string"},"description":"Repeat the parameter or use a comma-separated list."}],"responses":{"200":{"description":"HTML comparison"}}}},"/health":{"get":{"summary":"Liveness","responses":{"200":{"description":"Worker is up","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}}}}},"/openapi.json":{"get":{"summary":"OpenAPI document","responses":{"200":{"description":"This OpenAPI 3.1 document"}}}},"/v1/providers":{"get":{"summary":"List providers","description":"Edge-cached via caches.default. Pass ?fresh=1 or Cache-Control: no-cache to bypass.","parameters":[{"name":"fresh","in":"query","schema":{"type":"string","enum":["1"]},"description":"Bypass edge Cache API"}],"responses":{"200":{"description":"All catalog providers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderList"}}}}}}},"/v1/providers/{id}":{"get":{"summary":"Get one provider and its models","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"openai"}],"responses":{"200":{"description":"Provider detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderDetail"}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/v1/search":{"get":{"summary":"Search providers and models","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"fresh","in":"query","schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"Matching providers and models","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResult"}}}},"400":{"$ref":"#/components/responses/BadRequest"}}}},"/v1/models":{"get":{"summary":"List models","description":"Edge-cached via caches.default (browser 5m, CDN/Cache API 30m). List payloads also snapshot in KV for 1 hour. Daily sync increments a cache generation and busts both layers. Pass ?fresh=1 or Cache-Control: no-cache to bypass.","parameters":[{"name":"provider","in":"query","schema":{"type":"string"},"description":"Filter by provider id"},{"name":"modality","in":"query","schema":{"type":"string","enum":["text","image","video","audio"]}},{"name":"q","in":"query","schema":{"type":"string"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["name","provider","context","price"]}},{"name":"order","in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"fresh","in":"query","schema":{"type":"string","enum":["1"]},"description":"Bypass edge Cache API and KV snapshot caches"}],"responses":{"200":{"description":"Model list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelList"}}}},"400":{"$ref":"#/components/responses/BadRequest"}}}},"/v1/models/{id}":{"get":{"summary":"Get one model with prices","description":"Model ids are `provider/slug` and may contain slashes. Prefer the unsplitting path, e.g. /v1/models/openai/gpt-5.6-terra.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"openai/gpt-5.6-terra"}],"responses":{"200":{"description":"Model detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelDetail"}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/v1/models/{id}/history":{"get":{"summary":"Daily price history for one model","description":"One snapshot per UTC date and unit. The first row is the migration backfill or the first cron run.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"openai/gpt-5.6-terra"},{"name":"unit","in":"query","schema":{"type":"string"},"example":"token"}],"responses":{"200":{"description":"History points","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HistoryList"}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/v1/pricing":{"get":{"summary":"List prices","description":"Token prices use input_per_1m_usd / output_per_1m_usd. Media prices use flat_usd plus a unit such as image, second_video, character_audio, minute_audio, or request. Edge-cached via caches.default; list payloads also snapshot in KV. Pass ?fresh=1 or Cache-Control: no-cache to bypass.","parameters":[{"name":"model","in":"query","schema":{"type":"string"},"example":"openai/gpt-5.6-terra"},{"name":"provider","in":"query","schema":{"type":"string"},"example":"fal"},{"name":"unit","in":"query","schema":{"type":"string"}},{"name":"fresh","in":"query","schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"Price rows","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}}}}},"/v1/changes":{"get":{"summary":"Daily price diffs","description":"Compares consecutive UTC snapshots. Default `since` is 7 days before today. A first-day catalog has no diffs.","parameters":[{"name":"since","in":"query","schema":{"type":"string","format":"date"},"description":"UTC date YYYY-MM-DD. Inclusive."}],"responses":{"200":{"description":"Price changes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeList"}}}},"400":{"$ref":"#/components/responses/BadRequest"}}}}},"components":{"schemas":{"Health":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean"},"service":{"type":"string"}}},"Provider":{"type":"object","required":["id","name","categories"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"website":{"type":["string","null"]},"categories":{"type":"array","items":{"type":"string"}},"docs_url":{"type":["string","null"]},"notes":{"type":["string","null"]}}},"Model":{"type":"object","required":["id","provider_id","name","modalities","status"],"properties":{"id":{"type":"string"},"provider_id":{"type":"string"},"name":{"type":"string"},"modalities":{"type":"array","items":{"type":"string"}},"context_window":{"type":["integer","null"]},"family":{"type":["string","null"]},"status":{"type":"string"}}},"Price":{"type":"object","required":["model_id","unit","currency","effective_at"],"properties":{"id":{"type":"integer"},"model_id":{"type":"string"},"provider_id":{"type":"string"},"unit":{"type":"string","description":"token | image | second_video | character_audio | minute_audio | request | …"},"input_per_1m_usd":{"type":["number","null"]},"output_per_1m_usd":{"type":["number","null"]},"flat_usd":{"type":["number","null"]},"currency":{"type":"string"},"effective_at":{"type":"string"},"source_url":{"type":["string","null"]},"notes":{"type":["string","null"]},"last_verified_at":{"type":["string","null"]},"source":{"type":["string","null"]},"confidence":{"type":["string","null"],"enum":["official","scraped","manual","seed",null]}}},"HistoryPoint":{"type":"object","required":["model_id","as_of_date","unit","currency","recorded_at"],"properties":{"model_id":{"type":"string"},"as_of_date":{"type":"string","format":"date"},"unit":{"type":"string"},"input_per_1m_usd":{"type":["number","null"]},"output_per_1m_usd":{"type":["number","null"]},"flat_usd":{"type":["number","null"]},"currency":{"type":"string"},"source":{"type":["string","null"]},"confidence":{"type":["string","null"]},"notes":{"type":["string","null"]},"recorded_at":{"type":"string"}}},"PriceChange":{"type":"object","required":["model_id","as_of_date","unit","previous","current","delta"],"properties":{"model_id":{"type":"string"},"provider_id":{"type":"string"},"model_name":{"type":"string"},"as_of_date":{"type":"string"},"unit":{"type":"string"},"previous":{"type":["object","null"]},"current":{"type":"object"},"delta":{"type":"object"}}},"CacheMeta":{"type":"object","properties":{"approximate":{"type":"boolean"},"cached":{"type":"boolean"},"cache_ttl_seconds":{"type":"integer"},"since":{"type":"string"}}},"ProviderList":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Provider"}}}},"ProviderDetail":{"type":"object","required":["data"],"properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Provider"},{"type":"object","properties":{"models":{"type":"array","items":{"$ref":"#/components/schemas/Model"}}}}]}}},"ModelList":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Model"}},"meta":{"$ref":"#/components/schemas/CacheMeta"}}},"ModelDetail":{"type":"object","required":["data"],"properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Model"},{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/Provider"},"prices":{"type":"array","items":{"$ref":"#/components/schemas/Price"}}}}]}}},"PriceList":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Price"}},"meta":{"$ref":"#/components/schemas/CacheMeta"}}},"SearchResult":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"models":{"type":"array","items":{"$ref":"#/components/schemas/Model"}},"providers":{"type":"array","items":{"$ref":"#/components/schemas/Provider"}}}},"meta":{"$ref":"#/components/schemas/CacheMeta"}}},"HistoryList":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"model_id":{"type":"string"},"unit":{"type":["string","null"]},"points":{"type":"array","items":{"$ref":"#/components/schemas/HistoryPoint"}}}}}},"ChangeList":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PriceChange"}},"meta":{"$ref":"#/components/schemas/CacheMeta"}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}},"responses":{"NotFound":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"BadRequest":{"description":"Invalid query","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}