AetherCDN

AetherCDN Developer API

Programmatic access to file storage, upload, download, and management operations.

Get API Key

Base URL: https://yoursite.com/api/v1

Authentication

Send your API key in the Authorization header using the Bearer scheme, or use the X-API-Key header.

GET https://yoursite.com/api/v1/files
Authorization: Bearer ${YOUR_API_KEY}

// Or using X-API-Key header
GET https://yoursite.com/api/v1/files
X-API-Key: ${YOUR_API_KEY}

API Keys

Keys are bearer tokens used to authorize API requests. Get your API key from the settings page.

Format

Prefix: ak_
Length: 32-64 chars
Example: ak_BQf1JvG3nE0w7ZtP9xRk2aLmNcVyHsQd

Scopes

  • files:read — Read and download files
  • files:write — Upload and modify files
  • user:read — Read user statistics

Endpoints

GET/api/v1/files

List user files with pagination support.

Query Parameters:

  • folderId (optional): Filter by folder ID
  • limit (optional): Max items per page (default: 50, max: 100)
  • offset (optional): Pagination offset (default: 0)

Response:

{
  "success": true,
  "files": [...],
  "pagination": {
    "total": 150,
    "limit": 50,
    "offset": 0
  }
}
POST/api/v1/files/upload

Upload a new file to your account.

Form Data:

  • file (required): The file to upload
  • folderId (optional): Target folder ID
  • description (optional): File description
  • tags (optional): Comma-separated tags

Response:

{
  "success": true,
  "file": {
    "id": "file_123",
    "name": "example.jpg",
    "size": 1024000,
    "url": "https://..."
  }
}
GET/api/v1/files/{id}/download

Download a specific file by its ID.

Returns the file content with appropriate headers.

GET/api/v1/user/stats

Get comprehensive user account statistics.

{
  "success": true,
  "stats": {
    "totalFiles": 150,
    "totalSize": 1073741824,
    "totalFolders": 12,
    "storageUsed": "1.0 GB",
    "bandwidthUsed": "500 MB"
  }
}

Examples

# List files
curl -H "Authorization: Bearer $YOUR_API_KEY" \
  "https://yoursite.com/api/v1/files?limit=10"

# Upload file
curl -X POST -H "Authorization: Bearer $YOUR_API_KEY" \
  -F "file=@example.jpg" \
  -F "description=My photo" \
  "https://yoursite.com/api/v1/files/upload"

# Download file
curl -H "Authorization: Bearer $YOUR_API_KEY" \
  -o downloaded_file.jpg \
  "https://yoursite.com/api/v1/files/file_123/download"

# Get user stats
curl -H "Authorization: Bearer $YOUR_API_KEY" \
  "https://yoursite.com/api/v1/user/stats"

Errors

All errors are returned with standard HTTP codes and a JSON payload:

{
  "success": false,
  "error": {
    "code": "unauthorized",
    "message": "Invalid API key"
  }
}

// Common error codes:
// - unauthorized: Invalid or missing API key
// - not_found: Resource not found
// - bad_request: Invalid request parameters
// - rate_limited: Too many requests
// - server_error: Internal server error