# Profitability Real-time, usage-based pricing works best if you understand your costs just as well as your revenue. For AI-driven products, costs are often variable, workload-dependent, and incurred at different points in time than revenue. Fixed pricing models break down quickly in this environment, making it difficult to answer a fundamental question: is this product, or this customer, actually profitable? Credyt’s Profitability feature is designed to close that gap. It gives platforms a way to correlate what they earn with what they spend, at the level where it matters most: individual products, workloads, and customers. ## From real-time billing to business insights[​](#from-real-time-billing-to-business-insights "Direct link to From real-time billing to business insights") Credyt’s core infrastructure orchestrates real-time billing. The Profitability layer builds on that foundation to help you answer *how much you should charge,* and whether your pricing truly works. The feature combines: * **Usage events** (already powering billing), and * **Cost data** from underlying vendors and infrastructure With both inputs in one place, platforms can monitor profitability in real time, validate pricing assumptions against actual costs, quickly surface unprofitable customers or workloads, and adjust pricing models before issues compound. ## How it works[​](#how-it-works "Direct link to How it works") The sections below outline the core building blocks of Credyt Profitability and explain how they work together to connect usage, costs, and revenue into a coherent profitability model. ### Vendors[​](#vendors "Direct link to Vendors") [API Reference](https://docs.credyt.ai/api/vendors-ops-create-vendor.md) Vendors are the external services or infrastructure that power your product - for example, an AI model provider, a compute platform, or a third-party API. Each cost recorded in Credyt is linked to a vendor. POST https\://api.credyt.ai/events/vendors ```json { "name": "OpenAI", "external_id": "openai" } ``` **Response:** ```json { "id": "vnd_4rjb887sb1h4j2m0hdjmh49gdg", "created_at": "2026-02-17T09:42:22.470555Z" } ``` tip You can use your external ID when submitting costs in your events by specifying the `vendor_external_id` field instead of `vendor_id`. ### Costs[​](#costs "Direct link to Costs") [API Reference](https://docs.credyt.ai/api/event-ops-send-usage.md) The `costs` object is intentionally structured to mirror usage-based fees. A `costs` item can include: * Unit or volume-based cost information * Rates (e.g. cost per token, per minute, per task) * Optional metadata for further analysis This symmetry between fees and costs makes profitability calculations consistent and predictable. ```json "costs": [ { "id": "68116730-e125-408b-8f75-90f1fb9aa7dd", "vendor_id": "vnd_4rcmsv3fagtvha1j05q4fymsmw", "description": "OpenAI Sora", "metadata": { "model": "sora-fast", "resolution": "1080p", "billing_type": "per_minute" }, "units": 0, "unit_price": 0, "input_volume": 0, "volume_rate": 0, "package_size": 0, "amount": 0.16, "currency": "USD" } ] ``` ### Cost attribution[​](#cost-attribution "Direct link to Cost attribution") [API Reference](https://docs.credyt.ai/api/event-ops-send-usage.md) The power of Credyt Profitability comes from how costs are attached to usage. Costs can be attributed at different levels of granularity: * **Customer-level** - when costs apply broadly to a customer * **Event-level** - when a specific usage event directly incurs cost * **Subject-level** - when costs relate to a task or outcome (e.g. a `ticket_id` or `generation_id`) Subject-level attribution is especially useful for multi-stage or deferred-cost workflows. For example, if costs begin accumulating before a final “charge” event is emitted, they can still be attached to the same subject and factored into the final profitability calculation. It is the platform’s responsibility to submit cost information along with usage data by including costs in the usage events sent to Credyt. This ensures that costs are properly linked to customers, events, or subjects for accurate profitability tracking. POST https\://api.credyt.ai/events ```json { "customer_id": "cust_4zrjbt38gmpb55h95ygp38sp40", "events": [ { "id": "9c2c8e3a-7f6b-4f5e-9c1f-2e6b6a4a9f21", "event_type": "video_generated", "occurred_at": "2026-01-05T14:32:18Z", "subject": "chat_videoId39854734", "description": "Video gen completed", "costs": [ { "id": "68116730-e125-408b-8f75-90f1fb9aa7dd", "vendor_id": "vnd_4rcmsv3fagtvha1j05q4fymsmw", "description": "OpenAI Sora", "metadata": { "model": "sora-fast", "resolution": "1080p", "billing_type": "per_minute" }, "amount": 0.16, "currency": "USD" } ], "data": { "minutes": 2, "model": "video fast", "speed": "fast" } } ] } ``` ### Profitability[​](#profitability-1 "Direct link to Profitability") [API Reference](https://docs.credyt.ai/api/event-ops-get-event.md) Once revenue and costs are linked, Credyt can calculate profitability across multiple dimensions: * **Per event** - gross revenue, total cost, net revenue, and margin * **Per customer** - understanding which customers are sustainable * **Per product** - identifying profitable and loss-leading offerings These metrics are exposed through existing retrieval endpoints, starting from the most granular level and rolling up from there. Specifically, the profitability data for individual events is available in the `stats` object returned by both the [Get an event's details](https://docs.credyt.ai/api/event-ops-get-event.md) and [List events](https://docs.credyt.ai/api/event-ops-list-events.md) endpoints. GET https\://api.credyt.ai/events/:eventId ```json { "id": "9c2c8e3a-7f6b-4f5e-9c1f-2e6b6a4a9f21", "event_type": "video_generated", "occurred_at": "2026-01-05T14:32:18Z", "subject": "chat_videoId39854734", "description": "Video gen completed", "data": { "model": "video fast", "speed": "fast", "minutes": 2 }, "customer_id": "cust_4zrjbt38gmpb55h95ygp38sp40", "created_at": "2026-01-05T14:32:18Z", "fees": [ { "id": "fee_5a1s2xq3ky8z16b1enqybz1qdn", "product_id": "prp_42b28p940qcq31r7amf2729snb", "product_code": "glitch_video_adv_1", "product_version": 1, "price_id": "prc_475p31bj838yec0q2fy66snbcy", "price_name": "Video Generation Compute", "currency": "MIN", "dimensions": { "speed": "fast" }, "usage_type": "volume", "volume_field": "minutes", "input_volume": 2.0, "volume_rate": 1, "description": "Chat message completed", "amount": 2.0 } ], "costs": [ { "id": "68116730-e125-408b-8f75-90f1fb9aa7dd", "vendor_id": "vnd_4rcmsv3fagtvha1j05q4fymsmw", "description": "OpenAI Sora", "metadata": {}, "amount": 0.16, "currency": "USD" } ], "stats": { "gross_revenue": 0.2, "total_costs": 0.16, "net_revenue": 0.04, "margin": 0.2, "currency": "USD" } } ``` The initial version of Credyt Profitability focuses on foundational primitives rather than complex dashboards. By starting with event-level revenue and cost correlation, platforms gain the raw insight needed to safely experiment with pricing and detect margin erosion early. As the feature evolves, this foundation enables richer analysis without changing how data is captured today. Future iterations will expand on this foundation with: * Broader cost distribution models * Deeper vendor analysis * Subject-level profitability views In its initial form, Credyt Profitability provides platforms with a useful, real-time view into how their product economics are performing.