Check Your Credit Balance
| Field | Description |
|---|---|
balance | Total usable credits (plan + topup) |
plan_credits | Monthly subscription credits — reset each billing cycle |
topup_credits | Purchased credits — carry over until used |
is_enterprise | If true, unlimited usage (no credit deductions) |
minutes_estimate | Pre-calculated minutes remaining for each use case |
Credit Rates
Different features consume credits at different rates per minute:| Feature | Credits/min | Description |
|---|---|---|
| Voice Chat | 10 | Cloud agent with STT + LLM + TTS |
| Camera Chat | 30 | Cloud agent with user camera enabled |
| Essence (Cloud) | 2 | Cloud-hosted CPU avatar rendering |
| Essence (Self-Hosted) | 1 | Your infrastructure, CPU avatar rendering |
| Expression (Cloud) | 4 | Cloud-hosted GPU avatar rendering |
| Expression (Self-Hosted) | 2 | Your infrastructure, GPU avatar rendering |
| Operation | Credits | Description |
|---|---|---|
| Agent Generation | 250 | Create a new avatar agent |
| Dynamics Generation | 250 | Generate gestures/movements for an agent |
Request Limits
API endpoints are rate-limited to protect service quality. Limits are applied per API secret.| Tier | Concurrent Sessions | Agent Generations/day |
|---|---|---|
| Free | 2 | 5 |
| Creator ($20/mo) | 5 | 20 |
| Pro ($99/mo) | 10 | 50 |
| Enterprise | Custom | Custom |
Check your current tier and usage at www.bithuman.ai → Developer → API Keys.
Handling Errors
If you exceed limits or run out of credits, the API returns an error:402 (no credits), 429 (rate limited), 503 (workers busy).
Recommended Retry Strategy
Use exponential backoff with jitter:Concurrency Limits
Avatar sessions have per-account concurrency limits:| Resource | Limit | Notes |
|---|---|---|
| Cloud avatar sessions | Based on tier | Active WebRTC sessions |
| Agent generation | 3 concurrent | Queued if exceeded |
| Dynamics generation | 2 concurrent | Queued if exceeded |
Endpoint Guidelines
| Endpoint | Guidance | Notes |
|---|---|---|
POST /v1/validate | Lightweight | Use for health checks |
POST /v1/agent/generate | Heavy | Triggers GPU pipeline, ~2-5 min |
GET /v1/agent/status/* | Poll at 5s intervals | Avoid sub-second polling |
POST /v1/agent/*/speak | Per active session | Agent must be in a room |
POST /v1/files/upload | 10 MB image, 100 MB video | Size limits enforced |
POST /v1/dynamics/generate | Heavy | Triggers video generation |
Best Practices
Use webhooks instead of polling
Use webhooks instead of polling
Instead of polling
/v1/agent/status/{id} in a loop, configure webhooks to get notified when generation completes.Cache agent details
Cache agent details
Agent data rarely changes. Cache
GET /v1/agent/{code} responses locally and refresh only when needed.Reuse sessions
Reuse sessions
Keep avatar sessions alive between conversations instead of creating new ones. Session creation is the most expensive operation.
Check credits before heavy operations
Check credits before heavy operations
Call
GET /v2/credit-summaries to check your balance before starting agent generation (250 credits) or dynamics creation (250 credits). This avoids wasted API calls that fail with 402.