In this segment, we will discuss the pricing aspects of working with OpenAI models. When we utilise LLMs through APIs, certain costs are associated with the number of API calls made and the amount of data processed. API usage is typically billed based on various parameters such as the token size, model, duration of API calls, number of requests made and application usage (fine-tuning, base model or embedding). Depending on the scale of usage, these costs can accumulate quickly.
In the next video, your SME will discuss the finer aspects of calculating these costs when using OpenAI’s GPT models.
It should be noted that the final cost of the API call will be calculated on both the input prompt and the output completion from the model. You can also track your daily API usage and incurred costs directly through your OpenAI account using this (make sure that you are logged into your OpenAI account for the link to work.). The capabilities of the different models and their performance vary as well. For more information, you can refer to OpenAI’s pricing policy. With OpenAI’s pay-as-you-go model, users need to only pay for the actual API usage. Since there’s no requirement for subscription model or fixed monthly fees, you can get started with APIs without a significant initial investment.
It’s important to note that pricing policies might change or evolve over time. To get the most up-to-date and accurate information on how cost is calculated for OpenAI APIs, including any changes in pricing or token usage, it’s best to refer to OpenAI’s official website or API documentation.
You can also refer to online pricing calculators for calculating the approximate cost of your API call.
Dealing with Rate Limit Error
A common issue while working with commercial APIs is the rate at which API calls are made by users. To prevent misuse, the load on the servers should be reduced, and fair access to all the users should be ensured; commercial APIs throttle the number of times an API call is made. You may refer to the OpenAI documentation for more information on Rate Limits for OpenAI’s APIs.
As per OpenAI’s documentation, rate limits to its APIs are measured in the following five ways:
- Requests per minute (RPM)
- Requests per day (RPD)
- Tokens per minute (TPM)
- Tokens per day (TPD)
- Images per minute (IPM)
You may change your account’s limits by visiting the Limits section on the Settings page.
In the next video, your SME will walk you through the two steps to prevent API rate limits.
Report an error