API v1

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).

Base URL
https://your-site.com/api/v1

Authentication

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.

HeaderMeaning
X-RateLimit-LimitGeneration limit for the key's window
X-RateLimit-RemainingRemaining generations in the current window
X-RateLimit-ResetISO timestamp when the oldest generation expires from the window

Service info

GET/api/v1/infopublic

Returns 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

GET/api/v1/statusAPI key

Returns 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

POST/api/v1/generateAPI keycounts against quota

Converts a supported file-host URL into a premium direct link. The request is retried automatically against the upstream provider on transient failures.

Request body

FieldTypeDescription
urlstringRequired. 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" }.

HTTPCodeWhen
400MISSING_URL / INVALID_URL_FORMATBody has no url or it is not a valid URL
401MISSING_API_KEY / INVALID_API_KEY / KEY_EXPIREDKey missing, unknown, or past its expiry
403KEY_DISABLEDKey was disabled by an administrator
422GENERATION_ERRORHost unsupported, file removed, or provider rejected the link
429RATE_LIMIT_EXCEEDEDKey's generation limit reached for the window
502UPSTREAM_ERROR / UPSTREAM_TIMEOUTDebrid provider unreachable after retries
503SERVICE_DISABLEDGenerator 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'];
Need a key?
Keys are issued by administrators from the dashboard. Contact support to request one.