Skip to main content

Credits

AgentGate uses a credit-based billing system. This page explains how credits work, how to check balances, and how to manage usage.

How Credits Work

Credits are the unit of payment for AgentGate usage:
  • Runs consume credits: Each run deducts credits based on complexity
  • Credits are prepaid: You purchase or receive credits before use
  • Two credit types: Included credits (with your plan) and purchased credits

Credit Types

Deduction Priority

When runs complete, credits are deducted in this order:
  1. Included credits (use first, reset monthly)
  2. Purchased credits (use after included depleted)

Credit Balance

Checking Balance

Get your current credit balance:
Response:

Balance Fields

Credit Deductions

When Credits Are Charged

Credits are deducted when a run completes:
  • Succeeded runs: Full cost charged
  • Failed runs: Partial cost for completed iterations
  • Cancelled runs: Cost for iterations before cancellation

What Determines Cost

Run cost depends on:

Viewing Run Costs

Check cost in run results:

Usage History

Querying Usage

Get transaction history:
Response:

Filtering Usage

Usage by Tenant

Track usage per tenant for billing:

Credit Estimation

Before Submitting

While exact costs can’t be predicted, estimate based on:
Actual costs depend on iterations needed and verification complexity.

Insufficient Credits

If balance is insufficient:
  • Work order submission returns 402 Payment Required
  • Error includes required vs available credits
  • Purchase credits or wait for monthly reset

Billing Integration

Passing Costs to Customers

Use tenant context and usage API for billing integration:

Stripe Integration Pattern

Cost Optimization

Strategies

Specific prompts converge faster, reducing iterations and cost.
Don’t use L3 verification for quick prototypes. Match verification to needs.
Set reasonable maxIterations to cap costs per run.
Multiple smaller work orders often cost less than one complex one.

Monitoring Usage

Set up monitoring for credit usage:

Tenant Context

Attribute usage to tenants

API Reference

Credits API endpoints