How to use ConvertAPI's API Tokens?
This article provides helpful tips on utilizing our API Tokens in different scenarios such as reselling, managing multiple environments, and setting restrictions for specific API Tokens.

How to use API Tokens?
When it comes to authenticating your conversions, you have two options: using an API token directly, or generating a short-lived JWT token signed with your API Token. If you choose the API Token option, keep in mind that the API token can be limited to a specific amount of conversions, or expire after a specific duration. With API Tokens, you can create multiple tokens per account, making it easy to restrict the consumption per token and distribute your purchased conversions between multiple environments or customers.
API Tokens also enable you to differentiate the consumption and statistics by tokens, which can be useful for detailed analysis. You can find the detailed statistics in the exported statistics CSV file.
To help you better understand the benefits of Access Tokens, we have listed some of the most common use cases below.
Limit the consumption using API Tokens
You can apply different limits of consumption of our service by creating API Tokens with specific conditions. Each API Token has it's maximum conversion count that is reduced each time a conversion is made. It also has an expiry date which allows you to set the limit of conversions during a given period.
Let's say you purchased a 12 000 conversions annual package, and you want to limit each month's consumption to 1000 conversions max, so you make sure you don't run out of conversions until the end of your billing cycle. This way you would create a new API Token each month with Usage Limit = 1000 and Expiry date = "dd/MM/yyyy".
API Token lifecycle
API tokens can be created with or without an expiration date. If you set an expiration date, the token will become inactive after that date. If you want to create a token that does not expire, simply leave the expiration date empty. Please note that the expiration date is set in UTC time, meaning the token will expire when the specified date is reached in UTC.
Short-lived JWT tokens
To create a short-lived JWT token programmatically, you have two options: self-signing the token or using our JWT Generator endpoint. You can sign the token using your API Token, which is helpful in environments where you want to avoid exposing your main API Tokens. This is particularly useful for front-end Single Page Applications (SPAs).
You can choose to self-sign the token following this example, or you can utilize our JWT generation endpoint
https://v2.convertapi.com/token/jwt
You can find more information on how to generate the JWT tokens on your account dashboard.
Different API Tokens for different environments
API Tokens are incredibly useful for managing authentication between different environments. By creating multiple API Tokens, you can distribute your conversions across different environments individually, allowing for greater control and flexibility. For example, you can use one API Token in your Staging environment and restrict it with Usage Limit = X. This way, in case you accidentally end up in an infinite loop while developing, etc., it will never reduce your account balance by more than X conversions. You can then create another API Token with Usage Limit = null for production use, ensuring that only the authorized personnel have access to your production-grade API Token that will never expire.
Become a reseller of a ConvertAPI service
API Tokens can be an incredibly useful tool for anyone looking to resell ConvertAPI's credits to their own audience or potential customers. For example, if you provide a service that uses ConvertAPI under the hood, you could avoid asking your customers to purchase a ConvertAPI plan directly from us and provide you with their API Tokens. Instead, you could purchase a larger plan, which results in a cheaper price per conversion, and distribute the conversions to each customer individually while adding your margin on top.
This can save your customers money and provide them with a more streamlined experience, all while allowing you to offer a valuable service and get your profit share. By making adjustments to the price per conversion yourself, you can optimize your profit margin and ensure that you are getting your fair share of the earnings. This approach can help you to maximize your revenue and make the most out of your business!
If you are interested in the Affiliates model, please visit the Affiliates section on our website.
Updated on: 16/12/2025
Thank you!
