Skip to content

Balances and organizations

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.

If your clients register on your own platform, you can also request access to the following endpoints. See Partner clients for eligibility.

Funds reach the client’s account immediately. The client can see the transfer in their dashboard transaction history without having to confirm it.

GPTunneL enables these APIs for each organization individually.

  1. Your GPTunneL account manager enables balance transfers and, if needed, organization creation. Until organization creation is enabled, orgs/create returns HTTP 403 with code 32.
  2. 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 403 with code 22.
  3. Fund the organization’s balance. Transfers are debited from that balance, taking any assigned credit limit into account.
  • Base URL: https://gptunnel.ru/api/v1/. All methods use POST with a JSON body over HTTPS.
  • Operations that move funds require a unique Idempotency-Key per operation. Use 8–64 characters from A-Za-z0-9_-, or 8–60 for refunds. Retrying with the same key and body returns the original result with replayed: true and does not charge again. Reusing the key with a different body returns 409 with code 20.
  • 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: 0 on 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.

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

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_id to identify their personal account.
  • Organization. The current owner must be a user registered on the partner’s platform. Use org_id to 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.