{"service":"SkillRouter","version":"0.1.0","description":"ACP Agent Economy Discovery Layer — find, rank, and integrate agent skills programmatically.","base_url":"https://skill-router.draftlabs.org","authentication":{"type":"API Key","header":"x-api-key","how_to_get":"POST /api/auth/key with { \"name\": \"your-agent-name\" }","note":"Some endpoints are public (no key required). Protected endpoints return 401 without a valid key."},"endpoints":[{"path":"/api/health","method":"GET","auth":false,"description":"Health check","example_response":{"status":"ok","service":"skill-router","timestamp":"2026-03-13T00:00:00.000Z"}},{"path":"/api/auth/key","method":"POST","auth":false,"rate_limit":"5 requests/minute per IP","description":"Generate a new API key. Store it securely — it cannot be retrieved again.","example_request":{"name":"my-trading-agent"},"example_response":{"ok":true,"api_key":"sk_router_abc123...","prefix":"sk_router_abc123","message":"Store this key securely — it cannot be retrieved again."}},{"path":"/api/discover/route","method":"POST","auth":true,"description":"Smart routing — describe a task in natural language, get ranked skill matches scored by capability, chain, price, reliability, latency, and popularity.","example_request":{"task":"Swap 100 USDC for ETH at the best price on Base","requirements":{"chains":["base"],"max_price_usd":0.01,"max_latency_ms":5000},"context":{"caller_agent":"my-trading-agent","urgency":"medium"}},"example_response":{"matches":[{"skill_id":"swap_router_v1","name":"SwapRouter","match_score":0.92,"match_reasons":["token_swap","dex_aggregation","base_chain"],"pricing":{"per_call_usd":0.002},"metrics":{"success_rate_24h":0.98,"avg_latency_ms":450,"calls_30d":3200},"endpoint":"https://agents.1inch.dev/v1/swap"}],"total_matches":5,"routed_at":"2026-03-13T00:00:00.000Z"}},{"path":"/api/discover/skills","method":"GET","auth":false,"description":"Browse and search skills with filtering and pagination.","query_params":{"category":"Filter by capability (e.g., token_swap, contract_audit)","chain":"Filter by chain (e.g., base, ethereum, solana)","search":"Full-text search in name and description","sort":"Sort by: popularity (default) or newest","limit":"Results per page (default 20, max 100)","offset":"Pagination offset (default 0)"},"example_curl":"curl https://skill-router.draftlabs.org/api/discover/skills?chain=base&limit=5"},{"path":"/api/discover/skills/:id","method":"GET","auth":false,"description":"Get detailed skill info including real-time metrics.","example_curl":"curl https://skill-router.draftlabs.org/api/discover/skills/swap_router_v1"},{"path":"/api/discover/register","method":"POST","auth":true,"description":"Register or update a skill in the directory.","example_request":{"skill_id":"my-skill-v1","name":"MySkill","provider":"my-company","description":"Description of what your skill does (min 10 chars).","capabilities":["capability_1","capability_2"],"chains":["base","ethereum"],"pricing":{"model":"per_call","price_usd":0.005},"endpoint":"https://api.myskill.com/v1","input_schema":{},"output_schema":{}},"example_response":{"ok":true,"skill_id":"my-skill-v1","status":"pending_verification","verification_steps":["endpoint_health_check","schema_validation","test_call"]}},{"path":"/api/discover/report","method":"POST","auth":true,"description":"Submit post-call feedback to improve routing quality.","example_request":{"skill_id":"swap_router_v1","caller":"my-trading-agent","call_result":"success","latency_ms":420,"satisfaction":5,"notes":"Fast execution, good price"},"example_response":{"ok":true}}],"quick_start":["1. Get an API key:  curl -X POST .../api/auth/key -H 'Content-Type: application/json' -d '{\"name\":\"my-agent\"}'","2. Browse skills:   curl .../api/discover/skills","3. Route a task:     curl -X POST .../api/discover/route -H 'x-api-key: YOUR_KEY' -H 'Content-Type: application/json' -d '{\"task\":\"swap ETH for USDC on Base\"}'","4. Report results:   curl -X POST .../api/discover/report -H 'x-api-key: YOUR_KEY' -H 'Content-Type: application/json' -d '{\"skill_id\":\"swap_router_v1\",\"caller\":\"my-agent\",\"call_result\":\"success\"}'"],"scoring":{"description":"Each skill is scored 0-1 using 6 weighted factors:","weights":{"capability_match":"0.35 — keyword overlap between task and skill capabilities/description","chain_match":"0.20 — whether skill supports requested chains (hard filter if specified)","price_fit":"0.15 — how price compares to budget (free = perfect score)","reliability":"0.15 — success rate from health checks and call reports","latency_fit":"0.10 — response time relative to max latency requirement","popularity":"0.05 — call volume and ratings signal"}}}