透過 REST API 存取您的端點。所有 AI 端點均公開,無需驗證。
執行端點
執行端點並傳回LLM回應及用量指標。
GET /api/v1/ai/:orgPath/:projectName/:endpointName
POST /api/v1/ai/:orgPath/:projectName/:endpointName
僅獲取提示
返回生成的提示,而不調用LLM。有利於除錯。
GET /api/v1/ai/:orgPath/:projectName/:endpointName/prompt
POST /api/v1/ai/:orgPath/:projectName/:endpointName/prompt
回應格式
成功的回應包含LLM輸出和使用統計資料:
輸出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
}
}
}