omni-agents-a2a

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<!-- generated by src/lib/agentSkills/generator.ts; manual edits will be overwritten -->
<!-- 由 src/lib/agentSkills/generator.ts 生成;手动修改将被覆盖 -->

Overview

概述

Interact with OmniRoute via JSON-RPC 2.0 agent-to-agent protocol. 6 built-in A2A skills: smart-routing, quota-management, provider-discovery, cost-analysis, health-report, list-capabilities.
通过 JSON-RPC 2.0 Agent-to-Agent 协议与 OmniRoute 交互。内置 6 个 A2A skill:smart-routing、quota-management、provider-discovery、cost-analysis、health-report、list-capabilities。

Authentication

身份验证

All requests require a valid Bearer token or session cookie. Obtain a token via
POST /api/auth/login
or configure
REQUIRE_API_KEY=false
for local development.
所有请求都需要有效的 Bearer token 或 session cookie。可通过
POST /api/auth/login
获取 token,或在本地开发环境中配置
REQUIRE_API_KEY=false
。

Endpoints

Endpoints

No endpoints mapped for this area yet.
此区域尚未映射 endpoint。

Payloads

Payload

See the full OpenAPI specification at
GET /api/openapi/spec
or
docs/openapi.yaml
for detailed request/response schemas.
<!-- skill:custom-start --> <!-- Migrated from skills/omniroute-a2a/SKILL.md (preserved curated content) -->
有关详细的请求/响应 schema,请参阅
GET /api/openapi/spec
处的完整 OpenAPI 规范或
docs/openapi.yaml
。
<!-- skill:custom-start --> <!-- 从 skills/omniroute-a2a/SKILL.md 迁移而来(保留精选内容) -->

OmniRoute — A2A Protocol

OmniRoute — A2A 协议

Requires
OMNIROUTE_URL
and
OMNIROUTE_KEY
. See entry-point SKILL for setup.
OmniRoute publishes an Agent Card at
/.well-known/agent.json
and accepts JSON-RPC 2.0 calls at
/a2a
.
需要配置
OMNIROUTE_URL
和
OMNIROUTE_KEY
。有关设置,请参阅入口 SKILL。
OmniRoute 在
/.well-known/agent.json
发布 Agent Card,并接受发往
/a2a
的 JSON-RPC 2.0 调用。

Discovery

发现

bash
curl $OMNIROUTE_URL/.well-known/agent.json
Returns Agent Card with skills, endpoints, auth scheme.
bash
curl $OMNIROUTE_URL/.well-known/agent.json
返回包含 skills、endpoints 和认证方案的 Agent Card。

Available skills

可用 skills

SkillPurpose
smart-routing
Given a prompt, recommends best provider/model combo
quota-management
Reports quota balance for given provider/account
provider-discovery
Lists providers matching capability filters (vision, JSON mode, tools, max-context)
cost-analysis
Estimates cost for a given request shape
health-report
Returns system health (circuit states, latencies, errors)
Skill用途
smart-routing
根据给定的 prompt,推荐最佳 provider/model 组合
quota-management
报告指定 provider/account 的配额余额
provider-discovery
列出符合能力筛选条件的 providers(vision、JSON mode、tools、max-context)
cost-analysis
估算给定请求形式的成本
health-report
返回系统健康状态(circuit 状态、延迟和错误)

Call example (JSON-RPC 2.0)

调用示例(JSON-RPC 2.0)

bash
curl -X POST $OMNIROUTE_URL/a2a \
  -H "Authorization: Bearer $OMNIROUTE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tasks/send",
    "params": {
      "skillId": "smart-routing",
      "input": { "prompt_length": 4000, "tools": true, "vision": false }
    },
    "id": 1
  }'
bash
curl -X POST $OMNIROUTE_URL/a2a \
  -H "Authorization: Bearer $OMNIROUTE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tasks/send",
    "params": {
      "skillId": "smart-routing",
      "input": { "prompt_length": 4000, "tools": true, "vision": false }
    },
    "id": 1
  }'

Response shape

响应结构

json
{
  "jsonrpc": "2.0",
  "result": {
    "taskId": "...",
    "status": "completed",
    "output": { "recommended_combo": "...", "reasoning": "..." }
  },
  "id": 1
}
json
{
  "jsonrpc": "2.0",
  "result": {
    "taskId": "...",
    "status": "completed",
    "output": { "recommended_combo": "...", "reasoning": "..." }
  },
  "id": 1
}

Errors

错误

  • -32600
    → invalid request (bad JSON-RPC envelope)
  • -32601
    → method not found (check
    method
    field)
  • -32602
    → invalid params (check
    skillId
    against Agent Card)
  • 401
    → missing/invalid
    OMNIROUTE_KEY
  • -32600
    → 请求无效(JSON-RPC envelope 无效)
  • -32601
    → 未找到方法(检查
    method
    字段)
  • -32602
    → 参数无效(根据 Agent Card 检查
    skillId
    )
  • 401
    → 缺少或无效的
    OMNIROUTE_KEY

Reference

参考