Billing Models for Inference Providers

This guide explains the billing options available to Inference Providers and how to configure them for your organization's needs.

Billing Model Overview

LangMart supports two primary billing models that determine who pays for model usage:

Model Who Pays Credits From Best For
Org-Pays Organization Organization pool Core tools, approved workflows
Member-Pays Individual member Member's credits Optional, experimental models

Understanding Billing Flow

Org-Pays Flow

Member Request → Organization Connection → Organization Credits Deducted
                                          ↓
                                    Usage tracked to member
                                    (for reporting, not billing)

Member-Pays Flow

Member Request → Organization Connection → Member's Personal Credits Deducted
                                          ↓
                                    Organization just provides access
                                    (no cost to organization)

Configuring Billing Mode

Per-Connection Billing

Each connection can have its own billing mode:

# Create org-pays connection
curl -X POST https://api.langmart.ai/api/connections \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Team GPT-4",
    "provider_id": "openai",
    "api_key": "sk-...",
    "scope": "organization",
    "billing_mode": "org_pays"
  }'

# Create member-pays connection
curl -X POST https://api.langmart.ai/api/connections \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Experimental Claude",
    "provider_id": "anthropic",
    "api_key": "sk-ant-...",
    "scope": "organization",
    "billing_mode": "member_pays"
  }'

Changing Billing Mode

Update an existing connection's billing mode:

curl -X PUT https://api.langmart.ai/api/connections/<connection_id> \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "billing_mode": "member_pays"
  }'

Organization Credits

Credit Pool

Organizations maintain a central credit balance:

  • Used for all org-pays connections
  • Separate from member personal credits
  • Managed by owners and admins
  • Visible in Organization Billing dashboard

Adding Credits

Via Web Interface

  1. Go to Organization > Billing
  2. Click Add Credits
  3. Enter amount (USD)
  4. Complete payment via Stripe

Via API

curl -X POST https://api.langmart.ai/api/organizations/<org_id>/credits \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 500.00,
    "description": "Q1 budget allocation"
  }'

Credit Balance

Check current balance:

curl -X GET https://api.langmart.ai/api/organizations/<org_id>/billing \
  -H "Authorization: Bearer <your-api-key>"

Response:

{
  "success": true,
  "billing": {
    "credit_balance": 450.00,
    "currency": "USD",
    "current_month_usage": 50.00,
    "current_month_limit": 1000.00,
    "auto_recharge": {
      "enabled": true,
      "threshold": 100.00,
      "amount": 500.00
    }
  }
}

Auto-Recharge

Set up automatic credit replenishment:

curl -X PUT https://api.langmart.ai/api/organizations/<org_id>/billing/auto-recharge \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "threshold": 100.00,
    "amount": 500.00
  }'

Spending Limits

Organization Limits

Control total organization spending:

Limit Type Description Example
Monthly Total spending per calendar month $5,000
Daily Maximum per day $500
Alert Threshold Percentage for warnings 80%
curl -X PUT https://api.langmart.ai/api/organizations/<org_id> \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "spending_limit_monthly": 5000.00,
    "spending_limit_daily": 500.00,
    "spending_alert_threshold": 0.8
  }'

Per-Member Limits

Control individual member spending on org-pays connections:

curl -X PUT https://api.langmart.ai/api/organizations/<org_id>/spending-limits \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "<member-user-id>",
    "monthly_limit": 100.00,
    "daily_limit": 10.00
  }'

What Happens at Limit

When a limit is reached:

Limit Reached Behavior
Member Daily Member blocked until tomorrow
Member Monthly Member blocked until next month
Org Daily All org-pays requests blocked
Org Monthly All org-pays requests blocked

Members at limit can still use:

  • Their personal connections
  • Member-pays organization connections

Billing Strategies

Strategy 1: Full Org-Pays

Best for: Enterprise IT, research institutions

All models are paid by the organization:

Connections:
├── OpenAI GPT-4      (org_pays) ✓
├── Anthropic Claude  (org_pays) ✓
├── Groq Llama        (org_pays) ✓
└── All models funded by organization

Pros:

  • Simple for members
  • Easy cost tracking
  • Centralized control

Cons:

  • Organization bears all costs
  • Potential for abuse without limits

Strategy 2: Full Member-Pays

Best for: Cloud providers, usage-based services

Members pay for all usage:

