Hi everyone! 👋 I've been diving deep into Cartesia for the past few months to track our marketing campaign costs, and I've hit a point where I need to understand our spending breakdown at a much more granular level. Specifically, I'm trying to figure out which individual features or API calls are driving the bulk of our monthly invoice. The billing dashboard shows a top-line total, but for budget forecasting and optimization, I need to see the nitty-gritty details.
Has anyone successfully pulled a detailed usage report from Cartesia that goes beyond just total credits or spend? I'm looking for something that can break down costs by:
* **Feature/Endpoint:** (e.g., `synthesize`, `voices.list`, `real-time streaming`, specific TTS models like `aura-stella`).
* **Project or Application ID:** To attribute costs to specific campaigns or products.
* **Time Granularity:** Ideally hourly or daily, but weekly could work.
* **Credit Consumption per Item:** The actual units used per line item.
I've been poking around the API docs and the web console. Here's what I've tried so far, with mixed results:
**1. Console Dashboard Method:**
The "Usage" section in the project dashboard gives a high-level overview per project, but the export function (when available) seems to give aggregate totals for the period, not the itemized list I need.
**2. API Exploration:**
I've been looking for a dedicated `/usage` or `/billing` endpoint. The closest I've found is pulling logs of activity, but that doesn't directly map credit cost to each event. I tried a script to aggregate calls, but without official cost mapping, it's guesswork.
```python
# Example of what I *wish* the API would return
{
"date": "2024-10-28",
"project_id": "proj_abc123",
"line_items": [
{
"feature": "synthesize",
"model": "aura-stella",
"characters": 15000,
"credits_consumed": 42.5
},
{
"feature": "voices.list",
"request_count": 100,
"credits_consumed": 0.1
}
]
}
```
**My main questions for the community are:**
* Is there a native, supported way to generate this kind of cost-by-feature report, or do I need to build it myself from audit logs?
* If you've built it yourself, how did you map specific API calls or features to their credit cost? Is there a definitive reference?
* Does Cartesia's billing system allow for tagging or labeling usage by feature internally?
I'm hoping to not only solve this for myself but to document a clear workflow for others who will inevitably face the same need for accountability and optimization. Any pointers, shared scripts, or even confirmation that this is a manual process would be incredibly helpful!
Happy to help,
ivyb
That's exactly what I was looking for too, their dashboard is too high-level. I'm curious, did you find any specific endpoints in the API docs that *looked* like they might return detailed usage, even if they didn't work perfectly for you yet? Sometimes I miss the right one.
Containers are magic, but I want to know how the magic works.
That's a really good question about the endpoints. I've been combing through their API reference myself, and the `/v1/usage` endpoint seemed like the obvious candidate. However, when I tried it, the response grouped everything under broad categories like "tts_characters" without breaking it down by specific model or feature. It didn't get to the level of detail for something like `aura-stella` versus another voice.
Have you looked at the raw webhook data for usage updates? I'm wondering if the event payloads sent to your application might contain more granular fields than what the queryable API endpoint returns. I haven't set that up yet to compare.
Ah, the classic "we bill you in detail, but only show you the total" move. Been there with a few other platforms. Your endpoint guess is solid, but you're right, it's frustratingly aggregated.
If the `/v1/usage` endpoint is just handing you lump sums like "tts_characters," the cost attribution you need isn't there via the main API. The webhook idea from user1144 is probably your best, or only, bet for true granularity. The event stream often carries the specific model or feature IDs that get sanitized out of the reporting API for "clarity."
You'll likely have to pipe those webhooks into your own data store and build the report yourself. Annoying, but then you can slice by project, feature, even by user ID if the payload includes it. It's the only way I've gotten real cost-per-campaign numbers out of similar services.
Data over dogma.