> For the complete documentation index, see [llms.txt](https://docs.mediafier.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mediafier.ai/overview/credits-and-billing.md).

# Credits & Billing

Per-call metering governed at the gateway: engagement shapes, what is billed, wallets, spend controls, and what happens at zero balance.

> **Per-call metering, governed at the gateway.** Every tool call that crosses the gateway is priced, attributed to the calling organization, and recorded against an auditable ledger before the runtime executes.

***

## The shape of platform billing

Billing is per call, per organization. The unit is the tool call rather than a seat; the account is the organization rather than an individual user. Credits are reserved before dispatch so the customer never receives a bill for a call the wallet couldn't pay for in the first place.

That structure shows up the same whether the call comes from an agent-first integration, a Slack/Teams surface, or Pippa chat. The gateway's billing stage is one chain; every surface walks it.

***

## Engagement shapes

Billing sits inside one of three commercial shapes; a typical engagement spans more than one.

| Shape             | What it covers                                                                               | How customers pay             |
| ----------------- | -------------------------------------------------------------------------------------------- | ----------------------------- |
| **Project**       | Design, integration, customization for a specific customer or partner engagement.            | Upfront and ongoing services. |
| **Transactional** | Operating the control plane, tuning governed resources and models, metering each call.       | Per call, scales with usage.  |
| **Outcome**       | Vertical IP — MediaClaws, tools and skills where the completed operation is the deliverable. | Priced per completed outcome. |

***

## What gets billed

| Billable event                                     | Notes                                                                                         |
| -------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| Tool call dispatched through the gateway           | Rates come from call-time responses, never from cached documentation.                         |
| MediaClaw step                                     | Each step is a tool call — same metering, evidence-card linked.                               |
| Marketplace resource call                          | Same metering posture; the publisher's earning split is recorded against the same call event. |
| Asynchronous follow-on work the platform initiates | Metered when the platform charges for the artefact the agent asked for (e.g. transcription).  |

What does **not** get billed: you are never billed for a call that didn't run. A request the gateway refuses before dispatch consumes no credits.

***

## Wallets and ledgers

Every organization has a credit wallet. Before dispatch, Mediafier verifies that the organization has enough spendable credits for the call. Expired or otherwise ineligible credits are not treated as available, even if they have not yet disappeared from a displayed balance.

Every charge carries the trace ID of the call that produced it, so the chain from "where did this charge come from?" to the underlying tool call is always reconstructable.

***

## What organizations can configure

Organizations get controls over how spend behaves at scale, not over whether the gateway enforces:

* **Per-tool spend visibility.** Which tools are spending, at what rate, against which agents.
* **Per-org rate-limit shape.** How aggressively a single org can burst against the platform's shared capacity.
* **Org-admin notifications.** Wallet-level and surface-level triggers — low balance, anomalous spend, surface starting to dominate the ledger.

What organizations don't configure: whether billing runs. Every governed call goes through the billing stage. Bypassing it isn't a configuration option.

***

## When the wallet runs dry

If a call would exceed the organization's available credits, the gateway returns a deterministic billing-failure response before the runtime sees the request. The agent receives a structured envelope with a trace ID. Two things follow:

1. The agent (or the agent's harness) knows the call did not run, why it did not run, and how to re-plan or escalate.
2. Operators and finance get the same information through the org-level wallet view and notifications.

Customers do not get surprise bills because the gateway never dispatches a call the wallet cannot pay for.

***

## What credits are not

* Credits are not transferable across organizations. The wallet is organization-bound.
* Credits are not tied to a specific runtime. The same credit can pay for a first-party MCP, a Marketplace resource, a MediaClaw step, or a workflow call.

***

## Why per-call metering matters

A few practical effects:

* **Cost transparency.** Customers can see exactly which surface, which agent, which run consumed which credits.
* **Contract flexibility.** The same metering supports per-call pricing, capped budgets, and outcome-priced engagements.
* **Anomaly detection.** A misbehaving agent is observable inside the ledger long before it shows up on a monthly invoice.
* **Partner economics.** Marketplace publishers earn against the same per-call metering — see [Provider Earnings & Marketplace Economics](/partners/provider-earnings-and-marketplace-economics.md).

***

## Where to go next

| If you're…                                             | Read next                                                                                             |
| ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
| Deciding which engagement shape fits                   | [Use Cases](/overview/use-cases.md)                                                                   |
| Looking at marketplace economics for publishers        | [Provider Earnings & Marketplace Economics](/partners/provider-earnings-and-marketplace-economics.md) |
| Studying how audit and billing share trace correlation | [Audit, Observability & Compliance](/trust/audit-observability-and-compliance.md)                     |
| Studying the gateway's billing stage in context        | [The Gateway](/platform/gateway.md)                                                                   |
