通过REST API访问您的端点。所有AI端点均为公开,无需身份验证。
执行端点
执行端点并返回包含使用指标的LLM响应。
GET /api/v1/ai/:orgPath/:projectName/:endpointName
POST /api/v1/ai/:orgPath/:projectName/:endpointName
仅获取提示
返回生成的提示,而不调用大语言模型。有助于调试。
GET /api/v1/ai/:orgPath/:projectName/:endpointName/prompt
POST /api/v1/ai/:orgPath/:projectName/:endpointName/prompt
响应格式
成功的响应包含大语言模型的输出和使用统计信息:
输出符合您输出模式的LLM结构化响应
usage.tokens_input使用的输入令牌数量
usage.tokens_output生成的输出令牌数量
usage.latency_ms请求延迟,单位为毫秒
使用量。预计费用(美分)预计费用(美分)
示例请求
curl -X POST https://api.shapeshyft.ai/api/v1/ai/my-org/my-project/classify \
-H "Content-Type: application/json" \
-d '{"text": "This is a great product!"}'示例回复
{
"success": true,
"data": {
"output": {
"sentiment": "positive",
"confidence": 0.95
},
"usage": {
"tokens_input": 42,
"tokens_output": 15,
"latency_ms": 523,
"estimated_cost_cents": 1
}
}
}