View Source LlmComposer.Cost.Fetchers.ModelsDev (llm_composer v0.13.0)

models.dev-specific pricing fetcher for OpenAI and Google providers.

Fetches pricing information from the models.dev API dataset for OpenAI and Google models. Uses 24-hour caching to minimize API calls and improve performance.

Supported Providers

  • :open_ai - OpenAI models (GPT series)
  • :google - Google Gemini models

Implementation Notes

models.dev provides a single consolidated dataset (api.json) containing pricing for multiple providers. The entire dataset is cached to avoid repeated downloads.

Summary

Functions

Link to this function

fetch_pricing(provider, model)

View Source
@spec fetch_pricing(atom(), String.t()) :: map() | nil