{
  "openapi": "3.1.0",
  "info": {
    "title": "DraxonCloud Public Developer API",
    "version": "1.0.0",
    "description": "High-performance programmatic APIs for automation engineers, scrapers, and bot workflows. Built with unified pay-as-you-go balance and standard bearer authentication."
  },
  "servers": [
    {
      "url": "https://draxon.one/api",
      "description": "Production API Gateway"
    }
  ],
  "tags": [
    {
      "name": "Captcha",
      "description": "Submit challenges, retrieve solve tokens, check live family pricing, and query solve statistics."
    },
    {
      "name": "Temporary Mail",
      "description": "Generate disposable or private inboxes, read messages, and long-poll for incoming verification codes."
    },
    {
      "name": "Custom Mail Domains",
      "description": "Register custom domains for private catch-all routing and verify TXT/MX records."
    },
    {
      "name": "Billing & Account",
      "description": "Check account prepaid balance, reserved funds, and monitor usage limits."
    },
    {
      "name": "AI Models",
      "description": "Chat models in the OpenAI and Anthropic request formats, paid per token."
    }
  ],
  "paths": {
    "/captcha/v1/families": {
      "get": {
        "tags": [
          "Captcha"
        ],
        "operationId": "listCaptchaFamilies",
        "summary": "Check live captcha prices and supported families",
        "description": "Shows current live prices including any volume discounts on your account.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Active captcha types and prices",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "type",
                          "label",
                          "requires_website_key",
                          "price_micros",
                          "price_usd"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "example": "standard_hcaptcha"
                          },
                          "label": {
                            "type": "string",
                            "example": "hCaptcha (standard)"
                          },
                          "requires_website_key": {
                            "type": "boolean",
                            "example": true
                          },
                          "accepts_rqdata": {
                            "type": "boolean",
                            "example": true
                          },
                          "accepts_cdata": {
                            "type": "boolean",
                            "example": false
                          },
                          "requires_proxy": {
                            "type": "boolean",
                            "example": false
                          },
                          "price_micros": {
                            "type": "integer",
                            "example": 4000
                          },
                          "price_usd": {
                            "type": "string",
                            "example": "0.004000"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/captcha/v1/tasks": {
      "post": {
        "tags": [
          "Captcha"
        ],
        "operationId": "createCaptchaTask",
        "summary": "Create a captcha solve task",
        "description": "Queues a challenge with the solver fleet. Supports standard_hcaptcha, enterprise_hcaptcha, hsw_hcaptcha, aws_waf, captchafox, akamai, turnstile, cloudflare_challenge, mtcaptcha, geetest, and castle.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional UUID to prevent duplicate charges on network drops",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCaptchaTaskRequest"
              },
              "examples": {
                "standardHcaptcha": {
                  "summary": "Standard hCaptcha challenge",
                  "value": {
                    "type": "standard_hcaptcha",
                    "website_url": "https://example.com/login",
                    "website_key": "10000000-ffff-ffff-ffff-000000000001"
                  }
                },
                "enterpriseHcaptcha": {
                  "summary": "Enterprise hCaptcha with rqdata",
                  "value": {
                    "type": "enterprise_hcaptcha",
                    "website_url": "https://example.com/signup",
                    "website_key": "10000000-ffff-ffff-ffff-000000000001",
                    "rqdata": "F49aX930KlmQ..."
                  }
                },
                "awsWaf": {
                  "summary": "AWS WAF Captcha",
                  "value": {
                    "type": "aws_waf",
                    "website_url": "https://aws.example.com"
                  }
                },
                "akamai": {
                  "summary": "Akamai Bot Manager",
                  "value": {
                    "type": "akamai",
                    "website_url": "https://akamai.example.com"
                  }
                },
                "turnstile": {
                  "summary": "Cloudflare Turnstile",
                  "value": {
                    "type": "turnstile",
                    "website_url": "https://example.com/login",
                    "website_key": "0x4AAAAAAAAAAAAAAAAAAAAA",
                    "action": "login",
                    "cdata": "session-123"
                  }
                },
                "cloudflareChallenge": {
                  "summary": "Cloudflare Challenge (Just a moment…)",
                  "value": {
                    "type": "cloudflare_challenge",
                    "website_url": "https://protected.example.com",
                    "proxy": "http://user:pass@host:port"
                  }
                },
                "mtcaptcha": {
                  "summary": "MTCaptcha",
                  "value": {
                    "type": "mtcaptcha",
                    "website_url": "https://example.com/signup",
                    "website_key": "MTPublic-xxxxxxxxx"
                  }
                },
                "geetest": {
                  "summary": "GeeTest v4 (website_key is the captcha_id)",
                  "value": {
                    "type": "geetest",
                    "website_url": "https://example.com/login",
                    "website_key": "e392e1d7fd421dc63325744d5a2b9c73"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Task created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaptchaTask"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "get": {
        "tags": [
          "Captcha"
        ],
        "operationId": "listCaptchaTasks",
        "summary": "List recent captcha tasks",
        "description": "Returns paginated list of recent tasks filtered by status.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 20,
              "maximum": 100
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "queued",
                "processing",
                "solved",
                "failed",
                "expired"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recent task list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CaptchaTask"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/captcha/v1/tasks/{id}": {
      "get": {
        "tags": [
          "Captcha"
        ],
        "operationId": "getCaptchaTask",
        "summary": "Get task status or wait synchronously for solution",
        "description": "Check task status. Use query parameter `wait=30` (up to 120s) to hold the connection open until solved or timeout.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Unique task UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "wait",
            "in": "query",
            "required": false,
            "description": "Seconds to hold connection waiting for solve result (0 to 120)",
            "schema": {
              "type": "integer",
              "default": 0,
              "minimum": 0,
              "maximum": 120
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Task current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaptchaTask"
                },
                "examples": {
                  "solved": {
                    "summary": "Task Solved",
                    "value": {
                      "id": "7b8a5b2c-623b-410a-8677-2b7e56230f21",
                      "type": "standard_hcaptcha",
                      "status": "solved",
                      "website_host": "example.com",
                      "cost_micros": 4000,
                      "cost_usd": "0.004000",
                      "charged_micros": 4000,
                      "attempts": 1,
                      "created_at": "2026-10-09T10:00:00Z",
                      "completed_at": "2026-10-09T10:00:06Z",
                      "solution": {
                        "token": "P1_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
                        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)..."
                      },
                      "error": null
                    }
                  },
                  "queued": {
                    "summary": "Task Queued",
                    "value": {
                      "id": "7b8a5b2c-623b-410a-8677-2b7e56230f21",
                      "type": "standard_hcaptcha",
                      "status": "queued",
                      "website_host": "example.com",
                      "cost_micros": 4000,
                      "cost_usd": "0.004000",
                      "charged_micros": 0,
                      "attempts": 0,
                      "created_at": "2026-10-09T10:00:00Z",
                      "completed_at": null,
                      "solution": null,
                      "error": null
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/captcha/v1/stats": {
      "get": {
        "tags": [
          "Captcha"
        ],
        "operationId": "getCaptchaStats",
        "summary": "Check solving statistics",
        "description": "Returns solve counts, success rates, and spending over specified number of days.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 30,
              "maximum": 90
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Solving statistics summary"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/mail/v1/public/domains": {
      "get": {
        "tags": [
          "Temporary Mail"
        ],
        "operationId": "listPublicMailDomains",
        "summary": "List public pool mail domains",
        "description": "Shows which shared domains are currently working or blocked for specific services (like Discord).",
        "responses": {
          "200": {
            "description": "List of active pool domains",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "domains"
                  ],
                  "properties": {
                    "domains": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "name"
                        ],
                        "properties": {
                          "name": {
                            "type": "string",
                            "example": "pool.example.test"
                          },
                          "mx_ok": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "example": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/mail/v1/public/random": {
      "post": {
        "tags": [
          "Temporary Mail"
        ],
        "operationId": "createRandomInbox",
        "summary": "Create fast anonymous inbox",
        "description": "Creates an inbox on a domain known to work with a target site (e.g. `discord`).",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "site": {
                    "type": "string",
                    "example": "discord"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Random inbox created"
          }
        }
      }
    },
    "/mail/v1/mailboxes": {
      "post": {
        "tags": [
          "Temporary Mail"
        ],
        "operationId": "createMailboxes",
        "summary": "Generate temporary mailboxes",
        "description": "Generate 1 to 500 mailboxes under shared pool domains or custom domains.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "count": {
                    "type": "integer",
                    "default": 1,
                    "minimum": 1,
                    "maximum": 500,
                    "example": 1
                  },
                  "password": {
                    "type": "string",
                    "enum": [
                      "generate",
                      "none"
                    ],
                    "default": "generate"
                  },
                  "label": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "example": "testing"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Mailbox created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CreatedMailbox"
                      }
                    }
                  }
                },
                "examples": {
                  "created": {
                    "summary": "Created Mailbox Response",
                    "value": {
                      "data": [
                        {
                          "id": "f2a1b3c4-d5e6-4a7b-8c9d-0e1f2a3b4c5d",
                          "address": "k3j9x0q2m1ab@pool.example.test",
                          "password": "pw_8f3a9e1b2c4d"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          }
        }
      }
    },
    "/mail/v1/mailboxes/{address}/messages": {
      "get": {
        "tags": [
          "Temporary Mail"
        ],
        "operationId": "listMailboxMessages",
        "summary": "List inbox messages",
        "description": "Fetches messages received by the mailbox.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "description": "Full email address (URL-encoded)",
            "schema": {
              "type": "string",
              "example": "k3j9x0q2m1ab@pool.example.test"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Inbox message list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MailMessage"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/mail/v1/mailboxes/{address}/messages/wait": {
      "get": {
        "tags": [
          "Temporary Mail"
        ],
        "operationId": "waitForMailboxMessage",
        "summary": "Wait (long-poll) for incoming message",
        "description": "Holds the HTTP connection until an incoming email arrives, or until the timeout expires. If no matching message arrives within the timeout period, `message: null` is returned (the definitive timeout signal). Setting `timeout=0` checks and returns immediately without holding the connection.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "k3j9x0q2m1ab@pool.example.test"
            }
          },
          {
            "name": "timeout",
            "in": "query",
            "required": false,
            "description": "Seconds to wait (0 to 60). Set 0 to check immediately without holding the connection.",
            "schema": {
              "type": "integer",
              "default": 30,
              "minimum": 0,
              "maximum": 60
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Filter sender address",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Message arrived or null if timed out",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/MailMessage"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                },
                "examples": {
                  "received": {
                    "summary": "Message Arrived",
                    "value": {
                      "message": {
                        "id": "9b1c2d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e",
                        "mailbox_id": "f2a1b3c4-d5e6-4a7b-8c9d-0e1f2a3b4c5d",
                        "address": "k3j9x0q2m1ab@pool.example.test",
                        "from": "Discord <noreply@discord.com>",
                        "from_address": "noreply@discord.com",
                        "subject": "Your Discord verification code",
                        "preview": "Your security code is 482913...",
                        "codes": [
                          "482913"
                        ],
                        "links": [
                          "https://discord.com/verify?token=..."
                        ],
                        "received_at": "2026-10-09T10:05:00Z",
                        "expires_at": "2026-11-08T10:05:00Z"
                      }
                    }
                  },
                  "timeout": {
                    "summary": "Timed Out",
                    "value": {
                      "message": null
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/mail/v1/domains": {
      "post": {
        "tags": [
          "Custom Mail Domains"
        ],
        "operationId": "createCustomDomain",
        "summary": "Register a custom mail domain",
        "description": "Send POST to register your custom domain for catch-all routing. Returns required TXT and MX records.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "example": "inbox.example.test"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Domain registered with DNS verification tokens",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomDomain"
                },
                "examples": {
                  "registered": {
                    "summary": "Registered Domain with DNS Records",
                    "value": {
                      "id": "e4f8b9a1-7c2d-4e5a-8b1c-9d0e1f2a3b4c",
                      "name": "inbox.example.test",
                      "status": "pending",
                      "verified_at": null,
                      "mx_ok": false,
                      "dns_records": [
                        {
                          "type": "TXT",
                          "host": "_draxon-verify.inbox.example.test",
                          "value": "draxon-verify=5xQ2mT8aLkP9wVbN3cRz7HdYfJ1eGuS0",
                          "priority": null
                        },
                        {
                          "type": "MX",
                          "host": "inbox.example.test",
                          "value": "mx.draxon.one",
                          "priority": 10
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          }
        }
      }
    },
    "/mail/v1/domains/{name}/verify": {
      "post": {
        "tags": [
          "Custom Mail Domains"
        ],
        "operationId": "verifyCustomDomain",
        "summary": "Verify domain DNS records and activate",
        "description": "After DNS changes propagate, triggers DNS check. When records match, status changes to active.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "inbox.example.test"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Domain verified and activated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "status",
                    "mx_ok"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "example": "active"
                    },
                    "verified_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "mx_ok": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          }
        }
      }
    },
    "/mail/v1/domains/{name}": {
      "delete": {
        "tags": [
          "Custom Mail Domains"
        ],
        "operationId": "deleteCustomDomain",
        "summary": "Remove custom domain",
        "description": "Permanently removes domain, cancels renewal, and removes associated mailboxes.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "inbox.example.test"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Domain deleted successfully"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/account/v1/billing/balance": {
      "get": {
        "tags": [
          "Billing & Account"
        ],
        "operationId": "getAccountBalance",
        "summary": "Check account prepaid balance",
        "description": "Returns total balance, held micros (reserved for running tasks), and available balance. (1,000,000 micros = $1.00 USD).",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Current account balance details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountBalance"
                },
                "examples": {
                  "balance": {
                    "summary": "Balance Details",
                    "value": {
                      "balance_micros": 12500000,
                      "held_micros": 4000,
                      "available_micros": 12496000,
                      "balance_usd": "12.500000",
                      "available_usd": "12.496000"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/llm/v1/models": {
      "get": {
        "tags": [
          "AI Models"
        ],
        "operationId": "listLlmModels",
        "summary": "List the models you may use",
        "description": "The live model catalog with each model's context window, capabilities and price per million input tokens.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Models you may use",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "label",
                          "vendor",
                          "vendor_label",
                          "enabled",
                          "context_tokens",
                          "default_max_output_tokens",
                          "reasoning",
                          "capabilities"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "qwen3.8-flash"
                          },
                          "label": {
                            "type": "string",
                            "example": "Qwen 3.8 Flash"
                          },
                          "vendor": {
                            "type": "string",
                            "example": "alibaba"
                          },
                          "vendor_label": {
                            "type": "string",
                            "example": "Alibaba"
                          },
                          "enabled": {
                            "type": "boolean",
                            "example": true
                          },
                          "context_tokens": {
                            "type": "integer",
                            "example": 1000000
                          },
                          "default_max_output_tokens": {
                            "type": "integer",
                            "example": 8192
                          },
                          "reasoning": {
                            "type": "boolean",
                            "example": false
                          },
                          "capabilities": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "example": [
                              "vision"
                            ]
                          },
                          "input_micros_per_1m": {
                            "type": "integer",
                            "example": 7500
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/llm/v1/chat/completions": {
      "post": {
        "tags": [
          "AI Models"
        ],
        "operationId": "createLlmChatCompletion",
        "summary": "Answer a chat request in the OpenAI format",
        "description": "The worst-case cost is reserved from your balance before the request and charged for the tokens the answer used afterwards. A failed request costs nothing.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "example": "qwen3.8-flash"
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "role",
                        "content"
                      ],
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": [
                            "system",
                            "user",
                            "assistant"
                          ]
                        },
                        "content": {
                          "oneOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "object"
                              }
                            }
                          ]
                        }
                      }
                    }
                  },
                  "max_tokens": {
                    "type": "integer",
                    "example": 256
                  },
                  "temperature": {
                    "type": "number"
                  },
                  "top_p": {
                    "type": "number"
                  },
                  "stop": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ]
                  },
                  "stream": {
                    "type": "boolean",
                    "example": false
                  },
                  "user": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "model": "qwen3.8-flash",
                "messages": [
                  {
                    "role": "user",
                    "content": "hello"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The answer, in the OpenAI chat completion shape",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "object",
                    "model",
                    "choices",
                    "usage"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "chatcmpl-2f1c9d"
                    },
                    "object": {
                      "type": "string",
                      "example": "chat.completion"
                    },
                    "created": {
                      "type": "integer",
                      "example": 0
                    },
                    "model": {
                      "type": "string",
                      "example": "qwen3.8-flash"
                    },
                    "choices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "index",
                          "message",
                          "finish_reason"
                        ],
                        "properties": {
                          "index": {
                            "type": "integer",
                            "example": 0
                          },
                          "message": {
                            "type": "object",
                            "required": [
                              "role",
                              "content"
                            ],
                            "properties": {
                              "role": {
                                "type": "string",
                                "example": "assistant"
                              },
                              "content": {
                                "type": "string",
                                "example": "hello"
                              }
                            }
                          },
                          "finish_reason": {
                            "type": "string",
                            "example": "stop"
                          }
                        }
                      }
                    },
                    "usage": {
                      "type": "object",
                      "required": [
                        "prompt_tokens",
                        "completion_tokens",
                        "total_tokens"
                      ],
                      "properties": {
                        "prompt_tokens": {
                          "type": "integer",
                          "example": 6
                        },
                        "completion_tokens": {
                          "type": "integer",
                          "example": 2
                        },
                        "total_tokens": {
                          "type": "integer",
                          "example": 8
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          }
        }
      }
    },
    "/llm/v1/messages": {
      "post": {
        "tags": [
          "AI Models"
        ],
        "operationId": "createLlmMessage",
        "summary": "Answer a messages request in the Anthropic format",
        "description": "Same billing as the OpenAI path; the response has the Anthropic message shape.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages",
                  "max_tokens"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "example": "qwen3.8-flash"
                  },
                  "max_tokens": {
                    "type": "integer",
                    "example": 256
                  },
                  "system": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      }
                    ]
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "role",
                        "content"
                      ],
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": [
                            "user",
                            "assistant"
                          ]
                        },
                        "content": {
                          "oneOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "object"
                              }
                            }
                          ]
                        }
                      }
                    }
                  },
                  "temperature": {
                    "type": "number"
                  },
                  "top_p": {
                    "type": "number"
                  },
                  "stop_sequences": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "stream": {
                    "type": "boolean",
                    "example": false
                  }
                }
              },
              "example": {
                "model": "qwen3.8-flash",
                "max_tokens": 256,
                "messages": [
                  {
                    "role": "user",
                    "content": "hello"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The answer, in the Anthropic message shape",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "type",
                    "role",
                    "content",
                    "model",
                    "usage"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "msg_6b1d"
                    },
                    "type": {
                      "type": "string",
                      "example": "message"
                    },
                    "role": {
                      "type": "string",
                      "example": "assistant"
                    },
                    "content": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "type"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "example": "text"
                          },
                          "text": {
                            "type": "string",
                            "example": "hello"
                          }
                        }
                      }
                    },
                    "model": {
                      "type": "string",
                      "example": "qwen3.8-flash"
                    },
                    "stop_reason": {
                      "type": "string",
                      "example": "end_turn"
                    },
                    "usage": {
                      "type": "object",
                      "required": [
                        "input_tokens",
                        "output_tokens"
                      ],
                      "properties": {
                        "input_tokens": {
                          "type": "integer",
                          "example": 6
                        },
                        "output_tokens": {
                          "type": "integer",
                          "example": 2
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          }
        }
      }
    },
    "/llm/v1/audio/transcriptions": {
      "post": {
        "tags": [
          "AI Models"
        ],
        "operationId": "createLlmTranscription",
        "summary": "Transcribe an audio file",
        "description": "The audio is charged per started minute from the same balance. The transcription runs on the MiMo upstream.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "language": {
                    "type": "string",
                    "example": "auto"
                  },
                  "model": {
                    "type": "string",
                    "example": "mimo-v2.5-asr"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The transcribed text",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "text",
                    "language",
                    "seconds",
                    "cost_micros",
                    "cost_usd"
                  ],
                  "properties": {
                    "text": {
                      "type": "string"
                    },
                    "language": {
                      "type": "string",
                      "example": "auto"
                    },
                    "seconds": {
                      "type": "number",
                      "example": 4.2
                    },
                    "cost_micros": {
                      "type": "integer",
                      "example": 30000
                    },
                    "cost_usd": {
                      "type": "string",
                      "example": "0.030000"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          }
        }
      }
    },
    "/llm/v1/usage": {
      "get": {
        "tags": [
          "AI Models"
        ],
        "operationId": "listLlmUsage",
        "summary": "Your served requests",
        "description": "One row per request: model, tokens, cost and outcome, newest first.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "model_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Your LLM requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_cursor": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API Key (drx_...)",
        "description": "Standard HTTP Bearer authorization header: `Authorization: Bearer drx_...`"
      },
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Alternative custom API key header: `X-Api-Key: drx_...`"
      }
    },
    "schemas": {
      "CreateCaptchaTaskRequest": {
        "oneOf": [
          {
            "type": "object",
            "title": "hCaptcha Challenge",
            "required": [
              "type",
              "website_url",
              "website_key"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "standard_hcaptcha",
                  "enterprise_hcaptcha",
                  "hsw_hcaptcha"
                ]
              },
              "website_url": {
                "type": "string",
                "example": "https://example.com/login"
              },
              "website_key": {
                "type": "string",
                "example": "10000000-ffff-ffff-ffff-000000000001"
              },
              "rqdata": {
                "type": "string",
                "description": "Optional custom rqdata string for enterprise challenges"
              },
              "proxy": {
                "type": "string",
                "description": "Optional proxy in scheme://user:pass@host:port format"
              },
              "user_agent": {
                "type": "string"
              },
              "screen": {
                "type": "string",
                "description": "Screen size the challenge sees, WIDTHxHEIGHT (200-16384 per side)",
                "example": "1920x1080"
              },
              "invisible": {
                "type": "boolean",
                "default": false
              }
            }
          },
          {
            "type": "object",
            "title": "AWS WAF Challenge",
            "required": [
              "type",
              "website_url"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "aws_waf"
                ]
              },
              "website_url": {
                "type": "string",
                "example": "https://aws.example.com"
              },
              "proxy": {
                "type": "string"
              },
              "user_agent": {
                "type": "string"
              }
            }
          },
          {
            "type": "object",
            "title": "CaptchaFox Challenge",
            "required": [
              "type",
              "website_url",
              "website_key"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "captchafox"
                ]
              },
              "website_url": {
                "type": "string",
                "example": "https://example.com/login"
              },
              "website_key": {
                "type": "string",
                "example": "fox_sitekey_123"
              },
              "proxy": {
                "type": "string"
              },
              "user_agent": {
                "type": "string"
              }
            }
          },
          {
            "type": "object",
            "title": "Akamai Bot Manager Challenge",
            "required": [
              "type",
              "website_url"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "akamai"
                ]
              },
              "website_url": {
                "type": "string",
                "example": "https://akamai.example.com"
              },
              "proxy": {
                "type": "string"
              },
              "user_agent": {
                "type": "string"
              }
            }
          },
          {
            "type": "object",
            "title": "Cloudflare Turnstile Challenge",
            "required": [
              "type",
              "website_url",
              "website_key"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "turnstile"
                ]
              },
              "website_url": {
                "type": "string",
                "example": "https://example.com/login"
              },
              "website_key": {
                "type": "string",
                "example": "0x4AAAAAAAAAAAAAAAAAAAAA"
              },
              "action": {
                "type": "string",
                "description": "Optional widget action name"
              },
              "cdata": {
                "type": "string",
                "maxLength": 255,
                "description": "Optional widget cData string"
              },
              "user_agent": {
                "type": "string"
              }
            }
          },
          {
            "type": "object",
            "title": "Cloudflare Challenge",
            "required": [
              "type",
              "website_url",
              "proxy"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "cloudflare_challenge"
                ]
              },
              "website_url": {
                "type": "string",
                "example": "https://protected.example.com"
              },
              "proxy": {
                "type": "string",
                "description": "Required: the cf_clearance cookie only works from the IP that earned it"
              },
              "user_agent": {
                "type": "string"
              }
            }
          },
          {
            "type": "object",
            "title": "MTCaptcha",
            "required": [
              "type",
              "website_url",
              "website_key"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "mtcaptcha"
                ]
              },
              "website_url": {
                "type": "string",
                "example": "https://example.com/signup"
              },
              "website_key": {
                "type": "string",
                "example": "MTPublic-xxxxxxxxx"
              },
              "action": {
                "type": "string",
                "description": "Optional: the page's MTCaptcha action"
              },
              "proxy": {
                "type": "string"
              }
            }
          },
          {
            "type": "object",
            "title": "GeeTest v4",
            "required": [
              "type",
              "website_url",
              "website_key"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "geetest"
                ]
              },
              "website_url": {
                "type": "string",
                "example": "https://example.com/login"
              },
              "website_key": {
                "type": "string",
                "description": "The widget's captcha_id",
                "example": "e392e1d7fd421dc63325744d5a2b9c73"
              },
              "proxy": {
                "type": "string"
              }
            }
          }
        ]
      },
      "CaptchaTask": {
        "type": "object",
        "required": [
          "id",
          "type",
          "status",
          "cost_usd",
          "cost_micros",
          "charged_micros"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "7b8a5b2c-623b-410a-8677-2b7e56230f21"
          },
          "type": {
            "type": "string",
            "example": "standard_hcaptcha"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "processing",
              "solved",
              "failed",
              "expired"
            ],
            "example": "solved"
          },
          "website_host": {
            "type": "string",
            "example": "example.com"
          },
          "cost_micros": {
            "type": "integer",
            "example": 4000
          },
          "cost_usd": {
            "type": "string",
            "example": "0.004000"
          },
          "charged_micros": {
            "type": "integer",
            "example": 4000
          },
          "attempts": {
            "type": "integer",
            "example": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "solution": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "token": {
                "type": "string",
                "description": "Captcha response token"
              },
              "user_agent": {
                "type": "string"
              }
            }
          },
          "error": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "code": {
                "type": "string",
                "example": "solve_failed"
              },
              "message": {
                "type": "string",
                "example": "Could not solve captcha challenge"
              }
            }
          }
        }
      },
      "CreatedMailbox": {
        "type": "object",
        "required": [
          "id",
          "address",
          "password"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "f2a1b3c4-d5e6-4a7b-8c9d-0e1f2a3b4c5d"
          },
          "address": {
            "type": "string",
            "example": "k3j9x0q2m1ab@pool.example.test"
          },
          "password": {
            "type": [
              "string",
              "null"
            ],
            "example": "pw_8f3a9e1b2c4d"
          }
        }
      },
      "MailMessage": {
        "type": "object",
        "required": [
          "id",
          "from_address",
          "subject",
          "codes",
          "links",
          "received_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "9b1c2d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e"
          },
          "mailbox_id": {
            "type": "string",
            "format": "uuid"
          },
          "address": {
            "type": "string",
            "example": "k3j9x0q2m1ab@pool.example.test"
          },
          "from": {
            "type": "string",
            "example": "Discord <noreply@discord.com>"
          },
          "from_address": {
            "type": "string",
            "example": "noreply@discord.com"
          },
          "subject": {
            "type": "string",
            "example": "Your Discord verification code"
          },
          "preview": {
            "type": "string",
            "example": "Your security code is 482913..."
          },
          "codes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Extracted OTP / PIN codes (4 to 8 digits)",
            "example": [
              "482913"
            ]
          },
          "links": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Clickable links found in body",
            "example": [
              "https://discord.com/verify?token=..."
            ]
          },
          "received_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CustomDomain": {
        "type": "object",
        "required": [
          "id",
          "name",
          "status",
          "dns_records"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "e4f8b9a1-7c2d-4e5a-8b1c-9d0e1f2a3b4c"
          },
          "name": {
            "type": "string",
            "example": "inbox.example.test"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "suspended",
              "disabled"
            ],
            "example": "pending"
          },
          "verified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "mx_ok": {
            "type": "boolean",
            "example": false
          },
          "dns_records": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "type",
                "host",
                "value"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "TXT",
                    "MX"
                  ]
                },
                "host": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "priority": {
                  "type": [
                    "integer",
                    "null"
                  ]
                }
              }
            }
          }
        }
      },
      "AccountBalance": {
        "type": "object",
        "required": [
          "balance_micros",
          "held_micros",
          "available_micros",
          "balance_usd",
          "available_usd"
        ],
        "properties": {
          "balance_micros": {
            "type": "integer",
            "example": 12500000,
            "description": "Total balance in USD micros (1,000,000 = $1.00)"
          },
          "held_micros": {
            "type": "integer",
            "example": 4000,
            "description": "Amount reserved for running tasks"
          },
          "available_micros": {
            "type": "integer",
            "example": 12496000,
            "description": "Spendable available balance"
          },
          "balance_usd": {
            "type": "string",
            "example": "12.500000"
          },
          "available_usd": {
            "type": "string",
            "example": "12.496000"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message",
              "request_id"
            ],
            "properties": {
              "code": {
                "type": "string",
                "example": "insufficient_balance"
              },
              "message": {
                "type": "string",
                "example": "Not enough balance. Add funds to continue."
              },
              "details": {
                "type": "object"
              },
              "request_id": {
                "type": "string",
                "example": "req_8f1b2c3d4e5f"
              }
            }
          }
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Bad Request - Malformed JSON or invalid syntax (400 bad_request)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Unauthorized - Key missing, mistyped, or revoked (401 invalid_api_key)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "Payment Required - Insufficient balance (402 insufficient_balance or 402 spend_cap_reached)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "NotFound": {
        "description": "Not Found - Resource does not exist (404 not_found)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Conflict": {
        "description": "Conflict - Domain already registered or limit reached (409 domain_exists / 409 domain_limit_reached)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "ValidationError": {
        "description": "Validation Error - Invalid parameters (422 validation_error)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Too Many Requests - Rate limit exceeded (429 rate_limited)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      }
    }
  }
}