{"openapi":"3.1.0","info":{"title":"DepScope — Package Intelligence API","summary":"Free, open API that tells AI agents if a package is safe, maintained, and up-to-date before they suggest installing it.","description":"# DepScope\n\nPackage Intelligence for AI coding agents. **8.5M+ packages** across **19 ecosystems** (npm, PyPI, Cargo, Go, Maven, NuGet, RubyGems, Composer, Pub, Hex, Swift, CocoaPods, CPAN, Hackage, CRAN, Conda, Homebrew, Julia, JSR), **250,000+ CVEs** enriched with CISA KEV + EPSS. Three verticals on one shared infrastructure:\n\n1. **Package health** — /api/check for full report, /api/prompt for LLM-optimized text (~74% smaller), /api/alternatives for replacements, /api/scan to audit a lockfile.\n2. **Error -> fix database** — POST a stack trace to /api/error/resolve.\n3. **Stack compatibility matrix** — /api/compat?stack=next@16,react@19.\n\n## Quick start (for agents)\n\n    curl https://depscope.dev/api/prompt/npm/react\n\n## MCP server\n\nZero-install remote URL: `https://mcp.depscope.dev/mcp`. 22 tools. Install in one line: `claude mcp add depscope https://mcp.depscope.dev/mcp`.\n\n## Rate limits\n\n100 req/min anonymous, 200/min for whitelisted AI UAs (ClaudeBot, GPTBot, Cursor, MCP-Client, …). Optional API keys for higher limits.\n\nSave tokens, save energy, ship safer code.","termsOfService":"https://depscope.dev/terms","contact":{"name":"DepScope support","url":"https://depscope.dev/","email":"depscope@cuttalo.com"},"license":{"name":"MIT","identifier":"MIT","url":"https://github.com/cuttalo/depscope/blob/main/LICENSE"},"version":"0.7.0"},"servers":[{"url":"https://depscope.dev","description":"Production"}],"paths":{"/api/auth/magic-link":{"post":{"tags":["auth"],"summary":"Send Magic Link","operationId":"send_magic_link_api_auth_magic_link_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/magic-link/request":{"post":{"tags":["auth"],"summary":"Send Magic Link","operationId":"send_magic_link_api_auth_magic_link_request_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/magic-link/verify":{"post":{"tags":["auth"],"summary":"Magic Link Verify Post","operationId":"magic_link_verify_post_api_auth_magic_link_verify_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/verify":{"get":{"tags":["auth"],"summary":"Verify Magic Link","description":"Legacy GET verify: sets cookie and redirects to /dashboard.","operationId":"verify_magic_link_api_auth_verify_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/me":{"get":{"tags":["auth"],"summary":"Get Me","operationId":"get_me_api_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/logout":{"post":{"tags":["auth"],"summary":"Logout","operationId":"logout_api_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/usage":{"get":{"tags":["auth"],"summary":"Get Usage","operationId":"get_usage_api_auth_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/keys":{"get":{"tags":["auth"],"summary":"List Api Keys","operationId":"list_api_keys_api_auth_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["auth"],"summary":"Create Api Key","operationId":"create_api_key_api_auth_keys_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/keys/{key_id}":{"delete":{"tags":["auth"],"summary":"Revoke Api Key","operationId":"revoke_api_key_api_auth_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/missions":{"get":{"tags":["missions"],"summary":"List Missions","operationId":"list_missions_api_admin_missions_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["missions"],"summary":"Create Mission","operationId":"create_mission_api_admin_missions_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissionCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/missions/profiles":{"get":{"tags":["missions"],"summary":"List Profiles","operationId":"list_profiles_api_admin_missions_profiles_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/missions/prompts":{"get":{"tags":["missions"],"summary":"List Prompts","operationId":"list_prompts_api_admin_missions_prompts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/missions/prompts/{name}/raw":{"get":{"tags":["missions"],"summary":"Get Prompt Raw","operationId":"get_prompt_raw_api_admin_missions_prompts__name__raw_get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/missions/budget":{"get":{"tags":["missions"],"summary":"Budget","operationId":"budget_api_admin_missions_budget_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/missions/{mission_id}":{"get":{"tags":["missions"],"summary":"Get Mission","operationId":"get_mission_api_admin_missions__mission_id__get","parameters":[{"name":"mission_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Mission Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/missions/{mission_id}/stream":{"get":{"tags":["missions"],"summary":"Stream Mission","operationId":"stream_mission_api_admin_missions__mission_id__stream_get","parameters":[{"name":"mission_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Mission Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/missions/{mission_id}/run":{"post":{"tags":["missions"],"summary":"Run Mission","operationId":"run_mission_api_admin_missions__mission_id__run_post","parameters":[{"name":"mission_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Mission Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/missions/{mission_id}/kill":{"post":{"tags":["missions"],"summary":"Kill Mission","operationId":"kill_mission_api_admin_missions__mission_id__kill_post","parameters":[{"name":"mission_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Mission Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/missions/flags":{"post":{"tags":["missions"],"summary":"Set Flag","operationId":"set_flag_api_admin_missions_flags_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/missions/proposals/list":{"get":{"tags":["missions"],"summary":"List Proposals","operationId":"list_proposals_api_admin_missions_proposals_list_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/missions/proposals/{proposal_id}/decide":{"post":{"tags":["missions"],"summary":"Decide Proposal","operationId":"decide_proposal_api_admin_missions_proposals__proposal_id__decide_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Proposal Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProposalDecision"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/missions/proposals/{proposal_id}/launch":{"post":{"tags":["missions"],"summary":"Launch From Proposal","description":"Approve + auto-create Builder mission from a proposal payload.","operationId":"launch_from_proposal_api_admin_missions_proposals__proposal_id__launch_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Proposal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mcp":{"get":{"tags":["mcp"],"summary":"Mcp Info","operationId":"mcp_info_mcp_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["mcp"],"summary":"Mcp Endpoint","operationId":"mcp_endpoint_mcp_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/check_bulk":{"post":{"tags":["verticals-v2"],"summary":"Check Bulk","description":"Pre-flight existence + risk check for up to 100 (ecosystem, package) pairs.\n\nDB-only: no live registry fetch. Returns a status per item:\n  - `stdlib`:             language builtin (no install needed)\n  - `malicious`:          actively flagged by OSV/OpenSSF\n  - `typosquat_suspect`:  matches a typosquat pattern (pre-computed or runtime)\n  - `historical_incident`: previously compromised (check current version)\n  - `exists`:             known safe in our index\n  - `unknown`:            not in our index — caller may fall back to /api/check\nTypical latency: <100ms for 100 items.","operationId":"check_bulk_api_check_bulk_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_BulkRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Check Bulk Api Check Bulk Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/install/{ecosystem}/{package}":{"get":{"tags":["verticals-v2"],"summary":"Install Command","description":"Canonical install commands for ecosystem+package across common tools.\n\nSaves agents 100-200 tokens of \"how do I install this\" reasoning and\nprevents syntax hallucinations (pnpm flags, pyproject.toml quoting,\nMaven XML structure).\n\nIf `version` is omitted, DepScope resolves the latest from its index.","operationId":"install_command_api_install__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}},{"name":"version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Install Command Api Install  Ecosystem   Package  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pin_safe/{ecosystem}/{package}":{"get":{"tags":["verticals-v2"],"summary":"Pin Safe","description":"Return the highest version whose known CVEs are below the given severity.\n\n- `min_severity=high` (default) excludes versions with any critical or high CVE.\n- `constraint` accepts npm-style `^X.Y.Z`, `~X.Y.Z`, `>=X`, or exact `X.Y.Z`.\n- `include_prerelease=false` (default) skips alpha/beta/rc/canary/nightly.\n- `limit_checked` caps how many versions we walk through (newest-first).\n\nSources: versions table → packages.data_json.versions → live registry.","operationId":"pin_safe_api_pin_safe__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}},{"name":"min_severity","in":"query","required":false,"schema":{"type":"string","default":"high","title":"Min Severity"}},{"name":"constraint","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Constraint"}},{"name":"limit_checked","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit Checked"}},{"name":"include_prerelease","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Prerelease"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Pin Safe Api Pin Safe  Ecosystem   Package  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sameas/{ecosystem}/{package}":{"get":{"tags":["sameas"],"summary":"Sameas","operationId":"sameas_api_sameas__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/live/malicious":{"get":{"tags":["discover"],"summary":"Live Malicious Feed","description":"Real-time stream of newly published malicious package advisories.\n\nPublic endpoint, no auth. Use this to wire a webhook-style supply-chain\nmonitor in any language that speaks SSE.\n\nEvents:\n  - hello: connection ack\n  - ping: every 30s to keep the connection alive\n  - advisory: {ecosystem, package, vuln_id, severity, summary, published_at}\n\nExample (bash):\n  curl -N https://depscope.dev/api/live/malicious","operationId":"live_malicious_feed_api_live_malicious_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/benchmark/hallucinations":{"get":{"tags":["discover"],"summary":"Benchmark Hallucinations Corpus","description":"Return the hallucination corpus as JSON, sorted by hit_count desc.\n\nLICENSE: CC-BY-NC-SA 4.0 — attribution required, non-commercial use only.\nCommercial use (including AI training for commercial models, SaaS, paid products):\ncontact licensing@depscope.dev for written permission.\n\nCitation: \"Rubino, V. (2026). DepScope hallucinations dataset.\n          https://depscope.dev/benchmark — Licensed under CC-BY-NC-SA 4.0\"\n\nQuery params:\n  ?ecosystem=npm   (filter to one ecosystem)\n  ?limit=100       (1..200, capped to prevent bulk scraping; contact for full export)","operationId":"benchmark_hallucinations_corpus_api_benchmark_hallucinations_get","parameters":[{"name":"ecosystem","in":"query","required":false,"schema":{"type":"string","title":"Ecosystem"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/benchmark/verify":{"get":{"tags":["discover"],"summary":"Benchmark Verify","description":"Check whether a given (ecosystem, package) is in the hallucination corpus.\n\nUseful for:\n  - Benchmark runners: verify an agent's output\n  - Agent evaluation harnesses: label outputs\n\nReturns {is_hallucinated, in_corpus, in_registry, verdict, evidence,\n         likely_real_alternative}.\n\nis_hallucinated = in_corpus AND NOT in_registry.","operationId":"benchmark_verify_api_benchmark_verify_get","parameters":[{"name":"ecosystem","in":"query","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"query","required":true,"schema":{"type":"string","title":"Package"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/benchmark/results":{"get":{"tags":["discover"],"summary":"Benchmark Results","description":"Latest paper-grade benchmark results.\n\nReturns a JSON document with hallucination hit-rate by model x condition,\nplus per-entry verdicts. See /benchmark for the human-readable page.","operationId":"benchmark_results_api_benchmark_results_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/status":{"get":{"tags":["discovery"],"summary":"Public Status","description":"Public status probe. Returns {ok, uptime_s, components, stats, version}.\n\nFast path — no heavy joins. Targets <50ms response. Safe to hammer.","operationId":"public_status_api_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/":{"get":{"tags":["discovery"],"summary":"Root","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/migration/{ecosystem}/{from_pkg}/{to_pkg}":{"get":{"tags":["ai"],"summary":"Get Migration Path","description":"Return a prescriptive migration from `from_pkg` to `to_pkg` with:\n- rationale (why migrate)\n- code diff examples (before/after snippets)\n- breaking changes to handle manually\n- estimated effort in minutes\nIf no curated path exists, we still return a minimal scaffold built from\nlive check data of both packages.","operationId":"get_migration_path_api_migration__ecosystem___from_pkg___to_pkg__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"from_pkg","in":"path","required":true,"schema":{"type":"string","title":"From Pkg"}},{"name":"to_pkg","in":"path","required":true,"schema":{"type":"string","title":"To Pkg"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/brief/{ecosystem}/{package}":{"get":{"tags":["ai"],"summary":"Ai Brief","description":"AI-native compact package brief. ~300 tokens, prescriptive format.\nDrop this directly in your LLM system prompt.","operationId":"ai_brief_api_ai_brief__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/stack":{"post":{"tags":["ai"],"summary":"Ai Stack","description":"Audit a whole dependency stack in one call. Returns action items.\nDesigned for AI agents evaluating a proposed install list before executing.","operationId":"ai_stack_api_ai_stack_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_StackRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/check/{ecosystem}/{package}":{"get":{"tags":["packages"],"summary":"Check Package","description":"Full package intelligence. Returns everything: health, vulns, versions, recommendation.\n100% free. No auth. No limits on data. Use it.","operationId":"check_package_api_check__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}},{"name":"version","in":"query","required":false,"schema":{"type":"string","title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/prompt/{ecosystem}/{package}":{"get":{"tags":["packages"],"summary":"Get Prompt","description":"LLM-optimized plain-text context for a package.\n\nToken-efficient, decision-ready, ~500 tokens. Use this from AI agents\ninstead of /api/check to save context and tokens.","operationId":"get_prompt_api_prompt__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}},{"name":"version","in":"query","required":false,"schema":{"type":"string","title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/health/{ecosystem}/{package}":{"get":{"tags":["packages"],"summary":"Get Health","description":"Health score (0-100) + breakdown — same scoring as /api/check.\n\nThis endpoint returns only the health subset for cheaper consumption\n(badges, dashboards). Score MUST match /api/check since they share\nthe same _fetch_full_package + calculate_health_score path.","operationId":"get_health_api_health__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}},{"name":"version","in":"query","required":false,"schema":{"type":"string","title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/typosquat/{ecosystem}/{package}":{"get":{"tags":["packages"],"summary":"Check Typosquat","description":"Is this package name a typosquat of a popular one?\n\nReturns legitimate targets the name looks close to, with Levenshtein distance\nand popularity delta.","operationId":"check_typosquat_api_typosquat__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/malicious/{ecosystem}/{package}":{"get":{"tags":["packages"],"summary":"Check Malicious","description":"Is this package flagged as malicious by OpenSSF / OSV?\n\nDedicated fast-path for security gates (CI/CD pre-install hooks). Returns\n`is_malicious` + advisory id + historical-compromise hint when applicable.\nMainstream packages with >100k weekly downloads are heuristically flagged as\nlikely false-positives in the response (action=review_advisory).","operationId":"check_malicious_api_malicious__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/scorecard/{ecosystem}/{package}":{"get":{"tags":["packages"],"summary":"Get Scorecard","description":"OSS Scorecard (OpenSSF) security posture score 0-10 for the linked GitHub repo.","operationId":"get_scorecard_api_scorecard__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quality/{ecosystem}/{package}":{"get":{"tags":["packages"],"summary":"Get Quality","description":"Package quality signals: criticality score, download velocity, publish security (npm 2FA / PyPI Trusted Publishing).","operationId":"get_quality_api_quality__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/license/{ecosystem}/{package}":{"get":{"tags":["packages"],"summary":"Get License","description":"SPDX license of a single package + commercial-safety classification.\n\nReturns: `license` (SPDX), `class` (permissive / weak_copyleft / strong_copyleft / proprietary / unknown),\nplus `commercial_safe` and `copyleft` booleans. Cheap lookup on `packages.license` column.\n\nFor transitive-tree license aggregation, use /api/licenses (plural).","operationId":"get_license_api_license__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/provenance/{ecosystem}/{package}":{"get":{"tags":["packages"],"summary":"Get Provenance","description":"Best-effort: inspect registry metadata for provenance / signing signals.","operationId":"get_provenance_api_provenance__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/maintainer/trust/{platform}/{username}":{"get":{"tags":["verticals"],"summary":"Get Maintainer Trust","description":"Maintainer trust score (0-100) for a GitHub-style account.\n\nPlatform: currently 'github' only (extensible). Username: the repo_owner.\nAggregates all packages across ecosystems where this owner maintains,\nreturns a computed trust score + breakdown + top packages.\n\nPublic, cached 6h. No PII beyond public GitHub usernames.","operationId":"get_maintainer_trust_api_maintainer_trust__platform___username__get","parameters":[{"name":"platform","in":"path","required":true,"schema":{"type":"string","title":"Platform"}},{"name":"username","in":"path","required":true,"schema":{"type":"string","title":"Username"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/maintainers/{ecosystem}/{package}":{"get":{"tags":["packages"],"summary":"Get Maintainer Signals","description":"Maintainer trust signals: bus factor, primary author dominance, account age, ownership change.","operationId":"get_maintainer_signals_api_maintainers__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/vulns/{ecosystem}/{package}":{"get":{"tags":["packages"],"summary":"Get Vulns","description":"Vulnerabilities affecting the LATEST version only, enriched with CISA KEV + EPSS.","operationId":"get_vulns_api_vulns__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/versions/{ecosystem}/{package}":{"get":{"tags":["packages"],"summary":"Get Versions","description":"Version metadata for a package: latest + total count + recent list + deprecated flag.\n\nHeavier than /api/latest (which returns only the latest string). Use this when you\nneed the version history preview or total-versions count.","operationId":"get_versions_api_versions__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/history/{ecosystem}/{package}":{"get":{"tags":["packages"],"summary":"Get History Endpoint","description":"Last N days of health snapshot + trend direction (up/down/stable).\n\nData is populated by the daily cron /scripts/record_health_snapshot.py.\nMax 365 days; if the package is new the series will be shorter.","operationId":"get_history_endpoint_api_history__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":90,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tree/{ecosystem}/{package}":{"get":{"tags":["packages"],"summary":"Get Tree Endpoint","description":"Transitive dependency tree with health score per sub-dep.\n\nCached aggressively (24h) — expensive to build.","operationId":"get_tree_endpoint_api_tree__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}},{"name":"max_depth","in":"query","required":false,"schema":{"type":"integer","default":3,"title":"Max Depth"}},{"name":"max_deps","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Max Deps"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/licenses/{ecosystem}/{package}":{"get":{"tags":["packages"],"summary":"Get Licenses Endpoint","description":"Aggregated licenses across the transitive dependency tree.\n\nFlags GPL/AGPL/LGPL for commercial-safety review. Reuses the same tree cache.","operationId":"get_licenses_endpoint_api_licenses__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/error":{"get":{"tags":["errors"],"summary":"Search Error","description":"Search the error database by message (full-text + exact hash).\n\nAccepts ?q= (canonical) or ?code= (doc alias).","operationId":"search_error_api_error_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"code","in":"query","required":false,"schema":{"type":"string","default":"","title":"Code"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":5,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/error/resolve":{"post":{"tags":["errors"],"summary":"Resolve Error","description":"POST a stack trace or error message, get solutions back.","operationId":"resolve_error_api_error_resolve_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/error/popular":{"get":{"tags":["errors"],"summary":"List Errors Popular","description":"Top error patterns by votes, used for sitemap generation and indexing.","operationId":"list_errors_popular_api_error_popular_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":500,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/error/{error_hash}":{"get":{"tags":["errors"],"summary":"Get Error","description":"Get a specific error entry by its normalised-pattern SHA256.","operationId":"get_error_api_error__error_hash__get","parameters":[{"name":"error_hash","in":"path","required":true,"schema":{"type":"string","title":"Error Hash"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/compat":{"get":{"tags":["compat"],"summary":"Check Compatibility","description":"Check compatibility for a stack like 'next@16,react@19,prisma@6'.\n\nAccepts either ?stack= (canonical) or ?packages= (doc alias).","operationId":"check_compatibility_api_compat_get","parameters":[{"name":"stack","in":"query","required":false,"schema":{"type":"string","default":"","title":"Stack"}},{"name":"packages","in":"query","required":false,"schema":{"type":"string","default":"","title":"Packages"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["compat"],"summary":"Check Compatibility Post","operationId":"check_compatibility_post_api_compat_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/bugs/search":{"get":{"tags":["bugs"],"summary":"Search Bugs Endpoint","description":"Search the known-bugs database by text.","operationId":"search_bugs_endpoint_api_bugs_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bugs/{ecosystem}/{package}":{"get":{"tags":["bugs"],"summary":"Get Bugs","description":"Get known bugs for a package, optionally filtered by version.","operationId":"get_bugs_api_bugs__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}},{"name":"version","in":"query","required":false,"schema":{"type":"string","title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/breaking":{"get":{"tags":["breaking"],"summary":"List Breaking Sample","description":"Sample of most recent curated breaking changes across all packages.\n\nUsed by the /explore/breaking SSR page to show real examples\nwithout requiring the user to pick a package first.","operationId":"list_breaking_sample_api_breaking_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":12,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/breaking/{ecosystem}/{package}":{"get":{"tags":["breaking"],"summary":"Get Breaking","description":"Breaking changes for a package, optionally scoped to a version transition.\n\nExamples:\n  GET /api/breaking/npm/react\n  GET /api/breaking/npm/next?from_version=14&to_version=15\n  GET /api/breaking/pypi/pydantic?from_version=1&to_version=2","operationId":"get_breaking_api_breaking__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}},{"name":"from_version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Version"}},{"name":"to_version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bugs/popular":{"get":{"tags":["bugs"],"summary":"List Bugs Popular","description":"Top packages with recorded bugs, used for sitemap generation and indexing.","operationId":"list_bugs_popular_api_bugs_popular_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/compare/{ecosystem}/{packages_csv}":{"get":{"tags":["packages"],"summary":"Compare Packages","description":"Compare 2+ packages side by side.\nUsage: GET /api/compare/npm/express,fastify,hono\nReturns comparative table with health, vulns, downloads, last release.","operationId":"compare_packages_api_compare__ecosystem___packages_csv__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"packages_csv","in":"path","required":true,"schema":{"type":"string","title":"Packages Csv"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/scan":{"post":{"tags":["packages"],"summary":"Scan Dependencies","description":"Audit an entire project's dependencies in one shot.\nPOST body: {\"packages\": {\"express\": \"^4.0.0\", \"lodash\": \"^4.17.0\"}, \"ecosystem\": \"npm\"}\nOr: {\"packages\": {\"fastapi\": \">=0.100.0\", \"pydantic\": \"^2.0\"}, \"ecosystem\": \"pypi\"}","operationId":"scan_dependencies_api_scan_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/ecosystems":{"get":{"tags":["public"],"summary":"List Ecosystems","description":"List supported ecosystems with package counts, vulnerability counts and metadata.","operationId":"list_ecosystems_api_ecosystems_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/stats":{"get":{"tags":["public"],"summary":"Get Stats","description":"Public usage stats with stale-while-revalidate (60s fresh, 300s hard).\nBehind: /api/stats does 10 full-scan COUNT queries on 1.2M packages and\n~1M api_usage_public — without cache it saturates the DB.","operationId":"get_stats_api_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/.well-known/mcp.json":{"get":{"tags":["discovery"],"summary":"Mcp Manifest","description":"MCP server discovery manifest — emerging standard used by Claude / Cursor /\nWindsurf for one-click install. Mirrors the info in ai-plugin.json but shaped\naround Model Context Protocol clients.","operationId":"mcp_manifest__well_known_mcp_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/.well-known/ai-plugin.json":{"get":{"tags":["discovery"],"summary":"Ai Plugin","description":"Manifest for AI agents (ChatGPT/etc). Numbers fetched live from DB.","operationId":"ai_plugin__well_known_ai_plugin_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/gdpr/delete":{"post":{"summary":"Gdpr Delete","description":"GDPR Art. 17 — Right to erasure.\n\nThe caller's IP is hashed server-side and all matching api_usage rows\nare removed. No authentication needed: the caller proves ownership\nsimply by originating the request (you can only erase what came\nfrom your own network path).\n\nRate limit: 10 req/hour per IP (prevents spam).","operationId":"gdpr_delete_api_gdpr_delete_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/gdpr/export":{"get":{"summary":"Gdpr Export","description":"GDPR Art. 15/20 — Right of access + data portability.\n\nReturns all api_usage rows linked to the caller's current IP hash.\nJSON format. Downloadable. No PII beyond aggregated columns\n(we don't store raw IP; see /privacy).\n\nRate limit: 10 req/hour per IP.","operationId":"gdpr_export_api_gdpr_export_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/gdpr/policy":{"get":{"summary":"Gdpr Policy","description":"Short machine-readable description of what we store and how long.","operationId":"gdpr_policy_api_gdpr_policy_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/latest/{ecosystem}/{package}":{"get":{"tags":["packages"],"summary":"Get Latest Version","description":"Just the latest version. Nothing else. Fastest possible response.\nUse this before suggesting any package install.","operationId":"get_latest_version_api_latest__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/exists/{ecosystem}/{package}":{"get":{"tags":["packages"],"summary":"Check Exists","description":"Does this package exist? Yes or no. Use before suggesting npm install X.","operationId":"check_exists_api_exists__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/anomaly":{"post":{"tags":["public"],"summary":"Submit Anomaly","operationId":"submit_anomaly_api_anomaly_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_AnomalyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contact":{"post":{"tags":["public"],"summary":"Submit Contact","description":"Submit a contact request (form, CLI, MCP, agent). Free, no auth.","operationId":"submit_contact_api_contact_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ContactRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contact/types":{"get":{"tags":["public"],"summary":"Contact Types","description":"List allowed values for the type field of /api/contact.","operationId":"contact_types_api_contact_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/now":{"get":{"tags":["public"],"summary":"Get Current Time","description":"Current UTC time + live snapshot of DepScope state.\nAgents don't know what time it is or how fresh our data is — this gives\nthem everything in one cheap call.","operationId":"get_current_time_api_now_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/health":{"get":{"tags":["public"],"summary":"Healthcheck","description":"Liveness + readiness probe. External uptime monitors hit this every 5m.\n\nReturns 200 with subsystem statuses when everything is up. If Postgres or\nRedis fail, individual fields flip to the error string but we still return\n200 (monitor will alert on the overall \"status\" field) — bumping to 500\nwould cause PM2 to restart us, which masks the real problem.","operationId":"healthcheck_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/search/{ecosystem}":{"get":{"tags":["packages"],"summary":"Search Packages","description":"Search packages by keyword. When user says 'I need an HTTP client for Python',\nthe agent can search instead of hallucinating package names.","operationId":"search_packages_api_search__ecosystem__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/alternatives/{ecosystem}/{package}":{"get":{"tags":["packages"],"summary":"Get Alternatives","description":"What to use instead of a deprecated/unhealthy package.\nAI agents need this when they suggest something deprecated.","operationId":"get_alternatives_api_alternatives__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/track":{"post":{"tags":["public"],"summary":"Track Pageview","description":"Lightweight page view tracking. No cookies, no personal data.","operationId":"track_pageview_api_track_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/badge/{ecosystem}/{package}":{"get":{"tags":["badges"],"summary":"Package Badge","description":"Generate SVG badge for README embedding. Like shields.io but for package health.","operationId":"package_badge_badge__ecosystem___package__get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/badge/{ecosystem}/{package}/score":{"get":{"tags":["badges"],"summary":"Package Badge Score Only","description":"Minimal badge with just the score.","operationId":"package_badge_score_only_badge__ecosystem___package__score_get","parameters":[{"name":"ecosystem","in":"path","required":true,"schema":{"type":"string","title":"Ecosystem"}},{"name":"package","in":"path","required":true,"schema":{"type":"string","title":"Package"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/savings":{"get":{"tags":["public"],"summary":"Get Savings","description":"Real-time token and energy savings calculator based on actual API calls.\n\nCounts agent + SDK + browser + curl traffic but excludes pure crawlers\n(apple_bot, gpt_bot, claude_bot, google_bot etc) — those don't represent\nactual agents who would otherwise have done an LLM round-trip.","operationId":"get_savings_api_savings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/translate":{"get":{"tags":["public"],"summary":"Translate Text","description":"Free translation via MyMemory API.","operationId":"translate_text_api_translate_get","parameters":[{"name":"text","in":"query","required":true,"schema":{"type":"string","title":"Text"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","default":"it","title":"To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/popular":{"get":{"tags":["discover"],"summary":"Public Popular","description":"Top packages by raw popularity (downloads_weekly).\n\nDifferent from /api/trending (which is search-volume-based). Use this\nwhen you need 'the most-downloaded React libraries' rather than 'the\npackages everyone is asking about right now'.","operationId":"public_popular_api_popular_get","parameters":[{"name":"ecosystem","in":"query","required":false,"schema":{"type":"string","title":"Ecosystem"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/trending":{"get":{"tags":["discover"],"summary":"Public Trending","description":"Public endpoint: top packages getting queried by AI agents this week.","operationId":"public_trending_api_trending_get","parameters":[{"name":"ecosystem","in":"query","required":false,"schema":{"type":"string","title":"Ecosystem"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/curator/status":{"get":{"tags":["admin"],"summary":"Curator Status","operationId":"curator_status_api_admin_curator_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/curator/toggle":{"post":{"tags":["admin"],"summary":"Curator Toggle","operationId":"curator_toggle_api_admin_curator_toggle_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/curator/interval":{"post":{"tags":["admin"],"summary":"Curator Set Interval","operationId":"curator_set_interval_api_admin_curator_interval_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/curator/trigger":{"post":{"tags":["admin"],"summary":"Curator Trigger","operationId":"curator_trigger_api_admin_curator_trigger_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/curator/decisions":{"get":{"tags":["admin"],"summary":"Curator Decisions","operationId":"curator_decisions_api_admin_curator_decisions_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/cron/list":{"get":{"tags":["admin"],"summary":"Cron List","description":"Parse user `deploy` crontab and return parsed jobs with last-run mtime.","operationId":"cron_list_api_admin_cron_list_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/cron/log/{slug}":{"get":{"tags":["admin"],"summary":"Cron Log Tail","description":"Tail the log file for a given cron slug (must match crontab list).","operationId":"cron_log_tail_api_admin_cron_log__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"lines","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Lines"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/cron/run/{slug}":{"post":{"tags":["admin"],"summary":"Cron Run Now","description":"Run a whitelisted cron script in the background (fire-and-forget).","operationId":"cron_run_now_api_admin_cron_run__slug__post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/agents-by-range":{"get":{"tags":["admin"],"summary":"Admin Agents By Range","operationId":"admin_agents_by_range_api_admin_agents_by_range_get","parameters":[{"name":"range","in":"query","required":false,"schema":{"type":"string","default":"7d","title":"Range"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/strategy/state":{"get":{"tags":["admin"],"summary":"Strategy State","description":"Engine state + last snapshot summary + KPI current values.","operationId":"strategy_state_api_admin_strategy_state_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/strategy/roadmap":{"get":{"tags":["admin"],"summary":"Strategy Roadmap List","description":"Full list of roadmap items joined with goal name.","operationId":"strategy_roadmap_list_api_admin_strategy_roadmap_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["admin"],"summary":"Strategy Item Create","description":"Create a new roadmap item manually.","operationId":"strategy_item_create_api_admin_strategy_roadmap_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/strategy/engine/toggle":{"post":{"tags":["admin"],"summary":"Strategy Engine Toggle","description":"Enable/disable or pause/resume the strategy engine.","operationId":"strategy_engine_toggle_api_admin_strategy_engine_toggle_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/strategy/roadmap/{item_id}/status":{"post":{"tags":["admin"],"summary":"Strategy Item Status","description":"Manually set status of an item.","operationId":"strategy_item_status_api_admin_strategy_roadmap__item_id__status_post","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"integer","title":"Item Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/strategy/roadmap/{item_id}/approve":{"post":{"tags":["admin"],"summary":"Strategy Item Approve","description":"Approve draft → marks approved + sets status to 'doing' so executor will run.","operationId":"strategy_item_approve_api_admin_strategy_roadmap__item_id__approve_post","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"integer","title":"Item Id"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"default":{},"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/strategy/roadmap/{item_id}/reject":{"post":{"tags":["admin"],"summary":"Strategy Item Reject","description":"Reject draft → resets to 'todo' so planner can re-draft.","operationId":"strategy_item_reject_api_admin_strategy_roadmap__item_id__reject_post","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"integer","title":"Item Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/strategy/roadmap/{item_id}":{"patch":{"tags":["admin"],"summary":"Strategy Item Patch","operationId":"strategy_item_patch_api_admin_strategy_roadmap__item_id__patch","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"integer","title":"Item Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/strategy/roadmap/{item_id}/redraft":{"post":{"tags":["admin"],"summary":"Strategy Item Force Redraft","description":"Force planner to re-draft this item next iteration (clears draft, keeps reject_reason).","operationId":"strategy_item_force_redraft_api_admin_strategy_roadmap__item_id__redraft_post","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"integer","title":"Item Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/curator/state":{"get":{"tags":["public"],"summary":"Public Curator State","description":"Public summary of curator state. Aggregated only — no per-action details.","operationId":"public_curator_state_api_curator_state_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/curator/creds-refresh-status":{"get":{"tags":["public"],"summary":"Creds Refresh Status","description":"Polled by PC Task Scheduler every 5min. Bearer-auth via CREDS_REFRESH_TOKEN env.","operationId":"creds_refresh_status_api_curator_creds_refresh_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/curator/creds-refresh-ack":{"post":{"tags":["public"],"summary":"Creds Refresh Ack","description":"Called by PC after a successful push to clear the refresh flag.","operationId":"creds_refresh_ack_api_curator_creds_refresh_ack_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/curator/decisions":{"get":{"tags":["public"],"summary":"Public Curator Decisions","description":"Retired. Per-decision audit log is no longer public. See /api/curator/state for aggregates.","operationId":"public_curator_decisions_api_curator_decisions_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"FlagUpdate":{"properties":{"key":{"type":"string","title":"Key"},"value":{"title":"Value"}},"type":"object","required":["key","value"],"title":"FlagUpdate"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"MissionCreate":{"properties":{"title":{"type":"string","title":"Title"},"goal":{"type":"string","title":"Goal"},"agent_profile":{"type":"string","title":"Agent Profile","default":"researcher"},"cost_usd_cap":{"type":"number","title":"Cost Usd Cap","default":2.0},"auto_run":{"type":"boolean","title":"Auto Run","default":true},"parent_proposal_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Proposal Id"}},"type":"object","required":["title","goal"],"title":"MissionCreate"},"ProposalDecision":{"properties":{"decision":{"type":"string","title":"Decision"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["decision"],"title":"ProposalDecision"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"_AnomalyRequest":{"properties":{"tool_called":{"type":"string","title":"Tool Called"},"ecosystem":{"type":"string","title":"Ecosystem","default":""},"package":{"type":"string","title":"Package","default":""},"version":{"type":"string","title":"Version","default":""},"observed":{"type":"string","title":"Observed"},"expected":{"type":"string","title":"Expected"},"evidence_url":{"type":"string","title":"Evidence Url","default":""},"source":{"type":"string","title":"Source","default":"mcp"}},"type":"object","required":["tool_called","observed","expected"],"title":"_AnomalyRequest"},"_BulkItem":{"properties":{"ecosystem":{"type":"string","title":"Ecosystem"},"package":{"type":"string","title":"Package"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"}},"type":"object","required":["ecosystem","package"],"title":"_BulkItem"},"_BulkRequest":{"properties":{"items":{"items":{"$ref":"#/components/schemas/_BulkItem"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"_BulkRequest"},"_ContactRequest":{"properties":{"name":{"type":"string","title":"Name","default":""},"email":{"type":"string","title":"Email"},"type":{"type":"string","title":"Type","default":"other"},"subject":{"type":"string","title":"Subject"},"body":{"type":"string","title":"Body","default":""},"message":{"type":"string","title":"Message","default":""},"company":{"type":"string","title":"Company","default":""},"source":{"type":"string","title":"Source","default":"web"},"consent":{"type":"boolean","title":"Consent","default":true},"honeypot":{"type":"string","title":"Honeypot","default":""}},"type":"object","required":["email","subject"],"title":"_ContactRequest"},"_StackRequest":{"properties":{"packages":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Packages"},"format":{"type":"string","title":"Format","default":"text"}},"type":"object","required":["packages"],"title":"_StackRequest"}}},"tags":[{"name":"packages","description":"Core package intelligence: health score, vulnerabilities, recommendations, alternatives, comparisons, batch scan, version metadata, dependency tree. These are the endpoints AI agents call before suggesting any `npm install` / `pip install` / `cargo add`."},{"name":"errors","description":"Error -> fix database. POST a stack trace, get solutions back. Full-text error search by message or stable hash."},{"name":"compat","description":"Stack compatibility matrix. Verify a set of `pkg@version` pins work together (e.g. `next@16,react@19,prisma@6`) before upgrading."},{"name":"discover","description":"Trending packages per ecosystem, typosquats, malicious advisories, trust signals. Use these to surface or avoid packages."},{"name":"verticals","description":"Breaking changes (v1->v2 with migration hints) and non-CVE known bugs per version."},{"name":"discovery","description":"Well-known files for AI agents: /openapi.json, /ai-plugin.json, /mcp.json, /llms.txt, /llms-full.txt, /security.txt, /sitemap.xml, /robots.txt."},{"name":"auth","description":"Optional API keys for higher rate limits + usage analytics. No auth required for public endpoints."}]}