Balances and organizations
What Business API Is
Section titled “What Business API Is”The Business API gives partners programmatic access to their organization’s balance. Agencies, distributors, and white-label platforms use it to buy GPTunneL services for their clients.
Partners can use the API to do the following.
- Transfer funds from the organization’s balance to a user’s personal account or another organization’s account.
- Create a client organization and assign its owner.
If your clients register on your own platform, you can also request access to the following endpoints. See Partner clients for eligibility.
- Check a client’s balance.
- Get a spending report for a specified period.
- Refund previously transferred funds to your organization’s balance.
- Freeze or restore spending on a client account.
- List the organizations a client owns.
Funds reach the client’s account immediately. The client can see the transfer in their dashboard transaction history without having to confirm it.
Connectivity
Section titled “Connectivity”GPTunneL enables these APIs for each organization individually.
- Your GPTunneL account manager enables balance transfers and, if needed, organization creation. Until organization creation is enabled,
orgs/createreturns HTTP403with code32. - The organization owner or an administrator enables Transfers in the API key settings. You can enable it for an existing key. The switch appears only after GPTunneL enables transfers for the organization in step 1. A transfer request made with Transfers disabled returns HTTP
403with code22. - Fund the organization’s balance. Transfers are debited from that balance, taking any assigned credit limit into account.
General rules
Section titled “General rules”- Base URL:
https://gptunnel.ru/api/v1/. All methods usePOSTwith a JSON body over HTTPS. - Operations that move funds require a unique
Idempotency-Keyper operation. Use 8–64 characters fromA-Za-z0-9_-, or 8–60 for refunds. Retrying with the same key and body returns the original result withreplayed: trueand does not charge again. Reusing the key with a different body returns409with code20. - User and organization IDs are 24 hexadecimal characters (
0-9a-f). Users can use Copy ID in their dashboard, and organization IDs appear on the client card. - Responses use JSON with
code: 0on success or a Business API error code on failure. The HTTP status reflects the error class. A rejected API key uses a separate HTTP 401 response format.
{ "code": 0, "transaction_id": "order-2026-10-20-000153", "amount": 500 }{ "code": 19, "message": "Insufficient funds on the organization balance." }The Idempotency-Key header is required for transfers, refunds and organization creation. You can repeat balance, spending and organization-list requests without this header.
Limits
Section titled “Limits”| Limitation | Meaning |
|---|---|
Maximum transfer or refund with an explicit amount |
100 000 ₽ |
| Amount precision | 2 decimal places |
Idempotency-Key length |
8–64 characters from A-Za-z0-9_- |
Idempotency-Key length for refunds |
8–60 characters from A-Za-z0-9_- |
| Maximum spending report range | 92 days with daily grouping, 366 days with monthly grouping |
| Organization name length | 1–255 characters |
Partner clients
Section titled “Partner clients”A GPTunneL account manager can enable balance/get, balance/spending, balance/refund, balance/setSpendBlocked, and orgs/list for partners whose users register on the partner’s own domain. These endpoints cannot be enabled in the dashboard. If an endpoint is unavailable to the organization that owns the key, it returns HTTP 403 with the corresponding code (34, 40, 35, 47, or 36, respectively). Refunds check the Transfers permission on the key first. If it is disabled, the response is HTTP 403 with code 22.
These methods only work with partner clients:
- User. The user registered on the partner’s platform. Use
user_idto identify their personal account. - Organization. The current owner must be a user registered on the partner’s platform. Use
org_idto identify the organization. If its current owner is not your client, these endpoints cannot access it, even if you created it or transferred funds to it.
An account that belongs to another partner returns the same response as a nonexistent account: HTTP 404 with code 17 for a user or 24 for an organization.
Clients can find their user_id using Copy ID in their dashboard. To get the org_id of each organization a client owns, call orgs/list.