Skip to content

Conversation

@krrishdholakia
Copy link
Contributor

Title

Implement FOCUS (FinOps Open Cost & Usage Specification) Data Export

Relevant issues

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🆕 New Feature
✅ Test
📖 Documentation

Changes

This PR introduces support for exporting LiteLLM cost and usage data in FOCUS (FinOps Open Cost & Usage Specification) format. This enables users to integrate LiteLLM spend data with various FinOps tools that consume the FOCUS standard, such as APTIO.

Key changes include:

  • New litellm/integrations/focus/ module: Contains logic for database interaction, data transformation to FOCUS format, and export functionality (JSON, CSV).
  • New API Endpoints:
    • POST /focus/export: Exports usage data as JSON.
    • POST /focus/export/csv: Exports usage data as CSV.
    • POST /focus/dry-run: Provides a preview of the export without side effects.
    • GET /focus/schema: Returns documentation about the FOCUS columns.
  • Documentation: Added a new page docs/my-website/docs/observability/focus.md detailing the setup, API endpoints, and FOCUS column mapping.
  • Unit Tests: Comprehensive tests for the FOCUS exporter and transformer.

Slack Thread

Open in Cursor Open in Web

Add support for exporting LiteLLM cost and usage data in FOCUS
(FinOps Open Cost & Usage Specification) format, an open standard
for cost data interoperability supported by the FinOps Foundation.

This enables customers to export cost data to FinOps tools like
APTIO for cost tracking and analysis.

New endpoints:
- POST /focus/export - Export as JSON
- POST /focus/export/csv - Export as CSV
- POST /focus/dry-run - Test export without side effects
- GET /focus/schema - Get FOCUS schema documentation

FOCUS columns include:
- BilledCost, BillingPeriodStart/End
- ChargeCategory, ChargeClass, ChargeDescription
- ConsumedQuantity, ConsumedUnit
- ProviderName, PublisherName
- ResourceId, ResourceName, ResourceType
- ServiceCategory, ServiceName
- SubAccountId (team_id), SubAccountName (team_alias)
- Tags with LiteLLM-specific metadata
@cursor
Copy link

cursor bot commented Dec 9, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel
Copy link

vercel bot commented Dec 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
litellm Ready Ready Preview Comment Dec 9, 2025 5:10pm

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants