Skip to content

[Feature]: Azure LLM calls cannot be costed — need a cost policy for Azure OpenAI and Azure AI Foundry #3189

Description

@Irash-Perera

Please select the area the issue is related to

Gateway Operator

Please select the aspect the issue is related to

Aspect/Monitoring (Metrics, observability, health checks, alerts)

Suggested Feature

The llm-cost policy has provider calculators for OpenAI, Anthropic, Gemini, Mistral and AWS Bedrock, but none for Azure. A request to an Azure OpenAI or Azure AI Foundry backend therefore resolves no calculator and records a cost of 0.

The effect is that any deployment fronting Azure models has no per-request cost. There is no spend attribution in analytics, and cost-based rate limiting cannot be used on those routes at all.

Azure also does not fit the assumptions the existing calculators make, so this needs its own policy rather than another branch of llm-cost. Azure prices by deployment rather than by model, and on several endpoints the response reports only the deployment name, which matches no pricing key. It keeps separate pricing catalogs for Azure OpenAI and Foundry models, varies rates by deployment type without reporting which one served the request, and returns token usage in several different shapes depending on the endpoint and model family.

What is needed is a cost policy for Azure OpenAI and Azure AI Foundry that prices requests from the token usage in the response and publishes the result the same way llm-cost does, so analytics and cost-based rate limiting work unchanged.

Related Issues

No response

Steps to Verify

  • Design Document — A detailed design document has been created and reviewed, covering architecture, data flow, and edge cases.
  • Design Mail — A design summary email has been sent to relevant stakeholders for awareness and feedback.
  • Code Review — All code changes have been peer-reviewed and approved according to the project's review standards.
  • Testing Complete — Adequate unit, integration, and/or end-to-end tests have been written and are passing.
  • Documentation Review — User-facing and/or developer documentation has been updated to reflect the new feature and reviewed.
  • Feature Complete — The feature is fully implemented, all checklist items above are done, and it is ready for release.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions