Developer API
Generate premium download links programmatically. The API is a small JSON-over-HTTPS service authenticated with API keys that an administrator issues from the dashboard (or via the Telegram /createapi command).
https://your-site.com/api/v1Authentication
Send your key in the X-API-Key header, or as a bearer token in Authorization. Keys look like mdx_…. Keys can be disabled, regenerated or given an expiry at any time by the administrator.
X-API-Key: mdx_3f9a…c21e # or Authorization: Bearer mdx_3f9a…c21e
Limits & quotas
Each key has a generation limit over a rolling window of N days (default 1 day). Only successful generations count. When the limit is reached the API returns 429 RATE_LIMIT_EXCEEDED with the time the oldest generation falls out of the window. Additionally, a per-IP request limiter protects the endpoint from bursts.
| Header | Meaning |
|---|---|
X-RateLimit-Limit | Generation limit for the key's window |
X-RateLimit-Remaining | Remaining generations in the current window |
X-RateLimit-Reset | ISO timestamp when the oldest generation expires from the window |
Service info
/api/v1/infopublicReturns service name, version and available endpoints. No authentication required.
{ "service": "GlobalDebrid API", "version": "v1",
"endpoints": { "info": "GET /api/v1/info", "status": "GET /api/v1/status", "generate": "POST /api/v1/generate" } }Key status
/api/v1/statusAPI keyReturns quota information for the calling key.
{
"success": true,
"data": {
"key_name": "my-script",
"daily_limit": 100,
"limit_period_days": 1,
"used_today": 12,
"used_in_period": 12,
"remaining_in_period": 88,
"remaining_today": 88,
"next_reset_at": "2026-09-15T08:12:44.000Z"
}
}Generate a link
/api/v1/generateAPI keycounts against quotaConverts a supported file-host URL into a premium direct link. The request is retried automatically against the upstream provider on transient failures.
Request body
| Field | Type | Description |
|---|---|---|
url | string | Required. A full http(s):// URL to a file on a supported host. |
Response
{
"original_url": "https://rapidgator.net/file/abc123/file.zip",
"generated_link": "https://cdn.example.net/dl/…/file.zip",
"filename": "file.zip",
"generated_at": "2026-09-14T10:22:31.000Z"
}Error codes
Errors share one envelope: { "success": false, "error": "Short title", "message": "Human description", "code": "ERROR_CODE" }.
| HTTP | Code | When |
|---|---|---|
| 400 | MISSING_URL / INVALID_URL_FORMAT | Body has no url or it is not a valid URL |
| 401 | MISSING_API_KEY / INVALID_API_KEY / KEY_EXPIRED | Key missing, unknown, or past its expiry |
| 403 | KEY_DISABLED | Key was disabled by an administrator |
| 422 | GENERATION_ERROR | Host unsupported, file removed, or provider rejected the link |
| 429 | RATE_LIMIT_EXCEEDED | Key's generation limit reached for the window |
| 502 | UPSTREAM_ERROR / UPSTREAM_TIMEOUT | Debrid provider unreachable after retries |
| 503 | SERVICE_DISABLED | Generator is in maintenance mode |
Examples
curl -X POST https://your-site.com/api/v1/generate \
-H "X-API-Key: $GD_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://rapidgator.net/file/abc123/file.zip"}'const res = await fetch('https://your-site.com/api/v1/generate', {
method: 'POST',
headers: { 'X-API-Key': process.env.GD_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({ url: 'https://rapidgator.net/file/abc123/file.zip' })
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.message}`);
console.log(data.generated_link);import os, requests
r = requests.post(
"https://your-site.com/api/v1/generate",
headers={"X-API-Key": os.environ["GD_KEY"]},
json={"url": "https://rapidgator.net/file/abc123/file.zip"},
timeout=60,
)
data = r.json()
if r.ok:
print(data["generated_link"])
else:
print(data["code"], data["message"])$ch = curl_init('https://your-site.com/api/v1/generate');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-Key: ' . getenv('GD_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode(['url' => 'https://rapidgator.net/file/abc123/file.zip']),
]);
$data = json_decode(curl_exec($ch), true);
echo $data['generated_link'] ?? $data['message'];