吾侪主题 – 专注wordpress及discuz

222

其他 GET ● 在线

服务介绍

核心特性

  • ✓ 高可用性保障(99.9% SLA)
  • ✓ 低延迟响应(平均<100ms)
  • ✓ 完善的文档和示例
  • ✓ 专业的技术支持
  • ✓ 灵活的计费方式

API端点

GET
http://wuchai.net/api/v1/ai/api

请求参数

参数名 类型 必填 说明
X-API-Key string API密钥(Header)
X-API-Secret string API密钥密文(Header)
具体业务参数请参考API文档

调用示例

# GET请求示例
curl -X GET \
  "http://wuchai.net/api/v1/ai/api?param=value" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "X-API-Secret: YOUR_API_SECRET"
// JavaScript示例
const axios = require('axios');

async function callAPI() {
  try {
    const response = await axios({
      method: 'get',
      url: 'http://wuchai.net/api/v1/ai/api',
      headers: {
        'X-API-Key': 'YOUR_API_KEY',
        'X-API-Secret': 'YOUR_API_SECRET'
      },
            params: {
        // 查询参数
      }
          });
    
    console.log(response.data);
  } catch (error) {
    console.error(error);
  }
}

callAPI();
# Python示例
import requests

def call_api():
    url = "http://wuchai.net/api/v1/ai/api"
    headers = {
        "X-API-Key": "YOUR_API_KEY",
        "X-API-Secret": "YOUR_API_SECRET"
    }
    
        params = {
        # 查询参数
    }
    response = requests.get(url, headers=headers, params=params)
        
    print(response.json())

if __name__ == "__main__":
    call_api()
<?php
// PHP示例
$url = "http://wuchai.net/api/v1/ai/api";

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'X-API-Key: YOUR_API_KEY',
    'X-API-Secret: YOUR_API_SECRET'
));


$response = curl_exec($ch);
$result = json_decode($response, true);

print_r($result);
curl_close($ch);
?>

响应示例

成功响应 (200)

{
  "success": true,
  "data": {
    // 返回数据
  },
  "meta": {
    "request_id": "req_xxxxxx",
    "response_time": 0.123
  }
}

错误响应 (401)

{
  "success": false,
  "error": "无效的API密钥",
  "code": "INVALID_API_KEY"
}