SuperAPI AI 工具集

iblai-api-external-service-proxy

编程与开发

查看项目

更新于 10-15 22:16

技能介绍

用途:该技能提供 ibl.ai 的 External Service Proxy,作为服务无关网关,让客户端经 ibl.ai 统一调用 ElevenLabs、HeyGen 等第三方 AI 提供商,而不直接访问它们。提供商 API 密钥按组织存于服务端并注入上游,客户端不持有密钥。

主要能力:先发现服务端点,再调用动作。发现接口为 GET …/orgs/{org}/services/(列出已启用服务)和 GET …/orgs/{org}/services/{service}/(服务详情,含 credential_policy、credential_schema、endpoints)。调用接口为 POST …/orgs/{org}/services/{service}/{action}/,请求信封含 body、query、headers、path_params 四个可选键,原样转发上游。支持 request_mode(raw/json/multipart/binary)与 response_mode(json/passthrough/stream);multipart 需发送真实表单请求;path_template 占位符须全部在 path_params 提供,否则 400。async 动作(如 HeyGen generate-*、translate-video、ElevenLabs create-dubbing)返回 job/video id,需轮询对应 status 动作。

必要用法:基础地址 https://api.iblai.app/dm/api/ai-proxy/orgs/{org},{org} 取自 $IBLAI_ORG。每个请求带 Authorization: Api-Token $IBLAI_API_KEY。先运行 /iblai-api-login 获取 $IBLAI_ORG/$IBLAI_API_KEY;提供商密钥由平台管理员经 /iblai-api-integration 或后台配置。可用 curl 发现并调用,示例: curl "https://api.iblai.app/dm/api/ai-proxy/orgs/$IBLAI_ORG/services/"
-H "Authorization: Api-Token $IBLAI_API_KEY" curl -X POST "https://api.iblai.app/dm/api/ai-proxy/orgs/$IBLAI_ORG/services/elevenlabs/tts/"
-H "Authorization: Api-Token $IBLAI_API_KEY" -H "Content-Type: application/json"
-d '{"path_params":{"voice_id":"21m00Tcm4TlvDq8ikWAM"},"body":{"text":"Hello, this is a test.","model_id":"eleven_multilingual_v2","voice_settings":{"stability":0.5,"similarity_boost":0.5}}}'
--output speech.mp3

适用场景与限制:适合需要统一网关调用多家第三方 AI 服务的平台管理员。三个端点均需平台管理员令牌,非管理员 403,无令牌 401;未启用或未配置凭据返回 404。凭据解析遵循 credential_policy,默认两个服务为仅租户密钥(allow_platform_key=false,无回退)。passthrough 响应为原始字节,应写入文件而非按 JSON 解析。调用 tts、generate-、translate-、dubbing、delete 等计费或破坏性动作前应先与用户确认。错误体以 detail 或 error 为键,需读取 detail || error;429 为上游限流,建议指数退避重试。HeyGen 的 generate-* 可用 test:true 避免消耗额度。其余价格、配额等细节未提供。