{"uid":"cap_gUWUOg47btyfW_lifyzM-","slug":"venice-ai-usage-analytics-0eec6857","name":"Venice AI Usage Analytics","description":"**Beta**: This endpoint is currently in beta and may be unstable. Request/response schemas and behavior may change without notice.\n\nGet aggregated usage analytics for the authenticated user with breakdowns by date, model, and API key. This endpoint provides summary views of your API usage, ideal for dashboards and usage monitoring. Data is cached for 10 minutes.","url":"https://api.venice.ai/api/v1/billing/usage-analytics?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","properties":{"endDate":{"type":"string","example":"2024-01-01","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"End date for filtering records (YYYY-MM-DD). If provided, startDate is also required."},"lookback":{"type":"string","default":"7d","example":"7d","pattern":"^[1-9]\\d*d$","description":"Lookback period for usage data. Format: number followed by \"d\" (e.g., \"7d\", \"30d\"). Maximum: 90d"},"startDate":{"type":"string","example":"2024-01-01","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Start date for filtering records (YYYY-MM-DD). If provided, endDate is also required."}}},"responseSchema":{"type":"object","example":{"byKey":[{"apiKeyId":"key_abc123","totalUsd":0.8,"totalDiem":15,"totalUnits":75000,"description":"Production Key"},{"apiKeyId":null,"totalUsd":0,"totalDiem":4,"totalUnits":25000,"description":"Web App"}],"byDate":[{"USD":0.5,"DIEM":10.25,"date":"2024-01-15T00:00:00.000Z"},{"USD":0.3,"DIEM":8.75,"date":"2024-01-14T00:00:00.000Z"}],"byModel":[{"totalUsd":0.4,"unitType":"tokens","breakdown":[{"usd":0.3,"diem":10,"type":"Output","units":35000},{"usd":0.1,"diem":2.5,"type":"Input","units":15000}],"modelName":"GLM 5.1","modelType":"LLM","totalDiem":12.5,"totalUnits":50000}],"lookback":"7d","topModels":["GLM 5.1","Kimi K2.6"],"byKeyDaily":[{"date":1705276800000,"Web App":2,"Production Key":8.5}],"topKeyNames":["Production Key","Web App"],"byModelDaily":[{"date":1705276800000,"GLM 5.1":5.5,"Kimi K2.6":3.2}]},"required":["lookback","byDate","byModel","byModelDaily","topModels","byKey","byKeyDaily","topKeyNames"],"properties":{"byKey":{"type":"array","items":{"type":"object","required":["apiKeyId","description","totalUsd","totalDiem","totalUnits"],"properties":{"apiKeyId":{"type":"string","nullable":true,"description":"API key ID, or null if usage was from web app"},"totalUsd":{"type":"number","description":"Total USD usage for this key"},"totalDiem":{"type":"number","description":"Total DIEM usage for this key"},"totalUnits":{"type":"number","description":"Total units consumed for this key"},"description":{"type":"string","example":"My Production Key","description":"API key description or \"Web App\""}}},"description":"Usage breakdown by API key, sorted by total spend (highest first)"},"byDate":{"type":"array","items":{"type":"object","required":["date","USD","DIEM"],"properties":{"USD":{"type":"number","description":"Total USD usage for this date"},"DIEM":{"type":"number","description":"Total DIEM usage for this date"},"date":{"type":"string","example":"2024-01-15T00:00:00.000Z","description":"Date in YYYY-MM-DD format"}}},"description":"Daily usage totals for the requested period"},"byModel":{"type":"array","items":{"type":"object","required":["modelName","unitType","modelType","totalUsd","totalDiem","totalUnits"],"properties":{"totalUsd":{"type":"number","description":"Total USD usage for this model"},"unitType":{"type":"string","example":"tokens","description":"Type of units (tokens, images, chars, minutes, seconds)"},"breakdown":{"type":"array","items":{"type":"object","required":["type","usd","diem","units"],"properties":{"usd":{"type":"number","description":"USD amount for this breakdown"},"diem":{"type":"number","description":"DIEM amount for this breakdown"},"type":{"type":"string","description":"Token type (e.g., \"Input\", \"Output\", \"Cache Read\", \"Cache Write\")"},"units":{"type":"number","description":"Number of units for this breakdown"}}},"description":"Breakdown by token type (only present if multiple types)"},"modelName":{"type":"string","example":"GLM 5.1","description":"Display name of the model"},"modelType":{"type":"string","example":"LLM","nullable":true,"description":"Type of model (LLM, IMAGE, TTS, ASR, VIDEO)"},"totalDiem":{"type":"number","description":"Total DIEM usage for this model"},"totalUnits":{"type":"number","description":"Total units consumed for this model"}}},"description":"Usage breakdown by model, sorted by total spend (highest first)"},"lookback":{"type":"string","example":"7d","description":"The lookback period used for the query. Either \"Nd\" format or \"startDate:endDate\" format."},"topModels":{"type":"array","items":{"type":"string"},"description":"Names of the top 8 models by usage (for chart legends)"},"byKeyDaily":{"type":"array","items":{"type":"object","additionalProperties":{"type":"number"}},"description":"Daily chart data for top 8 API keys. Each entry has \"date\" (timestamp) plus key descriptions as keys."},"topKeyNames":{"type":"array","items":{"type":"string"},"description":"Descriptions of the top 8 API keys by usage (for chart legends)"},"byModelDaily":{"type":"array","items":{"type":"object","additionalProperties":{"type":"number"}},"description":"Daily chart data for top 8 models. Each entry has \"date\" (timestamp) plus model names as keys."}},"description":"Aggregated usage analytics response with breakdowns by date, model, and API key","additionalProperties":false},"example":null,"exampleRequest":null,"tags":["x402","ai_ml"],"displayCostAmount":"10","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$10/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"10","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"10","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_lYIPWgTI2xnaMFG4INUIL","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"10","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns aggregated API usage analytics for the authenticated user, broken down by date, model, and API key, with daily trend data.","exampleAgentPrompt":"Can you pull my Venice AI usage analytics for the last 30 days and show me the breakdown by model and API key — I want to see which models and keys are driving the most spend?","exampleUseCases":null,"resultDescription":"Returns a JSON object with: daily usage arrays (USD and DIEM per day), per-model breakdowns (total USD, DIEM, units, input vs output split), per-API-key totals, daily model trends, daily key trends, top model names, top key names, and the lookback period used. Data is cached for 10 minutes.","failureModes":["Missing or invalid auth token returns 401 Unauthorized","If startDate is provided without endDate (or vice versa), returns 400 Bad Request","Lookback period exceeding 90d returns 400 Bad Request","Invalid date format (not YYYY-MM-DD) returns 400 Bad Request","Beta instability may cause intermittent 500 errors or schema changes without notice","Cached data may be up to 10 minutes stale"],"whenToPreferThis":"Use this endpoint when you need aggregated, dashboard-ready usage summaries with multi-dimensional breakdowns (by date, model, and key) rather than raw paginated transaction logs. Prefer this over the sibling Usage endpoint when you need trend data, top-model rankings, or daily time series. Ideal for building usage dashboards or cost monitoring alerts.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-11T12:43:30.352Z","isFirstParty":false,"canonicalSlug":"venice-ai-usage-analytics-0eec6857"}