API credits and usage

    How API calls on the Ertas AI Gateway are charged per token from your credit balance, what happens when credits run out, and where to see usage.

    Ask AI about this page
    On this page

    API calls are paid from the same credit balance as training. US$1 buys 100 credits, on every plan and on pay as you go. Each model has its own price per 1M input, cached input and output tokens, listed in Models and prices.

    How an API call is charged

    1. Before the model runs, the gateway sets aside enough credits for the largest reply the API call could produce.
    2. When the reply finishes, you're charged for the tokens actually used, from the usage in the response, and the rest is released.

    Setting max_tokens (or max_output_tokens on the Responses API) lowers the amount set aside, which helps when your balance is low.

    Example: a ertas-ai/medertas-27b API call with 2,000 input tokens and 300 output tokens costs 2,000 × $0.10 / 1M + 300 × $1.00 / 1M = $0.0005, or 0.05 credits.

    When credits run out

    API calls get 402 credits_exhausted. The error message says how many credits the API call needed and how many you have. Top up on the Billing page, or move to a plan with more monthly credits. See Pricing.

    See your usage

    Gateway → Overview shows your API usage over time.

    How long credits last

    Plan and pay-as-you-go credits last 12 months from when you get them, and the oldest are used first. Promotional credits follow their own terms. More on credits for training: Credits and usage in Model Studio.