Connections:
├── OpenAI GPT-4      (member_pays)
├── Anthropic Claude  (member_pays)
├── Groq Llama        (member_pays)
└── Members must have credits

Pros:

  • No cost to organization
  • Members self-regulate
  • Revenue from markup

Cons:

  • Members need credits
  • Barrier to adoption

Best for: Most providers

Mix of org-pays and member-pays:

Connections:
├── OpenAI GPT-3.5    (org_pays)    - Basic, approved
├── Groq Llama        (org_pays)    - Cost-effective
├── OpenAI GPT-4o     (member_pays) - Premium
├── Claude Opus       (member_pays) - Expensive
└── Balanced approach

Pros:

  • Flexible cost allocation
  • Encourages responsible use
  • Supports different use cases

Setup:

  1. Org-pays for standard/approved models
  2. Member-pays for premium/experimental models
  3. Clear documentation of which is which

Strategy 4: Tiered by Department

Best for: Large enterprises

Different billing by department:

Engineering:
├── GPT-4o            (org_pays)    - High usage
├── All models        (org_pays)    - Full access

Marketing:
├── GPT-3.5           (org_pays)    - Standard use
├── GPT-4o            (member_pays) - Optional

Research:
├── All models        (org_pays)    - Grant-funded

Cost Tracking

Usage by Billing Mode

curl -X GET "https://api.langmart.ai/api/organizations/<org_id>/usage?group_by=billing_mode" \
  -H "Authorization: Bearer <your-api-key>"

Response:

{
  "success": true,
  "usage": {
    "org_pays": {
      "requests": 10000,
      "cost_usd": 250.00
    },
    "member_pays": {
      "requests": 2000,
      "cost_usd": 75.00
    }
  }
}

Cost Allocation Reports

Generate reports for internal billing:

curl -X GET "https://api.langmart.ai/api/organizations/<org_id>/usage?group_by=department&start_date=2024-01-01&end_date=2024-01-31" \
  -H "Authorization: Bearer <your-api-key>"

Invoice Generation

Generate invoices for internal chargeback:

curl -X POST https://api.langmart.ai/api/billing/invoices/generate \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "org_id": "<org_id>",
    "period_start": "2024-01-01",
    "period_end": "2024-01-31",
    "group_by": "department"
  }'

Pricing & Markups

LangMart Platform Fee

Tier Fee Description
Managed 3% Standard platform fee
Self-Hosted 0% Gateway runs on your infrastructure

Model Pricing

Model costs are based on provider pricing plus platform fee:

Member Cost = Provider Cost + (Provider Cost × 0.03)

Example: GPT-4o at $5/1M tokens
Member Cost = $5 + ($5 × 0.03) = $5.15/1M tokens

Custom Markups (Enterprise)

For revenue-generating providers:

{
  "pricing_mode": "markup",
  "markup_percentage": 0.20,  // 20% markup
  "minimum_markup": 0.01     // $0.01 minimum
}

Payment Methods

Accepted Methods

Method Org Credits Member Credits
Credit Card Yes Yes
Debit Card Yes Yes
Wire Transfer Enterprise No
Invoice Enterprise No

Enterprise Billing

For large organizations:

  • Annual contracts
  • Custom payment terms
  • Volume discounts
  • Dedicated support

Contact [email protected] for details.

Troubleshooting

Credits Not Deducting

Issue Solution
Using member-pays connection Check connection billing mode
Personal connection used Verify using org connection
Cached balance Wait 1-2 minutes for sync

Member Blocked Unexpectedly

Issue Solution
Hit daily limit Wait until tomorrow or increase
Hit monthly limit Increase or wait for reset
Org out of credits Add organization credits

Billing Mode Confusion

Symptom Cause Fix
Member charged Member-pays connection Switch to org-pays
Org charged Org-pays connection Switch to member-pays
No charge Free tier/credits Normal behavior

Best Practices

For Cost Control

  1. Start with member-pays for new models
  2. Set conservative initial limits
  3. Review usage weekly during rollout
  4. Graduate to org-pays once patterns established

For Member Experience

  1. Clearly label billing mode on models
  2. Provide documentation on which models to use
  3. Set reasonable limits to avoid surprises
  4. Notify before limits are reached

For Reporting

  1. Export usage monthly for records
  2. Track by department/team for chargeback
  3. Review cost trends quarterly
  4. Document billing decisions

Next Steps