{
  "openapi": "3.1.1",
  "info": {
    "title": "AI Model Compatibility Explorer API",
    "version": "1.0.0",
    "summary": "Which LLMs take images, audio or files, fit your context and support tools or structured outputs?",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://aimodelcompatibilityexplorer.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Which LLMs take images, audio or files, fit your context and support tools or structured outputs?",
        "description": "Filters and compares hundreds of language models by input modalities (image, audio, file, video), output modality, context window, maximum output tokens and API features such as tools, tool_choice, structured_outputs, response_format and reasoning, using OpenRouter's public models API (or a pasted copy of it). Shows matching models with prices, near misses with what they lack, and recommendations.\n\nMethodology:\n- Live mode reads GET https://openrouter.ai/api/v1/models (public, no key). Fields used: architecture.input_modalities/output_modalities, context_length, top_provider.max_completion_tokens, supported_parameters and pricing (USD per token, shown per 1M tokens).\n- A model matches when it has every required input modality, the required output modality, at least the minimum context and output tokens, and every required API parameter listed in supported_parameters.\n- Near misses are models (matching the name filter) that lack exactly one requirement.\n- Recommendations: cheapest by input price, largest context and broadest feature set among the matches. Prices are for the routed provider listed by OpenRouter, not necessarily the vendor's own API.",
        "tags": [
          "ai-infra"
        ],
        "x-mcp-tool": "ai_model_compatibility_explorer",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiModelCompatibilityExplorerInput"
              },
              "examples": {
                "example1": {
                  "summary": "Vision + tools + structured outputs, ≥128k context (OpenRouter snapshot 2026-10-14)",
                  "value": {
                    "source": "paste",
                    "modelsJson": "{\"data\":[{\"id\":\"openai/gpt-4o-mini\",\"name\":\"OpenAI: GPT-4o-mini\",\"context_length\":128000,\"architecture\":{\"input_modalities\":[\"text\",\"image\",\"file\"],\"output_modalities\":[\"text\"]},\"pricing\":{\"prompt\":\"0.00000015\",\"completion\":\"0.0000006\",\"input_cache_read\":\"0.000000075\"},\"top_provider\":{\"context_length\":128000,\"max_completion_tokens\":16384},\"supported_parameters\":[\"frequency_penalty\",\"logit_bias\",\"logprobs\",\"max_completion_tokens\",\"max_tokens\",\"prediction\",\"presence_penalty\",\"response_format\",\"seed\",\"stop\",\"structured_outputs\",\"temperature\",\"tool_choice\",\"tools\",\"top_logprobs\",\"top_p\",\"web_search_options\"]},{\"id\":\"google/gemini-2.5-flash\",\"name\":\"Google: Gemini 2.5 Flash\",\"context_length\":1048576,\"architecture\":{\"input_modalities\":[\"file\",\"image\",\"text\",\"audio\",\"video\"],\"output_modalities\":[\"text\"]},\"pricing\":{\"prompt\":\"0.0000003\",\"completion\":\"0.0000025\",\"input_cache_read\":\"0.00000003\",\"input_cache_write\":\"0.0000000833333333333333\"},\"top_provider\":{\"context_length\":1048576,\"max_completion_tokens\":65535},\"supported_parameters\":[\"include_reasoning\",\"max_tokens\",\"reasoning\",\"response_format\",\"seed\",\"stop\",\"structured_outputs\",\"temperature\",\"tool_choice\",\"tools\",\"top_p\"]},{\"id\":\"anthropic/claude-sonnet-4\",\"name\":\"Anthropic: Claude Sonnet 4\",\"context_length\":200000,\"architecture\":{\"input_modalities\":[\"image\",\"text\",\"file\"],\"output_modalities\":[\"text\"]},\"pricing\":{\"prompt\":\"0.000003\",\"completion\":\"0.000015\",\"input_cache_read\":\"0.0000003\",\"input_cache_write\":\"0.00000375\"},\"top_provider\":{\"context_length\":200000,\"max_completion_tokens\":64000},\"supported_parameters\":[\"include_reasoning\",\"max_tokens\",\"reasoning\",\"stop\",\"temperature\",\"tool_choice\",\"tools\",\"top_k\",\"top_p\"]},{\"id\":\"meta-llama/llama-3.3-70b-instruct\",\"name\":\"Meta: Llama 3.3 70B Instruct\",\"context_length\":131072,\"architecture\":{\"input_modalities\":[\"text\"],\"output_modalities\":[\"text\"]},\"pricing\":{\"prompt\":\"0.00000059\",\"completion\":\"0.00000079\",\"input_cache_read\":\"0.000000295\"},\"top_provider\":{\"context_length\":131072,\"max_completion_tokens\":32768},\"supported_parameters\":[\"frequency_penalty\",\"logit_bias\",\"logprobs\",\"max_tokens\",\"min_p\",\"presence_penalty\",\"repetition_penalty\",\"response_format\",\"seed\",\"stop\",\"structured_outputs\",\"temperature\",\"tool_choice\",\"tools\",\"top_k\",\"top_logprobs\",\"top_p\"]},{\"id\":\"deepseek/deepseek-chat-v3.1\",\"name\":\"DeepSeek: DeepSeek V3.1\",\"context_length\":163840,\"architecture\":{\"input_modalities\":[\"text\"],\"output_modalities\":[\"text\"]},\"pricing\":{\"prompt\":\"0.00000025\",\"completion\":\"0.00000095\",\"input_cache_read\":\"0.00000013\"},\"top_provider\":{\"context_length\":163840,\"max_completion_tokens\":32768},\"supported_parameters\":[\"frequency_penalty\",\"include_reasoning\",\"logit_bias\",\"logprobs\",\"max_tokens\",\"min_p\",\"presence_penalty\",\"reasoning\",\"repetition_penalty\",\"response_format\",\"seed\",\"stop\",\"structured_outputs\",\"temperature\",\"tool_choice\",\"tools\",\"top_k\",\"top_logprobs\",\"top_p\"]},{\"id\":\"mistralai/mistral-small-3.2-24b-instruct\",\"name\":\"Mistral: Mistral Small 3.2 24B\",\"context_length\":256000,\"architecture\":{\"input_modalities\":[\"image\",\"text\"],\"output_modalities\":[\"text\"]},\"pricing\":{\"prompt\":\"0.00000009375\",\"completion\":\"0.00000025\"},\"top_provider\":{\"context_length\":256000,\"max_completion_tokens\":16384},\"supported_parameters\":[\"frequency_penalty\",\"logit_bias\",\"logprobs\",\"max_tokens\",\"min_p\",\"presence_penalty\",\"repetition_penalty\",\"response_format\",\"seed\",\"stop\",\"structured_outputs\",\"temperature\",\"tool_choice\",\"tools\",\"top_k\",\"top_logprobs\",\"top_p\"]}]}",
                    "inputModalities": [
                      "image"
                    ],
                    "minContext": 128000,
                    "parameters": [
                      "tools",
                      "structured_outputs"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiModelCompatibilityExplorerResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "AiModelCompatibilityExplorerInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "source": {
            "title": "Model data",
            "type": "string",
            "enum": [
              "live",
              "paste"
            ],
            "default": "live"
          },
          "modelsJson": {
            "title": "Models JSON",
            "description": "Response of GET https://openrouter.ai/api/v1/models (or a subset).",
            "type": "string",
            "maxLength": 3000000
          },
          "search": {
            "title": "Name / provider contains",
            "type": "string",
            "maxLength": 100
          },
          "inputModalities": {
            "title": "Required input types (besides text)",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "image",
                "audio",
                "file",
                "video"
              ]
            },
            "default": []
          },
          "outputModality": {
            "title": "Required output",
            "type": "string",
            "enum": [
              "any",
              "text",
              "image",
              "audio"
            ],
            "default": "text"
          },
          "minContext": {
            "title": "Minimum context window",
            "type": "integer",
            "minimum": 0,
            "maximum": 100000000,
            "x-unit": "tokens"
          },
          "minOutputTokens": {
            "title": "Minimum max output",
            "type": "integer",
            "minimum": 0,
            "maximum": 10000000,
            "x-unit": "tokens"
          },
          "parameters": {
            "title": "Required API features",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "tools",
                "tool_choice",
                "parallel_tool_calls",
                "structured_outputs",
                "response_format",
                "reasoning",
                "include_reasoning",
                "seed",
                "logprobs",
                "stop",
                "temperature",
                "web_search_options"
              ]
            },
            "default": []
          },
          "sort": {
            "title": "Sort by",
            "type": "string",
            "enum": [
              "price",
              "context",
              "name"
            ],
            "default": "price"
          },
          "maxResults": {
            "title": "Maximum models shown",
            "type": "integer",
            "minimum": 1,
            "maximum": 200,
            "default": 30
          }
        },
        "required": []
      },
      "AiModelCompatibilityExplorerResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "dataSource",
              "totalModels",
              "matching",
              "models",
              "nearMisses",
              "recommendations"
            ],
            "properties": {
              "dataSource": {
                "type": "string"
              },
              "totalModels": {
                "type": "integer"
              },
              "matching": {
                "type": "integer"
              },
              "models": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "name",
                    "contextLength",
                    "maxOutputTokens",
                    "inputModalities",
                    "outputModalities",
                    "features",
                    "inputPerM",
                    "outputPerM",
                    "cacheReadPerM"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "contextLength": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "maxOutputTokens": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "inputModalities": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "outputModalities": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "features": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Supported API parameters from the tracked list."
                    },
                    "inputPerM": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "outputPerM": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "cacheReadPerM": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  }
                }
              },
              "nearMisses": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "missing"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              },
              "recommendations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "label",
                    "id",
                    "reason"
                  ],
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}