接口
认证
使用会话 Cookie 认证,或携带Authorization: Bearer <api-key>。
路径参数
string
required
来自列出重放响应的唯一重放标识符。
响应
string
分配给新重放请求的标识符。
object
当前配置产生的路由决策。
object
重放请求产生的下游 provider 响应。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
curl -X POST "https://router.example.com/v1/router/replay/req_9f3a2b/reroute" \
-H "Authorization: Bearer <api-key>"
{
"new_id": "req_7a4e1f",
"decision": {
"provider": "anthropic",
"model": "claude-3-5-sonnet-20241022",
"recipe": "semantic-router"
},
"response": {
"id": "msg_01example",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "Hello again!"},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 8,
"total_tokens": 18
}
}
}
针对当前的路由配置重放一次捕获到的咏唱引擎 ROUTER 请求,以比较决策与响应。
curl -X POST "https://router.example.com/v1/router/replay/req_9f3a2b/reroute" \
-H "Authorization: Bearer <api-key>"
{
"new_id": "req_7a4e1f",
"decision": {
"provider": "anthropic",
"model": "claude-3-5-sonnet-20241022",
"recipe": "semantic-router"
},
"response": {
"id": "msg_01example",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "Hello again!"},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 8,
"total_tokens": 18
}
}
}
POST /v1/router/replay/{id}/reroute
Authorization: Bearer <api-key>。
curl -X POST "https://router.example.com/v1/router/replay/req_9f3a2b/reroute" \
-H "Authorization: Bearer <api-key>"
{
"new_id": "req_7a4e1f",
"decision": {
"provider": "anthropic",
"model": "claude-3-5-sonnet-20241022",
"recipe": "semantic-router"
},
"response": {
"id": "msg_01example",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "Hello again!"},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 8,
"total_tokens": 18
}
}
}
Was this page helpful?