Credits & Billing
Aphelion uses a credits-based billing model. Credits are consumed when you execute tools, with different tools costing different amounts based on complexity.
How Credits Work
1-10
Credits per tool execution
$0.01
Per credit (promotional rate)
80%
Goes to tool publishers
When you execute a tool, credits are deducted from your account. The cost depends on:
- • Tool complexity (simple reads vs. complex operations)
- • Publisher-set pricing
- • Underlying API costs
ℹ️Credit Cost per Execution
Most tools cost 1-5 credits per execution. Complex tools (AI/ML, bulk operations) may cost up to 10 credits. The exact cost is shown before execution and in your usage dashboard.
Pricing Tiers
Free
$0/month
- ✓100 credits/month
- ✓Access to all tools
- ✓Basic memory storage
- ✓1 agent
Great for experimentation
Popular
Pro
$49/month
- ✓10,000 credits/month
- ✓Access to all tools
- ✓Unlimited memory storage
- ✓Unlimited agents
- ✓Priority support
Best for production use
Enterprise
Custom
- ✓Custom credit volume
- ✓Volume discounts
- ✓Dedicated support
- ✓SLA guarantees
- ✓Private deployments
For large-scale deployments
Checking Your Balance
GET
/v1/billing/creditsPython
# Check your credit balance
balance = client.billing.get_credits()
print(f"Credits remaining: {balance.credits}")
print(f"Credits used this month: {balance.used_this_period}")
print(f"Resets on: {balance.reset_date}")Response
{
"credits": 8547,
"used_this_period": 1453,
"included_credits": 10000,
"reset_date": "2024-02-01T00:00:00Z",
"plan": "pro"
}Usage History
GET
/v1/billing/usageQuery Parameters
| Parameter | Type | Description |
|---|---|---|
start_date | string | Start date (ISO 8601) |
end_date | string | End date (ISO 8601) |
agent | string | Filter by agent name |
group_by | string | Group by: day, tool, agent |
cURL
curl "https://api.aphl.ai/v1/billing/usage?group_by=tool" \
-H "Authorization: Bearer ap_live_..."Response
{
"usage": [
{
"tool": "stripe.customers.create",
"executions": 234,
"credits_used": 468,
"avg_credits_per_call": 2
},
{
"tool": "github.repos.list_issues",
"executions": 156,
"credits_used": 156,
"avg_credits_per_call": 1
},
{
"tool": "openai.chat.completions",
"executions": 89,
"credits_used": 445,
"avg_credits_per_call": 5
}
],
"total_executions": 479,
"total_credits": 1069
}Adding Credits
Purchase additional credits through the console or API:
POST
/v1/billing/credits/purchaseRequest
{
"amount": 5000,
"payment_method": "pm_card_visa"
}Response
{
"purchase_id": "pur_abc123",
"credits_added": 5000,
"amount_charged": 50.00,
"currency": "usd",
"new_balance": 13547
}ℹ️Promotional Rate
During the promotional period, credits are available at $0.01 each ($10 for 1,000 credits). Standard pricing will be $0.02 per credit.
Publisher Earnings
If you publish tools to the registry, you earn 80% of the credits spent on your tools.
Revenue Split
80%
You keep
20%
Aphelion
Payouts
- • Monthly payouts via Stripe Connect
- • Minimum payout: $25
- • Dashboard for tracking earnings
Check Earnings
GET
/v1/publisher/earningsResponse
{
"earnings": {
"total_earned": 1247.50,
"pending_payout": 312.00,
"last_payout": 935.50,
"last_payout_date": "2024-01-01T00:00:00Z"
},
"tools": [
{
"tool": "mycompany.api.action",
"executions": 12450,
"credits_earned": 24900,
"revenue": 249.00
}
]
}Handling Insufficient Credits
When you don't have enough credits, the API returns a 402 error:
Error Response
{
"error": {
"code": "insufficient_credits",
"message": "Not enough credits to execute this tool",
"details": {
"credits_required": 5,
"credits_available": 2,
"tool": "stripe.customers.create"
}
}
}Python - Handling Credit Errors
from aphelion import Aphelion, InsufficientCreditsError
client = Aphelion(api_key="ap_live_...", agent="my-agent")
try:
result = client.execute("stripe.customers.create", {...})
except InsufficientCreditsError as e:
print(f"Need {e.credits_required} credits, have {e.credits_available}")
# Prompt user to add credits or upgrade planBest Practices
Monitor Usage
- Set up usage alerts in the console
- Review usage by agent and tool
- Identify high-cost operations
Optimize Credits
- Cache results where possible
- Use batch operations
- Choose lower-cost tools when equivalent