The Margin Problem Nobody Talks About
You scoped the project at 40 hours. The client signed off. Your team built the extraction pipeline, wired up the report generation, deployed it. The invoice went out on time. And then the client started uploading documents.
Not the 200 per month you estimated. Closer to 2,000.
The API costs that were a rounding error during scoping are now eating your margin. You can’t go back to the client — the contract says fixed fee. You can’t throttle the pipeline — the client expects it to work. So you absorb the cost and hope the next project goes better.
This is the most common pricing mistake agencies make with document processing: treating API costs as a fixed line item when they’re actually variable. The processing itself works fine. The math doesn’t.
If you run an agency that builds document pipelines for clients — extraction, transformation, report generation, any combination — this guide walks through how to price that work so it stays profitable regardless of volume.
Why Document Processing Is Different from Other API Costs
Most APIs agencies integrate scale predictably. A CRM API costs the same whether your client adds 10 or 10,000 contacts. A payment gateway takes a fixed percentage. You can estimate the cost at scoping time and be close enough.
Document processing doesn’t work that way. Costs scale with three variables at once:
- Volume — how many documents per month
- Complexity — how many pages per document, how many fields extracted
- Pipeline depth — how many processing steps each document passes through
A client who processes 100 single-page invoices costs dramatically less than a client who processes 100 fifty-page contracts. And if each contract also triggers a summary PDF and a thumbnail image, the cost multiplies again.
The good news: with the right pricing model, this variability becomes a feature, not a risk. You just need to choose the model that matches the project.
Three Pricing Models
There are three ways to price document processing into client projects. Each works best in a specific situation. None is universally correct.
Model 1: Cost-Plus
How it works: You estimate the monthly API cost, add your margin (typically 30-60%), and pass it through to the client as a separate line item.
The formula:
| Component | Calculation |
|---|---|
| Estimated monthly API cost | Volume x credits per document x credit rate |
| Agency markup | API cost x margin percentage |
| Monthly processing fee | API cost + markup |
When to use it:
- The client’s volume is unpredictable or seasonal
- The contract is long-term (6+ months) and usage will fluctuate
- The client is technically sophisticated and understands variable costs
- You want minimal financial risk on processing costs
Example scenario: A logistics company processes international shipping documents. Volume spikes during holiday season (3x normal) and drops in Q1. Cost-plus lets you pass through the actual cost each month, plus your margin, without renegotiating when volume changes.
Advantages:
- Zero margin risk from volume surprises
- Transparent — the client sees what they’re paying for
- Scales naturally with the client’s business
Disadvantages:
- Requires monthly reconciliation and variable invoicing
- Harder to sell — clients prefer predictable costs
- Your revenue is tied to the client’s volume, which you don’t control
Making it work: Report usage monthly. Show the client a breakdown: documents processed, credits consumed, your markup. Transparency builds trust and makes the variable cost feel like a utility bill rather than a surprise.
Model 2: Fixed-Fee with Included Volume
How it works: You quote a single monthly fee that includes a defined volume of document processing. Overages are handled through a predefined per-unit rate or a renegotiation clause.
The formula:
| Component | Calculation |
|---|---|
| Included volume | Estimated monthly documents x safety buffer (1.2-1.5x) |
| Base API cost | Included volume x credits per document x credit rate |
| Project fee | Development hours + base API cost + margin |
| Overage rate | Per-document cost x markup |
When to use it:
- The client wants a predictable monthly cost
- Volume is reasonably stable (less than 2x variation month to month)
- The project is mid-sized and the relationship is new
- You want to simplify billing while protecting margin
Example scenario: An accounting firm processes supplier invoices. They handle 400-600 per month, with occasional spikes to 800 during tax season. You quote a fixed fee that covers 750 documents per month, with a per-document overage rate above that.
Advantages:
- Predictable for the client and for you
- Simpler billing — one invoice, one line item
- Built-in margin buffer from the safety multiplier
Disadvantages:
- If you overestimate volume, the client overpays and eventually notices
- If you underestimate volume, you absorb the overage (unless the contract has overage terms)
- Requires accurate volume estimation at scoping time
Making it work: Always include an overage clause. Define what happens above the included volume — a per-document rate, a renegotiation trigger, or a hard cap. Never leave overages undefined. That’s where margin disappears.
Model 3: Per-Unit Pricing
How it works: The client pays a fixed rate per document (or per page, or per processing job). No monthly minimum, no included volume. Pure usage-based billing.
The formula:
| Component | Calculation |
|---|---|
| Cost per document | Credits per document x credit rate |
| Per-unit price | Cost per document x markup (1.5-3x) |
| Monthly invoice | Documents processed x per-unit price |
When to use it:
- The project is a platform or tool the client’s team uses on-demand
- Volume is highly variable and impossible to predict
- The client’s business model is itself per-unit (they charge their customers per document)
- You want to align your revenue with the client’s value received
Example scenario: A real estate agency uses a tool you built to process property listings — extract data from listing PDFs, generate marketing brochures, create social media images. They process 20 listings in a slow month and 200 in a hot market. Per-unit pricing means they pay proportionally to the value they receive.
Advantages:
- Perfect alignment between cost and value
- No minimum commitment reduces sales friction
- Higher margins are possible because the per-unit price includes your development amortization
- The client only pays when they get value
Disadvantages:
- Revenue is completely unpredictable
- If volume is low, you may not cover your development investment
- Requires per-unit tracking and reporting infrastructure
- Harder to forecast cash flow
Making it work: Set a minimum monthly fee to cover your baseline costs (infrastructure, monitoring, support). Structure the per-unit price to amortize your development cost over the expected lifetime volume. If you expect 10,000 documents over 12 months and development cost 15,000 EUR, that’s 1.50 EUR per document just for development recovery — before API costs and margin.
Choosing the Right Model
| Factor | Cost-Plus | Fixed-Fee | Per-Unit |
|---|---|---|---|
| Volume predictability | Low | Medium-High | Any |
| Client sophistication | High | Medium | Low-Medium |
| Billing complexity | High | Low | Medium |
| Margin risk | None | Medium | High |
| Client preference | Variable OK | Predictable | Pay-as-you-go |
| Best for | Long-term, variable | Stable, recurring | Platform, on-demand |
For most agency projects, fixed-fee with included volume is the default. It gives the client predictability and gives you margin protection through the safety buffer. Switch to cost-plus for high-volume, long-term contracts where the client is comfortable with variable costs. Use per-unit for platform-style projects where the client’s own revenue is per-transaction.
Estimating Volume During Scoping
Bad volume estimates are the root cause of margin problems. Here’s how to get closer to reality.
Step 1: Ask the Client Five Questions
- How many documents do you process per month today? (If they don’t know, that’s a red flag — dig deeper.)
- What’s the busiest month in the past year, and how much higher was it? (This gives you your peak multiplier.)
- How many pages is a typical document? (Multi-page documents cost more than single-page ones.)
- Is volume growing, stable, or declining? (If growing, factor in a 6-month projection, not today’s number.)
- Are there seasonal patterns? (Tax season, holiday shipping, quarterly reporting — all create spikes.)
Step 2: Build a Volume Estimate
Use this worksheet:
| Metric | Value |
|---|---|
| Average monthly documents (from client) | _ |
| Peak month multiplier (busiest / average) | _ |
| Average pages per document | _ |
| Growth factor (6-month projection) | _ |
| Estimated monthly volume | Average x growth factor |
| Peak monthly volume | Estimated x peak multiplier |
Step 3: Calculate Credits Per Document
Every document processing workflow consumes a different number of credits depending on which APIs it touches. Check credits and pricing for current rates per API and per operation.
Map your pipeline to credit consumption:
| Pipeline step | Credits per document |
|---|---|
| Document extraction | Check current rates |
| Image transformation (per image) | Check current rates |
| Document generation (per output) | Check current rates |
| Image generation (per image) | Check current rates |
| Total credits per document | Sum of all steps |
A simple extraction-only pipeline uses fewer credits than a full pipeline that extracts data, generates a summary PDF, and creates a thumbnail image. Price the pipeline you’re actually building, not a generic estimate.
Step 4: Calculate Monthly Cost
| Metric | Calculation |
|---|---|
| Monthly documents | From Step 2 |
| Credits per document | From Step 3 |
| Total monthly credits | Documents x credits per document |
| Monthly API cost | Total credits x credit rate |
Check credits and pricing for the current credit rates across all tiers.
Step 5: Add Your Buffer
Never quote based on the average estimate. Add a buffer based on your confidence level:
| Confidence in estimate | Buffer |
|---|---|
| Client provided detailed historical data | 1.2x (20% buffer) |
| Client gave rough estimates | 1.5x (50% buffer) |
| Client said “I don’t know, maybe 500” | 2.0x (100% buffer) |
The buffer is your insurance. It’s cheaper than renegotiating mid-project.
Budget Caps as Safety Nets
Regardless of which pricing model you use, set a budget cap on your API spending. This is your circuit breaker — the point where processing stops and you get notified instead of silently running up costs.
How Budget Caps Work
Iteration Layer lets you set spending limits at the API key level. When the limit is reached, requests return an error instead of processing. Your application handles the error and queues the document for later processing or alerts the client.
For agency setups, use separate API keys per client project. Each key gets its own budget cap. One client’s volume spike doesn’t affect another client’s processing.
Setting the Right Cap
| Scenario | Cap formula |
|---|---|
| Fixed-fee project | Included volume x credits per document x 1.1 |
| Cost-plus project | Estimated monthly credits x peak multiplier x 1.2 |
| Per-unit project | Maximum acceptable monthly cost / credit rate |
Set the cap 10-20% above your expected maximum. This gives you headroom for normal variation while catching genuine runaways. Review and adjust quarterly.
What to Do When a Cap Is Hit
Don’t just let requests fail silently. Build a notification into your pipeline:
- API returns a rate limit or budget error
- Your application queues the document
- You get an alert (email, Slack, PagerDuty)
- You decide: raise the cap, talk to the client, or wait for the next billing period
The cap exists to give you a decision point, not to break the client’s workflow permanently.
Handling Multi-Project Accounts
Agencies typically run multiple client projects from a single Iteration Layer account. This creates an accounting challenge: you need to track costs per client, not just in aggregate.
Per-Project API Keys
Create a separate API key for each client project. This gives you:
- Per-project usage tracking — know exactly what each client consumes
- Per-project budget caps — one client’s spike doesn’t affect others
- Clean billing data — no manual allocation or estimation required
- Easy offboarding — revoke one key without touching others
Monthly Reconciliation Worksheet
At the end of each billing period, run this for each client:
| Metric | Value |
|---|---|
| Documents processed this month | From usage dashboard |
| Credits consumed | From usage dashboard |
| API cost | Credits x credit rate |
| Included in fee? | Yes / No |
| Overage amount | If over included volume |
| Overage charge to client | Overage x per-document rate |
For cost-plus clients, this worksheet is the invoice. For fixed-fee clients, it’s your margin check — are you still within the buffer, or is it time to renegotiate?
Margin Math: A Worked Example
Let’s walk through a complete pricing calculation for a realistic project.
The project: An accounting firm needs a pipeline that extracts data from supplier invoices, validates totals using calculated fields, and generates a monthly summary report as a PDF.
Volume estimate: 500 invoices per month, single-page, stable volume. Peak month is ~700 (tax season). Client provided 12 months of historical data — high confidence.
Step 1: Map the Pipeline
| Step | API | Frequency |
|---|---|---|
| Extract invoice data | Document Extraction | Once per invoice |
| Generate monthly summary | Document Generation | Once per month |
Step 2: Calculate Credits
Check credits and pricing for current per-operation credit costs. Multiply by your pipeline frequency.
| Step | Credits per unit | Units per month | Monthly credits |
|---|---|---|---|
| Invoice extraction | Current rate (check pricing) | 500 | Rate x 500 |
| Summary generation | Current rate (check pricing) | 1 | Rate x 1 |
| Total | Sum |
Step 3: Choose Model and Calculate Price
For this project, fixed-fee with included volume makes sense. Stable volume, predictable pipeline, medium-term contract.
| Component | Calculation |
|---|---|
| Included volume | 500 x 1.2 buffer = 600 documents/month |
| Monthly API cost | Total credits x credit rate |
| Development cost | 60 hours x your hourly rate |
| Monthly development amortization | Development cost / 12 months |
| Monthly processing fee | API cost + amortization + margin |
| Overage rate per document | Per-document API cost x 1.5 markup |
Step 4: Set Budget Cap
| Metric | Value |
|---|---|
| Included volume in credits | 600 documents x credits per document |
| Cap | Included credits x 1.1 |
Step 5: Build Overage Clause
“Processing is included for up to 600 documents per calendar month. Documents exceeding this volume are billed at [per-document rate] per document, invoiced monthly in arrears.”
Clear, simple, enforceable. The client knows exactly what happens if volume increases.
Common Pricing Mistakes
Mistake 1: Ignoring Pipeline Depth
An extraction-only project costs X per document. An extraction-plus-generation project costs 2X or more. Don’t estimate “document processing” as a single cost — map each step in the pipeline to its credit consumption.
Mistake 2: Using Average Volume Without a Buffer
Averages hide spikes. If the client averages 500 documents but hits 1,200 in December, your margin disappears for a month. Always price against buffered estimates, never raw averages.
Mistake 3: No Overage Clause
“It’s only 500 documents a month, we don’t need an overage clause.” Until it’s 5,000. Every fixed-fee contract needs a defined overage mechanism — per-document rate, renegotiation trigger, or hard cap with a conversation.
Mistake 4: Bundling Processing into Hourly Rates
Some agencies absorb API costs into their hourly rate during development and then forget about ongoing costs. Development ends. Processing doesn’t. The API costs keep running, and there’s no revenue to cover them.
Always separate ongoing processing costs from one-time development costs. Development is a project. Processing is a service.
Mistake 5: Not Tracking Per-Client Costs
If you run five client projects from one account and don’t track per-client usage, you can’t tell which projects are profitable and which are losing money. Use separate API keys per client. Check usage monthly.
When to Renegotiate
Volume changes. Documents get more complex. Pipelines grow. Here are the triggers for a pricing conversation with your client:
| Trigger | Action |
|---|---|
| Actual volume consistently exceeds included volume by 20%+ | Raise the included volume and the fee |
| Volume dropped below 50% of included | Offer a lower tier (builds trust) |
| Client adds new document types to the pipeline | Re-scope the pipeline and adjust pricing |
| API credit rates change | Adjust your base cost calculation |
| Client requests near-real-time processing (was batch) | Factor in processing pattern changes |
Don’t wait for the annual review. Check margins quarterly. A 5-minute usage check can save a difficult conversation six months later.
EU Hosting and Client Pricing
If your agency serves European clients, data residency is part of the pricing conversation — not as a cost center, but as a value differentiator.
Iteration Layer runs entirely on EU infrastructure. Files are processed in memory and immediately discarded. No data retention, no transatlantic transfers. For the full details, see our security page.
This matters for your pricing in two ways:
-
You don’t need a separate compliance budget. No additional data processing agreements with US subprocessors, no legal review of transatlantic data transfer mechanisms, no separate GDPR-compliant processing tier. The processing is EU-native by default.
-
You can charge for it. EU data sovereignty is increasingly a requirement in client RFPs. If your competitors use US-hosted processing and you use EU-hosted processing, that’s a differentiator worth pricing into your proposal.
Getting Started
Check credits and pricing for current rates across all APIs. Map your next client project’s pipeline to credit consumption, choose your pricing model, and build the overage clause before you sign the contract.
If you’re managing multiple client projects, create separate API keys from the dashboard — one per client, each with its own budget cap.
The pipeline is the easy part. The math is where agencies win or lose. Get the math right at scoping time, and the processing takes care of itself.