Credits Consumption by Feature
How credits are calculated and deducted for each Runcell AI feature, including Ask/Chat and Agent modes
Overview
Runcell uses credits to account for AI feature usage. Depending on the feature, the cost is either:
- Dynamic (model-based):
credits = base_credits × model_rate - Fixed: a constant credit value that does not depend on the selected model
Ask/Chat and Agent Cost (per chat turn)
For Ask/Chat mode and Agent mode, the cost is calculated per chat turn as:
Credits per turn = 1 × model_rate
This is implemented via verify_and_deduct_credits using a base of 1 credit multiplied by the selected model’s credit_rate.
Credits Consumption Summary by Feature
| Feature | Credits per Request | Calculation Method | Notes |
|---|---|---|---|
| Ask/Chat | 1 × model_rate | Dynamic (model-based) | Uses verify_and_deduct_credits with base 1 credit multiplied by model's credit_rate |
| Agent | 1 × model_rate | Dynamic (model-based) | Uses verify_and_deduct_credits with base 1 credit multiplied by model's credit_rate |
| Inline Completion | 0.05 | Fixed | Fixed value, not affected by model selection |
| Simple Completion | 0.1 | Fixed | Fixed value, not affected by model selection |
| Code Apply | 0.1 | Fixed | Fixed value for both insert and edit actions |
| Image Generation | 5 × model_rate | Dynamic (model-based) | Base credits configurable via IMAGE_GENERATION_CREDITS env var (default: 5) |
| Quick Fix | 1 × model_rate | Dynamic (model-based) | Base 1 credit multiplied by model's credit_rate |
| Predictive Interaction | 0.5 | Fixed | Fixed value for both streaming and non-streaming modes |
| Visualization Analysis | 0.3 | Fixed | Fixed value for image analysis feature |
| Title Generation | 0 | Free | No credits deducted |
Model Credit Rate Examples
Each model defines a credit_rate multiplier. Here are a few examples:
| Model | Credit Rate |
|---|---|
anthropic/claude-sonnet-4-5 | 2.5 |
anthropic/claude-haiku-4-5 | 0.8 |
anthropic/claude-opus-4-5 | 4.2 |
openai/gpt-4o | 1.0 |
openai/gpt-4o-mini | 0.2 |
google/gemini-3-flash-preview | 0.4 |
For the full list of supported models and their credit rates, see Model Credit Costs.
Calculation Details
- Dynamic Calculation: Uses
convert_base_credits(base_credits, model)which multiplies base credits by the model'scredit_ratefrommodel_registry.py - Fixed Values: Defined directly in handler initialization as
credits_per_request - Default Configuration:
DEFAULT_CREDITS_PER_MESSAGE = 1(env var, used for Ask/Agent)IMAGE_GENERATION_CREDITS = 5(env var, used for image generation)