API 文档
欢迎使用 API 服务平台,以下为可用的接口文档。
GET
/api/v1/user/info
获取当前登录用户的基本信息。需要携带 API Key 进行认证。
| 认证方式 | Bearer Token / API Key |
|---|---|
| 返回格式 | JSON |
响应示例:
{
"code": 200,
"message": "success",
"data": {
"id": 1,
"email": "user@example.com",
"username": "testuser",
"created_at": "2024-01-01 00:00:00",
"last_login": "2024-01-15 10:30:00"
}
}
GET
/api/v1/stats
获取用户的 API 调用统计信息。
| 参数 | 类型 | 说明 |
|---|---|---|
| period | string | 统计周期:today, week, month(默认 today) |
响应示例:
{
"code": 200,
"data": {
"total_calls": 1523,
"today_calls": 87,
"success_rate": 99.8,
"avg_response_time": 124
}
}
POST
/api/v1/key/create
创建新的 API 密钥。
| 参数 | 类型 | 说明 |
|---|---|---|
| name | string | 密钥名称(必填) |
响应示例:
{
"code": 200,
"data": {
"api_key": "ak_xxxxxxxxxxxxxx",
"name": "My App Key",
"created_at": "2024-01-01 00:00:00"
}
}
GET
/api/v1/public-apis
获取所有可用的公共API列表。
| 参数 | 类型 | 说明 |
|---|---|---|
| category | int | 分类ID(可选) |
| search | string | 搜索关键词(可选) |
响应示例:
{
"code": 200,
"data": [
{
"id": 1,
"api_name": "ChatGPT API",
"description": "OpenAI提供的对话式AI接口",
"auth_type": "apiKey",
"https": true,
"cors": true,
"category_name": "人工智能"
}
]
}
更多接口正在开发中,敬请期待。
如有疑问请联系 support@api.mijims.cn
如有疑问请联系 support@api.mijims.cn