Skip to content

Mistral: record usage.service_tier as metadata #867

Description

Mistral usage responses include a string service_tier field (models/usageinfo_dollar_defs.py; present in 2.x and 3.0.0). _parse_usage_metrics in py/src/braintrust/integrations/mistral/tracing.py only keeps numeric values, so it's dropped.

Proposal

  • Add service_tier to _CHAT_METADATA_KEYS and _AGENTS_METADATA_KEYS so the request option is logged.
  • Record usage.service_tier from the response as metadata.
  • Read with getattr so 1.12.4 is unaffected.

Parent: #858 (found while reviewing the 2026-10-05 weekly dependency update, #849).

🤖 Generated with Claude Code

Metadata

Metadata

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions