Credit System
Understanding how credits are calculated based on RAIL Tokens and compute costs for API requests.
Understanding the Terminology
RAIL Tokens: The total number of tokens processed (input + output + internal tokens). This is a metric of usage.
Credits: The actual cost deducted from your account, calculated based on RAIL Tokens plus compute costs.
Credit Calculation Formula
Every API request consumes credits based on token usage and compute complexity:
Step 1: Calculate RAIL Tokens
RAIL Tokens = input_tokens + output_tokens + internal_tokens
Step 2: Calculate Credits Consumed
Credits = base_cost(endpoint)
+ ceil(input_tokens / 1000) × rate_in
+ ceil(output_tokens / 1000) × rate_out
+ compute_cost(complexity)Cost Components
- •Base Cost: Fixed credits for routing, auth, and infrastructure
- •Input Token Cost: Based on content length (rate_in per 1k tokens)
- •Output Token Cost: Only for generative endpoints (rate_out per 1k tokens)
- •Compute Cost: For complex orchestration or external API calls
Key Points
- •Evaluation endpoints have no output token costs
- •Generation endpoints charge for both input and output tokens
- •Token counts are rounded up to nearest 1000 for billing
- •RAIL Tokens ≠ Credits (tokens are usage metric, credits are cost)
Credit Calculation by Endpoint Type
The total cost for each request is calculated as: Total Cost = Base Cost + RAIL Tokens
| Endpoint Type | Base Cost | RAIL Tokens (RT) Calculation |
|---|---|---|
Simple Evaluation Single dimension scoring | 1 credit Infrastructure + compute | RT = ceil(input_tokens / 1000) |
Complex/Full Evaluation 8-dimension analysis | 3 credits Infrastructure + complex compute | RT = ceil(input_tokens / 1000) |
Generative AI content generation | 5 credits Infrastructure + AI generation + safety | RT = ceil(input_tokens / 1000) + ceil(output_tokens / 1000) Includes generated content tokens |
Understanding the Formula
Base Cost covers infrastructure, routing, authentication, and basic compute operations for that endpoint type.
RAIL Tokens (RT) represent the actual token usage - input tokens for all endpoints, plus output tokens for generative endpoints. Tokens are counted in blocks of 1000 (rounded up).
Example:
2,500 input tokens → ceil(2500/1000) = 3 credits
1,200 output tokens → ceil(1200/1000) = 2 credits
Example Calculations
Example 1: Simple Evaluation
• Content: 800 input tokens (rounds up to 1000)
• Endpoint:
/score/basicRAIL Tokens: 800 input tokens
Base cost: 1 credit
Input tokens: ceil(800/1000) × 1 = 1 credit
Output tokens: 0 (evaluation endpoint)
Compute: 0 credit
Total: 2 credits
Example 2: Full RAIL Evaluation
• Content: 2000 input tokens
• Endpoint:
/score/fullRAIL Tokens: 2000 input tokens
Base cost: 3 credits (8-dimension analysis)
Input tokens: ceil(2000/1000) × 1 = 2 credits
Output tokens: 0
Compute: 0 credit
Total: 5 credits
Example 3: Safe Generation
• Prompt: 8000 input tokens
• Generated: 500 output tokens
• Endpoint:
/generate/safeRAIL Tokens: 8000 input + 500 output = 8500 total
Base cost: 2 credits
Input tokens: ceil(8000/1000) × 1 = 8 credits
Output tokens: ceil(500/1000) × 1 = 1 credit
Compute: 3 credits (AI generation + safety checks)
Total: 14 credits
Monthly Allocations
Free
100
Credits/month
~50 evaluations
Pro
1,000
Credits/month
~500 evaluations
Business
10,000
Credits/month
~5,000 evaluations
Enterprise
Unlimited
Credits/month
Dedicated resources
Important Notes
- • Credits reset every 30 days and don't carry forward
- • All API keys share the same credit wallet per user
- • You can monitor usage in real-time from your dashboard
- • Top-ups are available for additional credits when needed
Check Your Balance
Monitor your credit usage and remaining balance from your dashboard.
View Dashboard