The Most Advanced Conceivable MTProto Cloudflare Worker

A high-performance, edge-deployed MTProto gateway with advanced features including:

API Endpoints

POST /api

Main MTProto API endpoint for JSON-based requests.

{
  "method": "auth.sendCode",
  "params": {
    "phone_number": "+1234567890"
  },
  "sessionId": "optional-session-id",
  "dcId": 1
}

WebSocket /api (with Upgrade header)

WebSocket endpoint for real-time MTProto communication.

GET /health

Health check endpoint for monitoring service status.

GET /metrics

Metrics endpoint for performance monitoring.

Supported MTProto Methods

Rate Limits

The API enforces rate limits to prevent abuse:

Error Handling

All errors are returned in a consistent format:

{
  "error": {
    "code": 400,
    "message": "Error description",
    "type": "ERROR_TYPE"
  }
}