Credits are the unit of consumption in The Hog. They’re charged when an API call reaches out to external data providers to fulfil your request. Not every call costs credits — lightweight operations like health checks and polling run for free — but anything that fetches, enriches, or generates data from external sources will draw from your credit balance.Documentation Index
Fetch the complete documentation index at: https://docs.thehog.ai/llms.txt
Use this file to discover all available pages before exploring further.
What costs credits
| Operation | Credit behaviour |
|---|---|
POST /api/companies/search | Charged per unique domain where an external provider is consulted |
POST /api/people/enrich | Charged per provider attempt in the enrichment waterfall |
POST /api/generate | Charged for content generation |
POST /api/deep-research | Charged for LLM-powered deep research |
What is free
| Operation | Why it’s free |
|---|---|
GET /api/health | Infrastructure probe — no external calls |
GET /api/operations/:id | Polling — reads internal state only |
POST .../estimate | Pre-flight check — no external calls, no data returned |
Pre-flight estimates
Always call the
/estimate endpoint before running an expensive operation. Estimates are free and don’t consume credits. They tell you the projected cost, whether the call will be synchronous or asynchronous, and whether your current plan can cover it — before you commit./estimate path:
| Field | Description |
|---|---|
estimatedCredits | How many credits the real call is expected to consume |
likelySyncOrAsync | Whether the real call will return 200 or 202 |
expectedLatencyRange | Approximate wall-clock time for the operation |
providersLikelyUsed | Which external providers are likely to be queried |
withinPlanLimits | Whether your current plan can cover the estimated cost |
Credit metering in company search responses
Company search responses include ametering object so you know exactly what was charged:
creditsCharged reflects what was actually deducted. estimatedMaxCredits is the ceiling that was reserved at the start of the call — you’re only charged the actual amount.
Insufficient credits — 402 error
If your account doesn’t have enough credits to cover an operation, the API returns a402 Payment Required response before any external calls are made:
402 is returned. Run the /estimate endpoint first to confirm withinPlanLimits is true before submitting the real call.
Optimizing credit usage
Limit enrichment waterfall depth
People enrichment tries multiple providers in sequence until it finds a result. You can cap how deep it goes to reduce credit consumption:maxEmailProviderAttempts: 1 means The Hog will try only the top-ranked email provider and stop, regardless of whether a result was found. This costs fewer credits at the expense of lower coverage.