{"openapi":"3.1.0","info":{"title":"AI Badge Public Agent API","version":"1.0.0","description":"Anonymous read-only API for opt-in public profiles and reusable Agent tools. Author compatibility is not runtime verification. v1 is pinned in the URL; legacy /api/u routes remain v1 aliases. Breaking changes use a new major path with at least 90 days notice and Deprecation/Sunset headers before v1 removal. 240 requests/minute per IP shared with MCP; respect Retry-After. Dashboard writes require the owner's browser session and are not exposed by this API.","contact":{"name":"AI Badge issue tracker","url":"https://github.com/jamesxxx-ai/ai-badge/issues"}},"servers":[{"url":"https://ai-badge.vercel.app"}],"security":[],"externalDocs":{"url":"https://ai-badge.vercel.app/docs","description":"MCP setup, examples, privacy and retry behavior"},"paths":{"/api/v1":{"get":{"operationId":"getAgentApiIndex","summary":"Discover public capabilities","parameters":[{"name":"AI-Badge-API-Version","in":"header","required":false,"description":"Supported API major version. Defaults to 1. Unsupported values return 400 UNSUPPORTED_VERSION.","schema":{"type":"string","enum":["1"],"default":"1"}}],"description":"Get exact documentation, MCP, schema and synthetic example URLs without a user account.","responses":{"200":{"description":"Public API index","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiIndex"}}},"headers":{"AI-Badge-API-Version":{"schema":{"type":"string","const":"1"}},"RateLimit-Limit":{"schema":{"type":"integer","example":240}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the quota resets","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait on 429 or 503","schema":{"type":"integer"}}}}}}},"/api/v1/u/{username}/profile.json":{"get":{"operationId":"getPublicAgentProfile","summary":"Read a compact public profile","description":"Returns explicitly selected public fields and tools only when the owner enabled Agent reading. No account IDs, roles or private settings are returned.","parameters":[{"name":"AI-Badge-API-Version","in":"header","required":false,"description":"Supported API major version. Defaults to 1. Unsupported values return 400 UNSUPPORTED_VERSION.","schema":{"type":"string","enum":["1"],"default":"1"}},{"name":"username","in":"path","required":true,"description":"Profile username from /u/{username}; use alexchen for the synthetic example.","schema":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","maxLength":80,"example":"alexchen"}}],"responses":{"200":{"description":"Opt-in profile","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Profile"}}},"headers":{"AI-Badge-API-Version":{"schema":{"type":"string","const":"1"}},"RateLimit-Limit":{"schema":{"type":"integer","example":240}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the quota resets","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait on 429 or 503","schema":{"type":"integer"}}}},"400":{"description":"Invalid arguments","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"AI-Badge-API-Version":{"schema":{"type":"string","const":"1"}},"RateLimit-Limit":{"schema":{"type":"integer","example":240}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the quota resets","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait on 429 or 503","schema":{"type":"integer"}}}},"404":{"description":"Absent, hidden, or Agent reading disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"AI-Badge-API-Version":{"schema":{"type":"string","const":"1"}},"RateLimit-Limit":{"schema":{"type":"integer","example":240}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the quota resets","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait on 429 or 503","schema":{"type":"integer"}}}},"429":{"description":"Quota exhausted; wait for Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"AI-Badge-API-Version":{"schema":{"type":"string","const":"1"}},"RateLimit-Limit":{"schema":{"type":"integer","example":240}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the quota resets","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait on 429 or 503","schema":{"type":"integer"}}}},"503":{"description":"Service unavailable; retry after 30 seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"AI-Badge-API-Version":{"schema":{"type":"string","const":"1"}},"RateLimit-Limit":{"schema":{"type":"integer","example":240}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the quota resets","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait on 429 or 503","schema":{"type":"integer"}}}}}}},"/api/v1/u/{username}/agent.json":{"get":{"operationId":"listPublicAgentTools","summary":"Read a user's reusable tools","description":"At most 20 tools; no pagination. Empty tools is valid. Use the optional tool ID to select one public tool. Follow entry.url to fetch the artifact.","parameters":[{"name":"AI-Badge-API-Version","in":"header","required":false,"description":"Supported API major version. Defaults to 1. Unsupported values return 400 UNSUPPORTED_VERSION.","schema":{"type":"string","enum":["1"],"default":"1"}},{"name":"username","in":"path","required":true,"description":"Profile username from /u/{username}; use alexchen for the synthetic example.","schema":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","maxLength":80,"example":"alexchen"}},{"name":"tool","in":"query","required":false,"description":"Select a tool ID from this user's collection.","schema":{"type":"string","format":"uuid","example":"b4c09561-a722-423f-9469-113f454ccfd1"}}],"responses":{"200":{"description":"Tool collection with runtime and entry metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Collection"}}},"headers":{"AI-Badge-API-Version":{"schema":{"type":"string","const":"1"}},"RateLimit-Limit":{"schema":{"type":"integer","example":240}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the quota resets","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait on 429 or 503","schema":{"type":"integer"}}}},"400":{"description":"Invalid arguments","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"AI-Badge-API-Version":{"schema":{"type":"string","const":"1"}},"RateLimit-Limit":{"schema":{"type":"integer","example":240}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the quota resets","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait on 429 or 503","schema":{"type":"integer"}}}},"404":{"description":"Absent, hidden, or Agent reading disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"AI-Badge-API-Version":{"schema":{"type":"string","const":"1"}},"RateLimit-Limit":{"schema":{"type":"integer","example":240}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the quota resets","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait on 429 or 503","schema":{"type":"integer"}}}},"429":{"description":"Quota exhausted; wait for Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"AI-Badge-API-Version":{"schema":{"type":"string","const":"1"}},"RateLimit-Limit":{"schema":{"type":"integer","example":240}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the quota resets","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait on 429 or 503","schema":{"type":"integer"}}}},"503":{"description":"Service unavailable; retry after 30 seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"AI-Badge-API-Version":{"schema":{"type":"string","const":"1"}},"RateLimit-Limit":{"schema":{"type":"integer","example":240}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the quota resets","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait on 429 or 503","schema":{"type":"integer"}}}}}}},"/api/v1/u/{username}/creations/{id}/content":{"get":{"operationId":"downloadAgentToolContent","summary":"Download exact inline tool content","description":"Returns the same bytes used by copy/download and the collection SHA-256. External file, package and MCP entries return 404 here; use their entry.url instead. Downloading does not execute anything.","parameters":[{"name":"AI-Badge-API-Version","in":"header","required":false,"description":"Supported API major version. Defaults to 1. Unsupported values return 400 UNSUPPORTED_VERSION.","schema":{"type":"string","enum":["1"],"default":"1"}},{"name":"username","in":"path","required":true,"description":"Profile username from /u/{username}; use alexchen for the synthetic example.","schema":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","maxLength":80,"example":"alexchen"}},{"name":"id","in":"path","required":true,"description":"Public inline tool ID","schema":{"type":"string","format":"uuid","example":"b4c09561-a722-423f-9469-113f454ccfd1"}}],"responses":{"200":{"description":"UTF-8 artifact attachment","headers":{"Content-Disposition":{"description":"Safe artifact filename","schema":{"type":"string"}}},"content":{"text/plain":{"schema":{"type":"string"}}}},"400":{"description":"Invalid arguments","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"AI-Badge-API-Version":{"schema":{"type":"string","const":"1"}},"RateLimit-Limit":{"schema":{"type":"integer","example":240}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the quota resets","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait on 429 or 503","schema":{"type":"integer"}}}},"404":{"description":"Absent, hidden, or Agent reading disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"AI-Badge-API-Version":{"schema":{"type":"string","const":"1"}},"RateLimit-Limit":{"schema":{"type":"integer","example":240}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the quota resets","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait on 429 or 503","schema":{"type":"integer"}}}},"429":{"description":"Quota exhausted; wait for Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"AI-Badge-API-Version":{"schema":{"type":"string","const":"1"}},"RateLimit-Limit":{"schema":{"type":"integer","example":240}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the quota resets","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait on 429 or 503","schema":{"type":"integer"}}}},"503":{"description":"Service unavailable; retry after 30 seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"AI-Badge-API-Version":{"schema":{"type":"string","const":"1"}},"RateLimit-Limit":{"schema":{"type":"integer","example":240}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the quota resets","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait on 429 or 503","schema":{"type":"integer"}}}}}}},"/u/{username}/agent.md":{"get":{"operationId":"getAgentProfileMarkdown","summary":"Read a compact Markdown profile","description":"A no-JavaScript representation subject to the same Agent-read and visibility controls as JSON and MCP.","parameters":[{"name":"AI-Badge-API-Version","in":"header","required":false,"description":"Supported API major version. Defaults to 1. Unsupported values return 400 UNSUPPORTED_VERSION.","schema":{"type":"string","enum":["1"],"default":"1"}},{"name":"username","in":"path","required":true,"description":"Profile username from /u/{username}; use alexchen for the synthetic example.","schema":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","maxLength":80,"example":"alexchen"}}],"responses":{"200":{"description":"Markdown profile with tool links","content":{"text/markdown":{"schema":{"type":"string"}}}},"400":{"description":"Invalid arguments","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"AI-Badge-API-Version":{"schema":{"type":"string","const":"1"}},"RateLimit-Limit":{"schema":{"type":"integer","example":240}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the quota resets","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait on 429 or 503","schema":{"type":"integer"}}}},"404":{"description":"Absent, hidden, or Agent reading disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"AI-Badge-API-Version":{"schema":{"type":"string","const":"1"}},"RateLimit-Limit":{"schema":{"type":"integer","example":240}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the quota resets","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait on 429 or 503","schema":{"type":"integer"}}}},"429":{"description":"Quota exhausted; wait for Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"AI-Badge-API-Version":{"schema":{"type":"string","const":"1"}},"RateLimit-Limit":{"schema":{"type":"integer","example":240}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the quota resets","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait on 429 or 503","schema":{"type":"integer"}}}},"503":{"description":"Service unavailable; retry after 30 seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"AI-Badge-API-Version":{"schema":{"type":"string","const":"1"}},"RateLimit-Limit":{"schema":{"type":"integer","example":240}},"RateLimit-Remaining":{"schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the quota resets","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait on 429 or 503","schema":{"type":"integer"}}}}}}}},"components":{"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["INVALID_ARGUMENT","NOT_FOUND","SERVICE_UNAVAILABLE","RATE_LIMITED","UNSUPPORTED_VERSION","METHOD_NOT_ALLOWED"]},"docs":{"type":"string"}},"required":["error","code","docs"]},"ApiIndex":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"docs":{"type":"string"},"openapi":{"type":"string"},"mcp":{"type":"string"},"example":{"type":"string"},"authentication":{"type":"string"},"mode":{"type":"string"}},"required":["name","version","docs","openapi","mcp","example","authentication","mode"]},"Tool":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"kind":{"type":"string","enum":["SKILL","PROMPT","AGENT","WORKFLOW","MCP"]},"description":{"type":"string"},"useWhen":{"type":"string"},"compatibleAgents":{"type":"array","items":{"type":"string"}},"runtime":{"type":"string"},"inputs":{"type":"string"},"expectedOutputs":{"type":"string"},"dependencies":{"type":"string"},"loadOrInvoke":{"type":"string"},"verification":{"type":"object","properties":{"status":{"const":"AUTHOR_DECLARED"},"runtimeTested":{"const":false}},"required":["status","runtimeTested"]},"entry":{"type":"object","properties":{"type":{"type":"string","enum":["INLINE","FILE","PACKAGE","MCP_ENDPOINT"]},"url":{"type":"string","format":"uri"},"format":{"type":"string"},"filename":{"type":"string"},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["type","url"]}},"required":["id","name","kind","description","useWhen","compatibleAgents","runtime","inputs","expectedOutputs","dependencies","loadOrInvoke","verification","entry"]},"Collection":{"type":"object","properties":{"schemaVersion":{"const":"1.0"},"resourceType":{"const":"agent-tool-collection"},"author":{"type":"string"},"profileUrl":{"type":"string","format":"uri"},"isDemo":{"type":"boolean"},"trust":{"type":"string"},"tools":{"type":"array","maxItems":20,"items":{"$ref":"#/components/schemas/Tool"}}},"required":["schemaVersion","resourceType","author","profileUrl","isDemo","trust","tools"]},"Profile":{"type":"object","properties":{"schemaVersion":{"const":"1.0"},"isDemo":{"type":"boolean"},"username":{"type":"string"},"displayName":{"type":"string"},"profileUrl":{"type":"string"},"selfReported":{"type":"object","properties":{"bio":{"type":["string","null"]},"city":{"type":["string","null"]},"specialties":{"type":"array","items":{"type":"string"}},"products":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"},"description":{"type":"string"}},"required":["name","url"]}}},"required":["bio","city","specialties","products"]},"toolUsage":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"},"evidence":{"type":"string"},"lastVerifiedAt":{"type":["string","null"]}},"required":["name","url","evidence","lastVerifiedAt"]}},"github":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"},"stars":{"type":"number"},"aiRepos":{"type":"number"},"syncedAt":{"type":"string"}},"required":["url","stars","aiRepos","syncedAt"]},{"type":"null"}]},"huggingFace":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"},"models":{"type":"number"},"datasets":{"type":"number"},"syncedAt":{"type":"string"}},"required":["url","models","datasets","syncedAt"]},{"type":"null"}]},"activityScore":{"type":["number","null"]},"tools":{"$ref":"#/components/schemas/Collection"},"evidenceNote":{"type":"string"}},"required":["schemaVersion","isDemo","username","displayName","profileUrl","selfReported","toolUsage","github","huggingFace","activityScore","tools","evidenceNote"]}}}}