RunCell.dev

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

FeatureCredits per RequestCalculation MethodNotes
Ask/Chat1 × model_rateDynamic (model-based)Uses verify_and_deduct_credits with base 1 credit multiplied by model's credit_rate
Agent1 × model_rateDynamic (model-based)Uses verify_and_deduct_credits with base 1 credit multiplied by model's credit_rate
Inline Completion0.05FixedFixed value, not affected by model selection
Simple Completion0.1FixedFixed value, not affected by model selection
Code Apply0.1FixedFixed value for both insert and edit actions
Image Generation5 × model_rateDynamic (model-based)Base credits configurable via IMAGE_GENERATION_CREDITS env var (default: 5)
Quick Fix1 × model_rateDynamic (model-based)Base 1 credit multiplied by model's credit_rate
Predictive Interaction0.5FixedFixed value for both streaming and non-streaming modes
Visualization Analysis0.3FixedFixed value for image analysis feature
Title Generation0FreeNo credits deducted

Model Credit Rate Examples

Each model defines a credit_rate multiplier. Here are a few examples:

ModelCredit Rate
anthropic/claude-sonnet-4-52.5
anthropic/claude-haiku-4-50.8
anthropic/claude-opus-4-54.2
openai/gpt-4o1.0
openai/gpt-4o-mini0.2
google/gemini-3-flash-preview0.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's credit_rate from model_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)