Billing
Each of 2Chat's plans comes with an allotted API credit that will allow you to use the API either directly or by the use of an integration.
Every time the API is used, 1 credit is deducted from the pool of credits, with two exceptions:
- Checking a number with
extra-information=trueis billed as 2 credits. - Searching conversations is billed as 5 credits, because one call runs the contact and the message search over the whole account.
You can learn more about how the API is billed here.
Obtaining your current API credits
Make a request to the /info endpoint to obtain the maximum amount of requests you can make with your plan and the current
amount used.
curl --request GET 'https://api.p.2chat.io/open/info' \
--header 'X-User-API-Key: my_api_key_value'
{
"success": true,
"account": {
"name": "Account Name (ACC91be87af-5a29-4034-b599-342f2aeb5d52)",
"uuid": "ACC91be87af-5a29-4034-b599-342f2aeb5d52",
"on_trial": false,
"blocked": false,
"created_at": "2022-04-21T21:55:37Z",
"expires_at": "2024-08-31T19:11:08Z"
},
"limits": {
"requests_per_minute": 80
},
"usage": {
"api_request_count": 77112,
"max_api_request_count": 500000,
"number_check_count": 430542,
"max_number_check_count": 500000
}
}