Authentication
All endpoints except GET /stock require authentication.
API Key
Section titled “API Key”Every user receives a unique API key when they register with the Supersim bot. Send it in the X-API-Key header on every request:
X-API-Key: supersim_YOUR_API_KEYAuth failures
Section titled “Auth failures”| HTTP code | Meaning |
|---|---|
401 |
Missing or invalid X-API-Key. |
403 |
The account owning this key has been suspended. |
429 |
Rate limit exceeded (see Errors & Rate Limits). |
Check your profile & balance
Section titled “Check your profile & balance”import requests
resp = requests.get( "https://su-persim.uz/api/v1/user/me", headers={"X-API-Key": "supersim_YOUR_API_KEY"},)print(resp.json())<?php
$ch = curl_init("https://su-persim.uz/api/v1/user/me");curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_HTTPHEADER, ["X-API-Key: supersim_YOUR_API_KEY"]);echo curl_exec($ch);curl_close($ch);const res = await fetch("https://su-persim.uz/api/v1/user/me", {headers: { "X-API-Key": "supersim_YOUR_API_KEY" },});console.log(await res.json());{ "telegram_id": 123456789, "username": "dev", "balance": 48.5, "referral_code": "123456789", "api_key_configured": true, "webhook_url": null, "is_banned": false, "created_at": "2026-08-15T18:00:00"}Regenerate your key
Section titled “Regenerate your key”If your key leaks, or you simply want a new one, regenerate it. The old key is invalidated immediately.
import requests
resp = requests.post( "https://su-persim.uz/api/v1/user/key/regenerate", headers={"X-API-Key": "supersim_OLD_KEY"},)data = resp.json()print(data["api_key"]) # new key — shown only once<?php
$ch = curl_init("https://su-persim.uz/api/v1/user/key/regenerate");curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_POST, true);curl_setopt($ch, CURLOPT_HTTPHEADER, ["X-API-Key: supersim_OLD_KEY"]);$data = json_decode(curl_exec($ch), true);curl_close($ch);
echo $data["api_key"]; // new key — shown only onceconst res = await fetch("https://su-persim.uz/api/v1/user/key/regenerate", {method: "POST",headers: { "X-API-Key": "supersim_OLD_KEY" },});const data = await res.json();console.log(data.api_key); // new key — shown only once{ "telegram_id": 123456789, "api_key": "supersim_9f2c4b...", "balance": 48.5}