LlmComposer.Cost.Fetchers.OpenRouter (llm_composer v0.19.4)

Copy Markdown View Source

OpenRouter-specific pricing fetcher.

Fetches pricing information from OpenRouter's models API for the specified model and provider combination. Uses 24-hour caching to minimize API calls.

Implementation Notes

OpenRouter's pricing API requires both model and provider parameters because the same model can be served by different providers with different pricing.

Summary

Functions

fetch_pricing(body)

@spec fetch_pricing(map()) :: map() | nil