API 概览
文档API 概览

API 概览

RaxyProxy REST API 的身份验证、请求格式、响应信封以及完整端点地图。

基础 URL

https://raxyproxy.com/api/v1

所有端点均在 /api/v1. HTTPS is required.

身份验证

每个请求都必须在 Authorization 标头中以 Bearer 令牌格式包含 API 密钥。在 API Keys page.

Authorization: Bearer raxy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
example.sh
curl https://raxyproxy.com/api/v1/account \
     -H "Authorization: Bearer raxy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

保持密钥保密

API 密钥授予对账户的完全访问权限 — 请勿提交到版本控制。请使用环境变量或密钥管理器。

端点

v1 中所有公开端点。每行链接到详细页面。

方法路径用途
GET/accountProfile, balance, 30d traffic, API key info
GET/packagesList active and suspended packages
GET/packages/{id}Detailed package (includes proxy password)
GET/packages/{id}/proxiesGenerate ready-to-use proxy strings
GET/packages/{id}/statsTime-series usage (minute / hour / day)
GET/packages/{id}/stats/hostsTop destinations by traffic
GET/packages/{id}/stats/errorsRecent error events per host / code
POST/packages/{id}/rotate-passwordGenerate a new proxy password
PATCH/packages/{id}/threadsUpdate max concurrent connections
PATCH/packages/{id}/protocolsEnable/disable HTTP & SOCKS5
GET/packages/{id}/allowed-ipsList whitelisted client IPs
POST/packages/{id}/allowed-ipsAdd an IP to the whitelist
DELETE/packages/{id}/allowed-ips/{ip}Remove an IP from the whitelist
GET/packages/{id}/blocked-hostsList domains the package may not reach
PUT/packages/{id}/blocked-hostsReplace the blocked-hosts list
GET/packages/{id}/default-geoDefault geo applied without per-request params
PUT/packages/{id}/default-geoUpdate default geo (countries/states/cities/ASNs…)
POST/packages/{id}/top-upAdd GB to the package using wallet balance
GET/packages/{id}/top-upsHistory of top-ups for this package
GET/locations/countriesAvailable countries for a pool type
GET/locations/statesStates within selected countries
GET/locations/citiesCities within selected countries/states
GET/locations/zipcodesZIP codes within selected countries/states
GET/locations/asnsASNs within selected countries/states/cities

响应信封

每个成功响应都包裹在标准信封中:

response.json
{
  "data": { ... },
  "meta": {
    "version": "v1"
  }
}

data field contains the actual payload (object or array depending on the endpoint). Paginated endpoints include additional keys inside meta.

错误

错误时 HTTP 状态码反映类别。响应体包含 error key with a machine-readable code and a human-readable message.

状态代码含义
400invalid_request错误请求 — 参数无效
401unauthorizedAPI 密钥缺失或无效
402payment_required余额不足 — 请先充值
403forbidden / insufficient_scope禁止 — 密钥缺少 scope
404not_found资源未找到
409conflict冲突 — 状态阻止操作(例如 IP 已在白名单)
422validation_failed验证失败 — 查看 errors 对象
429rate_limited超出速率限制 — 查看 Retry-After 标头
500http_error内部服务器错误
502provider_error上游提供商错误 — 临时性,请稍后重试
error.validation.json
{
  "error": {
    "code":    "validation_failed",
    "message": "Validation failed",
    "errors":  { "threads": ["The threads field must be between 1 and 2000."] }
  },
  "meta": { "version": "v1" }
}

速率限制

每个 API 密钥按端点分组限制。达到限制时返回 429 + Retry-After。

限制端点
api120 / min/account, /packages, /packages/{id}
stats-api60 / min/stats, /stats/hosts, /stats/errors, /top-ups
proxies-api30 / min/proxies
settings-api30 / minall package mutations (rotate-password, allowed-ips, …)
locations-api60 / min/locations/*
topup-api10 / min/packages/{id}/top-up
HTTP/1.1 429 Too Many Requests
Retry-After: 12
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 0

OpenAPI / AI 规范

可与工具、SDK 和 AI 助手集成的机器可读规范:

格式URL使用场景
OpenAPI 3.0 JSON/openapi.jsonSwagger UI、Postman、SDK 生成器
Plain text (LLM)/llms-api.txtChatGPT、Claude、Cursor 上下文