AI API 代理

跑在 EdgeOne 边缘函数上的反向代理,路径第一段决定上游,方法 / 请求头 / 请求体 / 响应原样透传(含 SSE 流式)。

路径映射

请求路径转发目标
/cmdc/*https://api.commandcode.ai/*
/cline/*https://api.cline.bot/*
/cmdc/v1/messages?beta=true → https://api.commandcode.ai/v1/messages?beta=true

使用方式

把客户端里的 Base URL 换成代理域名加前缀即可:

https://api.commandcode.ai  →  https://<你的域名>/cmdc
https://api.cline.bot       →  https://<你的域名>/cline
curl https://<你的域名>/cline/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"your-model","messages":[{"role":"user","content":"你好"}],"stream":true}'
const client = new OpenAI({ baseURL: "https://<你的域名>/cline/v1", apiKey: API_KEY });

限制