{"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":2019,"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":2001,"sourceCodeEnd":2037,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/cost_calculator.py#L2001-L2037","documentation":"The image model WAS found in the cost map, but its entry has neither input_cost_per_image nor input_cost_per_pixel, so LiteLLM cannot compute an image-generation cost and raises this Exception. It distinguishes 'known model, incomplete pricing' from error 237's 'unknown model'.","triggerScenarios":"A model_cost entry for the image model exists but lacks both pricing keys — e.g. registered with only token pricing, or a provider's text-model entry matched the image request's model name.","commonSituations":"register_model calls that copy LLM token pricing for an image model; model name collisions where a chat model shares the image model's name; partially populated custom cost maps.","solutions":["Add input_cost_per_image (preferred) or input_cost_per_pixel to the model's entry via litellm.register_model.","Check what entry matched: print litellm.model_cost[model] and inspect its pricing keys.","Register a distinct model id for image generation so it doesn't collide with a text-model entry.","Update LiteLLM in case upstream pricing keys changed naming."],"exampleFix":"# before\nlitellm.register_model({\"my-img\": {\"input_cost_per_token\": 0.00001}})  # no image pricing\n\n# after\nlitellm.register_model({\"my-img\": {\"input_cost_per_image\": 0.02}})","handlingStrategy":"validation","validationCode":"info = litellm.model_cost.get(model) or litellm.model_cost.get(model.split(\"/\")[-1])\nif info and not (info.get(\"input_cost_per_image\") or info.get(\"input_cost_per_pixel\")):\n    litellm.register_model({model: {**info, \"input_cost_per_image\": fallback}})","typeGuard":"def has_image_pricing(model: str) -> bool:\n    info = litellm.model_cost.get(model) or litellm.model_cost.get(model.split(\"/\")[-1])\n    return bool(info and (info.get(\"input_cost_per_image\") is not None or info.get(\"input_cost_per_pixel\") is not None))","tryCatchPattern":"try:\n    cost = litellm.completion_cost(completion_response=resp, model=model)\nexcept Exception as e:\n    if \"No pricing information found\" in str(e):\n        litellm.register_model({model: {\"input_cost_per_image\": fallback_price}})\n        cost = litellm.completion_cost(completion_response=resp, model=model)\n    else:\n        raise","preventionTips":["Give image-generation deployments their own model id with image pricing keys.","When registering models programmatically, include input_cost_per_image explicitly.","Inspect litellm.model_cost[model] after registration to confirm pricing keys exist."],"tags":["litellm","cost-calculation","image-generation","pricing-data"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}