{"record":{"id":"ad13d3f3988f0153","repo":"BerriAI/litellm","slug":"no-pricing-information-found-for-model-model-tr","errorCode":null,"errorMessage":"No pricing information found for model {model}. Tried checking {models_to_check}","messagePattern":"No pricing information found for model (.+?)\\. Tried checking (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/cost_calculator.py","lineNumber":2023,"sourceCode":"        model_without_provider,\n        model,\n        model_name_without_custom_llm_provider,\n    ]\n    for _model in models_to_check:\n        if _model is not None and _model in litellm.model_cost:\n            cost_info = litellm.model_cost[_model]\n            break\n    if cost_info is None:\n        raise Exception(f\"Model not found in cost map. Tried checking {models_to_check}\")\n\n    # Priority 1: Use per-image pricing if available (for gpt-image-1 and similar models)\n    if \"input_cost_per_image\" in cost_info and cost_info[\"input_cost_per_image\"] is not None:\n        return cost_info[\"input_cost_per_image\"] * n\n    # Priority 2: Fall back to per-pixel pricing for backward compatibility\n    elif \"input_cost_per_pixel\" in cost_info and cost_info[\"input_cost_per_pixel\"] is not None:\n        return cost_info[\"input_cost_per_pixel\"] * height * width * n\n    else:\n        raise Exception(f\"No pricing information found for model {model}. Tried checking {models_to_check}\")\n\n\ndef default_video_cost_calculator(\n    model: str,\n    duration_seconds: float,\n    custom_llm_provider: str | None = None,\n    model_info: ModelInfo | None = None,\n    video_resolution: str | None = None,\n) -> float:\n    \"\"\"\n    Default video cost calculator for video generation\n\n    Args:\n        model (str): Model name\n        duration_seconds (float): Duration of the generated video in seconds\n        custom_llm_provider (Optional[str]): Custom LLM provider\n        model_info (Optional[ModelInfo]): Deployment-level model info containing\n            custom video pricing. When provided, used before falling back to","sourceCodeStart":2005,"sourceCodeEnd":2041,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/cost_calculator.py#L2005-L2041","documentation":"Raised in the same default_image_cost_calculator after a model entry WAS found in litellm.model_cost, but the entry contains neither input_cost_per_image (priority 1) nor input_cost_per_pixel (priority 2). litellm's image calculator only understands per-image or per-pixel pricing; an entry with only token-based fields (input_cost_per_token) cannot be used, so it raises. The generated image itself was returned successfully; only the cost calculation fails.","triggerScenarios":"A litellm.register_model / proxy model_info entry for an image model that defines only token pricing (input_cost_per_token) or no pricing fields at all; a model name that collides with a text-model entry in the pricing map (found, but the entry has no image keys); hand-edited model_prices_and_context_window.json files missing the image cost fields.","commonSituations":"Teams copy-pasting a text-model pricing template into register_model for an image model; proxy deployments that set cost per token for image endpoints; partial custom pricing JSON files that list the model but omit the image-specific keys.","solutions":["Extend the model's cost entry with input_cost_per_image (preferred): litellm.register_model({\"<model>\": {\"input_cost_per_image\": 0.02, \"mode\": \"image_generation\"}}).","If you must use legacy per-pixel pricing, set input_cost_per_pixel instead — the calculator multiplies it by height*width*n.","Verify the matched entry is not a same-named text model; rename the image model or fix the entry so token-only pricing is not silently reused.","Upgrade litellm — a newer pricing file may add per-image pricing for the model."],"exampleFix":"# before: entry exists but only has token pricing -> \"No pricing information found\"\nlitellm.register_model({\"my-image-model\": {\"input_cost_per_token\": 0.00001}})\n\n# after: image-model pricing keys the calculator understands\nlitellm.register_model({\n    \"my-image-model\": {\n        \"input_cost_per_image\": 0.02,\n        \"mode\": \"image_generation\",\n    }\n})","handlingStrategy":"validation","validationCode":"import litellm\n\ndef ensure_image_cost_fields(model: str) -> None:\n    \"\"\"Raise before the call unless the model's entry has per-image or per-pixel pricing.\"\"\"\n    entry = litellm.model_cost.get(model) or litellm.model_cost.get(model.split(\"/\")[-1])\n    if entry is None or (entry.get(\"input_cost_per_image\") is None and entry.get(\"input_cost_per_pixel\") is None):\n        raise ValueError(\n            f\"{model!r} lacks input_cost_per_image/input_cost_per_pixel; \"\n            \"litellm.register_model with input_cost_per_image before calling.\"\n        )","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When registering image models, always include input_cost_per_image (or input_cost_per_pixel) — token keys alone are ignored.","Never reuse a text-model pricing template verbatim for image models.","Log the matched litellm.model_cost entry in dev builds to confirm which key was found."],"tags":["image-generation","cost-tracking","pricing","model-registry"],"backgroundTag":"model-pricing-not-found","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}