88API88API
使用指南AI 应用API 文档帮助支持
接口模块使用指南

公共信息模块

功能说明

接口前缀统一为 https://88api.ai

提供无需登录或普通用户即可访问的公共信息,包括模型列表、定价信息、公告内容等。

🔐 无需鉴权

获取公告栏内容

  • 接口名称:获取公告栏内容
  • HTTP 方法:GET
  • 路径:/api/notice
  • 鉴权要求:公开
  • 功能简介:获取系统公告内容,支持 Markdown 格式

💡 请求示例:

const response = await fetch('/api/notice', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json'
  }
});
const data = await response.json();

✅ 成功响应示例:

{
  "success": true,
  "message": "",
  "data": "# 系统公告\n\n欢迎使用88API系统!"
}

❗ 失败响应示例:

{
  "success": false,
  "message": "获取公告失败"
}

🧾 字段说明:

data (字符串): 公告内容,支持 Markdown 格式

关于页面信息

  • 接口名称:关于页面信息
  • HTTP 方法:GET
  • 路径:/api/about
  • 鉴权要求:公开
  • 功能简介:获取关于页面的自定义内容

💡 请求示例:

const response = await fetch('/api/about', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json'
  }
});
const data = await response.json();

✅ 成功响应示例:

{
  "success": true,
  "message": "",
  "data": "# 关于我们\n\n88API 是面向开发者与企业的 AI 模型接口聚合平台..."
}

❗ 失败响应示例:

{
  "success": false,
  "message": "获取关于信息失败"
}

🧾 字段说明:

data (字符串): 关于页面内容,支持 Markdown 格式或 URL 链接

首页自定义内容

  • 接口名称:首页自定义内容
  • HTTP 方法:GET
  • 路径:/api/home_page_content
  • 鉴权要求:公开
  • 功能简介:获取首页的自定义内容,可以是 Markdown 文本或 iframe URL

💡 请求示例:

const response = await fetch('/api/home_page_content', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json'
  }
});
const data = await response.json();

✅ 成功响应示例:

{
  "success": true,
  "message": "",
  "data": "# 欢迎使用88API\n\n一个 API Key 调用多家模型..."
}

❗ 失败响应示例:

{
  "success": false,
  "message": "获取首页内容失败"
}

🧾 字段说明:

data (字符串): 首页内容,可以是 Markdown 文本或以"https://"开头的 URL 链接

模型倍率配置

  • 接口名称:模型倍率配置
  • HTTP 方法:GET
  • 路径:/api/ratio_config
  • 鉴权要求:公开
  • 功能简介:获取公开的模型倍率配置信息

💡 请求示例:

const response = await fetch('/api/ratio_config', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json'
  }
});
const data = await response.json();

✅ 成功响应示例:

{
  "success": true,
  "data": {
    "model_ratio": {
      "gpt-5.5": 1.0,
      "claude-sonnet-5-5": 1.5,
      "gemini-3.5-flash": 0.15
    },
    "completion_ratio": {
      "gpt-5.5": 8.0,
      "claude-sonnet-5-5": 5.0
    },
    "model_price": {
      "deepseek-v4-flash": 0.002
    }
  }
}

❗ 失败响应示例:

{
  "success": false,
  "message": "获取倍率配置失败"
}

🧾 字段说明:

data (对象): 倍率配置信息

  • model_ratio (对象): 模型倍率映射,键为模型名,值为倍率数值
  • completion_ratio (对象): 补全倍率映射
  • model_price (对象): 模型价格映射,键为模型名,值为价格(美元)

价格与套餐信息

  • 接口名称:价格与套餐信息
  • HTTP 方法:GET
  • 路径:/api/pricing
  • 鉴权要求:可匿名/用户
  • 功能简介:获取模型定价信息、分组倍率和可用分组

💡 请求示例:

const response = await fetch('/api/pricing', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer your_token', // 可选,登录用户可获得更详细信息
    'New-Api-User': 'your_user_id' // 可选
  }
});
const data = await response.json();

✅ 成功响应示例:

{
  "success": true,
  "data": [
    {
      "model_name": "gpt-5.5",
      "enable_group": ["default", "vip"],
      "model_ratio": 1.0,
      "completion_ratio": 1.0,
      "model_price": 0.002,
      "quota_type": 1,
      "description": "GPT-5.5 模型",
      "vendor_id": 1,
      "supported_endpoint_types": [1, 2]
    }
  ],
  "vendors": [
    {
      "id": 1,
      "name": "OpenAI",
      "description": "OpenAI官方模型",
      "icon": "openai.png"
    }
  ],
  "group_ratio": {
    "default": 1.0,
    "vip": 0.8
  },
  "usable_group": {
    "default": "默认分组",
    "vip": "VIP分组"
  },
  "supported_endpoint": {
    "1": {"method": "POST", "path": "/v1/chat/completions"},
    "2": {"method": "POST", "path": "/v1/responses"}
  },
  "auto_groups": ["default"]
}

❗ 失败响应示例:

{
  "success": false,
  "message": "获取定价信息失败"
}

🧾 字段说明:

  • data (数组): 模型定价信息列表

    • model_name (字符串): 模型名称
    • enable_group (数组): 可用分组列表
    • model_ratio (数字): 模型倍率
    • completion_ratio (数字): 补全倍率
    • model_price (数字): 模型价格(美元)
    • quota_type (数字): 计费类型,0=倍率计费,1=价格计费
    • description (字符串): 模型描述
    • vendor_id (数字): 供应商 ID
    • supported_endpoint_types (数组): 支持的端点类型
  • vendors (数组): 供应商信息列表

    • id (数字): 供应商 ID
    • name (字符串): 供应商名称
    • description (字符串): 供应商描述
    • icon (字符串): 供应商图标
  • group_ratio (对象): 分组倍率映射

  • usable_group (对象): 可用分组映射

  • supported_endpoint (对象): 支持的端点信息

  • auto_groups (数组): 自动分组列表

🔐 用户鉴权

获取可用模型列表

  • 接口名称:获取可用模型列表
  • HTTP 方法:GET
  • 路径:/api/models
  • 鉴权要求:用户
  • 功能简介:获取当前用户可访问的 AI 模型列表,可用于在页面上展示

💡 请求示例:

const response = await fetch('/api/models', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer your_user_token',
    'New-Api-User': 'your_user_id'
  }
});
const data = await response.json();

✅ 成功响应示例:

{
  "success": true,
  "data": {
    "1": ["gpt-5.5", "deepseek-v4-flash"],
    "14": ["claude-sonnet-5-5"],
    "24": ["gemini-3.5-flash"]
  }
}

❗ 失败响应示例:

{
  "success": false,
  "message": "未授权访问"
}

🧾 字段说明:

data (对象): 按类型分组的可用模型

  • 键 (字符串): 内部类型编号,客户端可忽略
  • 值 (数组): 可用的模型名称列表