Monitor API Usage and Costs
Learn how to track your Eden AI API consumption and costs using the Cost Monitoring endpoints.Note: These are admin/dashboard endpoints typically used by the Eden AI dashboard or custom admin interfaces. For standard API usage authentication, see the Authentication Guide.
Overview
The Cost Monitoring API provides two key endpoints to help you track and manage your Eden AI spending:- Monitor Consumptions - Get detailed usage and cost breakdowns by date, provider, and feature
- Check Credits - Retrieve your current account credit balance
Endpoints
Monitor Consumptions
Check Current Credits
Key Concepts
Step Parameter
Thestep parameter controls how data is aggregated:
| Step Value | Aggregation Period | Use Case |
|---|---|---|
| 1 | Daily | Detailed daily analysis |
| 2 | Weekly | Weekly trends |
| 3 | Monthly | Monthly reports |
| 4 | Yearly | Annual summaries |
Date Ranges
- Dates must be in
YYYY-MM-DDformat - Both
beginandenddates are required - Data is grouped by the specified
stepvalue
Filtering Options
Filter your cost data by:- Provider: Specific AI provider (e.g.,
openai,anthropic) - Subfeature: Specific feature (e.g.,
chat,ocr,text_to_speech) - Token: Specific API token
- Workflow ID: Specific workflow execution
- RAG Project ID: Specific RAG project
Check Your Current Credits
Get your current credit balance to verify available funds: Response:Monitor Usage - Basic Example
Get your last 30 days of usage, grouped by day:Filter by Provider
Get costs for a specific AI provider only:Filter by Subfeature
Track costs for specific features like LLM chat or OCR:Filter by Token
Track usage for a specific API token:Response Format
The monitoring endpoint returns data structured by token, date, and feature:Response Fields
| Field | Type | Description |
|---|---|---|
token | string | API token identifier |
data | object | Date-keyed usage data |
total_cost | number | Total cost for this feature on this date |
details | integer | Number of API calls made |
cost_per_provider | object | Cost breakdown by provider |
Feature Naming Convention
Features follow the pattern{category}__{subfeature}:
text__chat- LLM chat completionstext__generation- Text generationtext__embeddings- Text embeddingsimage__explicit_content- Image moderationimage__question_answer- Image Q&Aocr__ocr- OCR text extractionaudio__text_to_speech- Text-to-speech
Analyze Costs by Provider
Compare costs across different AI providers: Example Output:Best Practices
Query Optimization
Use appropriate step sizes:- Daily (
step=1): Last 30-90 days for detailed analysis - Weekly (
step=2): Last 3-6 months for trend analysis - Monthly (
step=3): Last year for reporting - Yearly (
step=4): Multi-year historical data