{"openapi":"3.1.0","info":{"title":"latestmodel.id API","version":"1.0.0","summary":"Resolve LLM model tags to current ids.","description":"Resolve LLM model tags to current ids. Stop hardcoding model strings — reference a tag like `smartest`, `cheapest`, `fastest` and we resolve it to the live model id at the provider you choose.","contact":{"name":"Maintainer (Rahul Verma)","url":"https://x.com/RahulVerma989"}},"servers":[{"url":"https://latestmodel.id","description":"Production"}],"tags":[{"name":"Resolve","description":"Pick the right model for a query."},{"name":"Catalog","description":"Browse the dataset."}],"paths":{"/v1/resolve":{"get":{"tags":["Resolve"],"summary":"Resolve a tag (or filter) to one or more model ids.","description":"Returns a `results[]` array, ordered by recommendation. `results[0]` is the top suggestion; the rest are alternates in order of preference. The shape is uniform regardless of scope (`provider=`, `aggregator=`, or unscoped) — caller code never branches on what was passed.\n\nAdd `format=string` to get plain text — only the top model id in the body and `X-Fallbacks` in the headers — perfect for one-line `fetch().then(r => r.text())` swaps.","parameters":[{"$ref":"#/components/parameters/Tag"},{"$ref":"#/components/parameters/Provider"},{"$ref":"#/components/parameters/Aggregator"},{"$ref":"#/components/parameters/Type"},{"$ref":"#/components/parameters/Status"},{"$ref":"#/components/parameters/ExcludeDeprecated"},{"$ref":"#/components/parameters/Family"},{"$ref":"#/components/parameters/Modality"},{"$ref":"#/components/parameters/Supports"},{"$ref":"#/components/parameters/MinContext"},{"$ref":"#/components/parameters/MaxContext"},{"$ref":"#/components/parameters/MinInputPrice"},{"$ref":"#/components/parameters/MaxInputPrice"},{"$ref":"#/components/parameters/MinOutputPrice"},{"$ref":"#/components/parameters/MaxOutputPrice"},{"$ref":"#/components/parameters/MinIntelligence"},{"$ref":"#/components/parameters/MinSpeed"},{"$ref":"#/components/parameters/Q"},{"$ref":"#/components/parameters/OpenaiCompatible"},{"$ref":"#/components/parameters/Format"},{"$ref":"#/components/parameters/Where"}],"responses":{"200":{"description":"Match found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveResponse"}},"text/plain; charset=utf-8":{"schema":{"type":"string","example":"claude-fable-5"}}}},"404":{"description":"No match.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/models":{"get":{"tags":["Catalog"],"summary":"List models matching the supplied filters.","parameters":[{"$ref":"#/components/parameters/Provider"},{"$ref":"#/components/parameters/Type"},{"$ref":"#/components/parameters/Status"},{"$ref":"#/components/parameters/ExcludeDeprecated"},{"$ref":"#/components/parameters/Family"},{"$ref":"#/components/parameters/Supports"},{"$ref":"#/components/parameters/MinContext"},{"$ref":"#/components/parameters/MaxInputPrice"},{"$ref":"#/components/parameters/MaxOutputPrice"},{"$ref":"#/components/parameters/Q"},{"name":"sort","in":"query","schema":{"type":"string","example":"performance.intelligence_index"},"description":"Dot-path field to sort by."},{"name":"order","in":"query","schema":{"type":"string","enum":["asc","desc"],"default":"desc"}},{"name":"limit","in":"query","schema":{"type":"integer","default":1000,"maximum":1000}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"Filtered list.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"models":{"type":"array","items":{"$ref":"#/components/schemas/Model"}},"total":{"type":"integer"},"scope":{"type":"object"}}},"meta":{"$ref":"#/components/schemas/Meta"},"errors":{"type":"array","items":{},"maxItems":0}}}}}}}}},"/v1/models/{id}":{"get":{"tags":["Catalog"],"summary":"One model by canonical id.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","example":"claude-fable-5"}}],"responses":{"200":{"description":"Found.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Model"},"meta":{"$ref":"#/components/schemas/Meta"},"errors":{"type":"array","items":{},"maxItems":0}}}}}},"404":{"description":"Not found.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/providers":{"get":{"tags":["Catalog"],"summary":"All providers (origins).","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"providers":{"type":"array","items":{"$ref":"#/components/schemas/ProviderInfo"}}}}}}}}}}}},"/v1/tags":{"get":{"tags":["Catalog"],"summary":"Available tags and their definitions.","responses":{"200":{"description":"OK"}}}}},"components":{"parameters":{"Tag":{"name":"tag","in":"query","schema":{"type":"string","enum":["smartest","cheapest","fastest","best_value","longest_context","cheapest_image_generation","cheapest_embedding","smartest_embedding","cheapest_tts","cheapest_stt"]},"description":"Tag whose ranking decides the order. Examples: `smartest`, `cheapest`, `fastest`, `best_value`, `longest_context`. Full list at `/v1/tags`.","example":"smartest"},"Provider":{"name":"provider","in":"query","schema":{"type":"string","enum":["anthropic","deepseek","google","groq","mistral","openai","xai"]},"description":"Pin to one provider — returns a model id formatted for that provider's own SDK."},"Aggregator":{"name":"aggregator","in":"query","schema":{"type":"string","enum":["aws-bedrock","azure","fireworks","gcp-vertex","openrouter","together"]},"description":"Pin to one aggregator (OpenRouter, AWS Bedrock, …) — returns the aggregator-formatted id."},"Type":{"name":"type","in":"query","schema":{"type":"string","enum":["chat","reasoning","embedding","image_generation","vision","tts","stt","video_generation","code"]}},"Status":{"name":"status","in":"query","schema":{"type":"string","example":"ga,preview"},"description":"Comma-separated allowed statuses (preview, beta, ga, deprecated, retired, suspended). When set, overrides the default exclusion. Default (no param): excludes `retired`, `suspended`, and `deprecated`. `suspended` = temporarily unavailable (e.g. regulatory order) — request it explicitly to surface such models."},"ExcludeDeprecated":{"name":"exclude_deprecated","in":"query","schema":{"type":"boolean","default":true},"description":"When `true` (default), deprecated models are hidden from results. Set `false` to include deprecated models alongside GA/preview ones. Has no effect when `status=` is explicitly set."},"Family":{"name":"family","in":"query","schema":{"type":"string"}},"Modality":{"name":"modality","in":"query","schema":{"type":"string","example":"text+image"},"description":"Comma- or plus-separated input modalities. All listed must be supported."},"Supports":{"name":"supports","in":"query","schema":{"type":"string","example":"tools,vision,structured_output"},"description":"Comma-separated capability flags. All listed must be true."},"MinContext":{"name":"min_context","in":"query","schema":{"type":"integer","minimum":0,"example":100000},"description":"Minimum context window in tokens."},"MaxContext":{"name":"max_context","in":"query","schema":{"type":"integer","minimum":0}},"MinInputPrice":{"name":"min_input_price","in":"query","schema":{"type":"number","minimum":0,"example":0.5},"description":"Minimum input price in USD per million tokens. Floats accepted."},"MaxInputPrice":{"name":"max_input_price","in":"query","schema":{"type":"number","minimum":0,"example":5},"description":"Maximum input price in USD per million tokens. Floats accepted."},"MinOutputPrice":{"name":"min_output_price","in":"query","schema":{"type":"number","minimum":0}},"MaxOutputPrice":{"name":"max_output_price","in":"query","schema":{"type":"number","minimum":0}},"MinIntelligence":{"name":"min_intelligence","in":"query","schema":{"type":"number","minimum":0,"maximum":100,"example":70},"description":"Minimum aggregate intelligence_index (0–100)."},"MinSpeed":{"name":"min_speed","in":"query","schema":{"type":"number","minimum":0},"description":"Minimum tokens-per-second."},"Q":{"name":"q","in":"query","schema":{"type":"string"},"description":"Free-text search across id, display_name, family, description."},"OpenaiCompatible":{"name":"openai_compatible","in":"query","schema":{"type":"boolean"},"description":"Limit to models reachable via an OpenAI-compatible endpoint."},"Format":{"name":"format","in":"query","schema":{"type":"string","enum":["json","string"],"default":"json"},"description":"`string` returns the top model id as plain text; alternatives in `X-Fallbacks` header."},"Where":{"name":"where","in":"query","schema":{"type":"string"},"description":"Raw expression DSL escape hatch — e.g. `pricing.input_per_mtok < 5 && capabilities.vision == true`."}},"schemas":{"Meta":{"type":"object","properties":{"version":{"type":"string"},"as_of":{"type":"string","format":"date-time"},"request_id":{"type":"string"},"deprecated":{"type":"boolean"}}},"Problem":{"type":"object","properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"}},"required":["title","status"]},"ResolveResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"results":{"type":"array","description":"Ordered by recommendation — `results[0]` is the top suggestion. Same shape regardless of scope.","items":{"$ref":"#/components/schemas/Ranked"}},"tag":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"description":{"type":"string"}}},"scope":{"type":"object","properties":{"provider":{"type":"string"},"aggregator":{"type":"string"},"type":{"type":"string"}}},"total_candidates":{"type":"integer"}}},"meta":{"$ref":"#/components/schemas/Meta"},"errors":{"type":"array","items":{},"maxItems":0}}},"Ranked":{"type":"object","required":["model","endpoint","auth","routes"],"properties":{"model":{"$ref":"#/components/schemas/Model"},"endpoint":{"type":"string","format":"uri"},"auth":{"type":"object","properties":{"type":{"type":"string","enum":["header","bearer","aws_signature","oauth"]},"env_var":{"type":"string","example":"ANTHROPIC_API_KEY"},"header_name":{"type":"string"}}},"routes":{"type":"array","items":{"type":"object","properties":{"via":{"type":"string","example":"openrouter"},"endpoint":{"type":"string","format":"uri"},"model_id":{"type":"string","example":"anthropic/claude-opus-4-7"},"env_var":{"type":"string"},"auth":{"type":"object"}}}},"sdks":{"type":"object","additionalProperties":{"type":"object","properties":{"package":{"type":"string"},"model_id":{"type":"string"},"factory":{"type":"string"},"import":{"type":"string"}}}},"supported_params":{"type":"array","items":{"type":"string"}},"unsupported_params":{"type":"array","items":{"type":"string"}}}},"Model":{"type":"object","required":["id","provider","display_name","type","input_modalities","output_modalities","status","api"],"properties":{"id":{"type":"string","example":"claude-fable-5"},"provider":{"type":"string","example":"anthropic"},"family":{"type":"string"},"display_name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["chat","completion","reasoning","embedding","rerank","image_generation","image_edit","vision","tts","stt","audio_chat","video_generation","moderation","code"]},"input_modalities":{"type":"array","items":{"type":"string"}},"output_modalities":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["preview","beta","ga","deprecated","retired"]},"released":{"type":"string"},"deprecated_on":{"type":"string"},"sunset_on":{"type":"string"},"replacement_id":{"type":"string"},"limits":{"type":"object","additionalProperties":true,"description":"Flat summary used by tag DSL and the explorer table."},"pricing":{"type":"object","description":"Flat summary in USD. `input_per_mtok` and `output_per_mtok` are per million tokens; `per_million_characters` for TTS; `audio_input_per_minute` for STT.","additionalProperties":true},"modalities":{"type":"object","description":"Per-modality limits and pricing. Authoritative for accurate cost computation.","properties":{"input":{"type":"object","additionalProperties":true},"output":{"type":"object","additionalProperties":true}}},"capabilities":{"type":"object","additionalProperties":true},"performance":{"type":"object","properties":{"speed_tps":{"type":"number"},"ttft_ms":{"type":"number"},"intelligence_index":{"type":"number","minimum":0,"maximum":100},"arena_elo":{"type":"number"},"benchmarks":{"type":"object","additionalProperties":{"type":"number"}}}},"api":{"type":"object","properties":{"endpoint":{"type":"string","format":"uri"},"protocol":{"type":"string","enum":["anthropic","openai","openai_compat","gemini","cohere","rest"]},"openai_compatible":{"type":"boolean"},"auth":{"type":"object"},"sdks":{"type":"object","additionalProperties":true},"supported_params":{"type":"array","items":{"type":"string"}},"unsupported_params":{"type":"array","items":{"type":"string"}}}},"aggregator_ids":{"type":"object","additionalProperties":{"type":"string"}},"manual_tags":{"type":"array","items":{"type":"string"}}}},"ProviderInfo":{"type":"object","properties":{"provider":{"type":"string"},"display_name":{"type":"string"},"homepage":{"type":"string","format":"uri"},"docs":{"type":"string","format":"uri"},"pricing_page":{"type":"string","format":"uri"},"model_count":{"type":"integer"}}}}}}