Calculating Usage

When you use AI21 Studio via the API or the interactive web environment, your usage is metered for billing. You can track your usage and expected payments in the account page. Two types of activity are metered:

  • Requests - Every time you generate a completion in our website or post a complete request via the API.

  • Generated tokens - The total number of all completion tokens you generate. For example, assume you post a complete request for J1-Jumbo with a prompt consisting of 10 tokens and requiring 3 completions, i.e. numResults = 3, and the model generates completions with 5, 15, and 20 tokens. In total this request will consume 5+15+20=40 generated tokens.

You are encouraged to use the maxTokens and stopSequences parameters to avoid generating unnecessary tokens and make your usage as efficient as possible.