{
  "schema_version": "1.0",
  "updated_at": "2026-08-21",
  "service": {
    "name": "3DP API",
    "api_compatibility": "OpenAI Chat Completions",
    "base_url": "https://token.3dpclub.com/v1",
    "authentication": {
      "type": "bearer",
      "header": "Authorization: Bearer YOUR_API_KEY"
    }
  },
  "endpoints": [
    {
      "method": "POST",
      "path": "/chat/completions",
      "purpose": "创建聊天补全，支持流式响应"
    },
    {
      "method": "GET",
      "path": "/models",
      "purpose": "获取公开模型列表"
    }
  ],
  "minimal_request": {
    "method": "POST",
    "url": "https://token.3dpclub.com/v1/chat/completions",
    "headers": {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json"
    },
    "body": {
      "model": "glm-5.2",
      "messages": [
        {
          "role": "user",
          "content": "你好"
        }
      ],
      "stream": true
    }
  },
  "api_key_rules": [
    "完整 Key 只展示一次",
    "Key 应保存在服务端环境变量或密钥管理器中",
    "不要在前端、公开仓库、截图或日志中暴露 Key",
    "修改服务档位只影响后续新请求"
  ],
  "service_tiers": [
    {
      "id": "economy",
      "name": "经济档",
      "planned_multiplier": 0.2,
      "description": "价格优先"
    },
    {
      "id": "fast",
      "name": "快速档",
      "planned_multiplier": 0.4,
      "description": "优先低延迟渠道，首字 5 秒为服务目标而非绝对承诺"
    },
    {
      "id": "auto",
      "name": "自动档",
      "planned_multiplier": null,
      "description": "按模型和渠道健康度选择，按最终成功档位结算"
    }
  ],
  "routing": {
    "factors": [
      "model_capability",
      "channel_health",
      "priority",
      "ttft",
      "concurrency",
      "cooldown"
    ],
    "stream_switching": "流式内容发送后不透明切换上游",
    "fallback": "高档位可在开始输出前按规则降级",
    "source_of_truth": "控制台模型市场中的模型、价格和实时状态"
  },
  "errors": [
    {
      "status": 400,
      "meaning": "参数或模型能力不兼容",
      "action": "检查模型 ID、tools、JSON 模式和 token 上限"
    },
    {
      "status": 401,
      "meaning": "Key 无效或已停用",
      "action": "检查 Bearer 鉴权和 Key 状态"
    },
    {
      "status": 402,
      "meaning": "余额不足",
      "action": "充值后重试"
    },
    {
      "status": 429,
      "meaning": "并发、RPM 或上游限流",
      "action": "指数退避并降低并发"
    },
    {
      "status": 503,
      "meaning": "渠道暂不可用或重试耗尽",
      "action": "保留请求 ID 和发生时间，稍后重试"
    }
  ],
  "troubleshooting_fields": [
    "request_id",
    "timestamp_with_timezone",
    "model_id",
    "http_status",
    "response_body",
    "stream",
    "client_version"
  ],
  "links": {
    "documentation": "https://token.3dpclub.com/docs",
    "console": "https://token.3dpclub.com/panel",
    "security": "https://token.3dpclub.com/security",
    "markdown": "https://token.3dpclub.com/docs/ai.md",
    "json": "https://token.3dpclub.com/docs/ai.json"
  },
  "notice": "服务档位分阶段上线；控制台实时显示的价格与可选范围为最终有效规则。",
  "support": {
    "wechat": "aaa3dpclub",
    "email": "a18yuan@163.com",
    "notice": "反馈时请提供请求 ID、发生时间、模型 ID 和错误码，不要发送完整 API Key 或敏感对话。"
  }
}