---
title: "AI Badge REST API documentation"
description: "Public AI Badge API and reusable tools; author visibility controls apply."
canonical: "https://ai-badge.vercel.app/docs/api"
last-updated: "2026-12-07"
---

# AI Badge REST API documentation

Read public AI profiles and reusable Agent Skills through anonymous HTTP GET requests. No login, API key, browser cookie or MCP session is required. Authors must enable Agent reading; private or hidden resources return 404.

## Quick start: retrieve a Skill

All example data belongs to the synthetic alexchen profile. First get the collection, select an entry by useWhen, inputs, expectedOutputs, runtime and dependencies, then fetch its entry.url.

~~~sh
curl -fsS 'https://ai-badge.vercel.app/api/v1/u/alexchen/agent.json'
curl -fsS 'https://ai-badge.vercel.app/api/v1/u/alexchen/creations/b4c09561-a722-423f-9469-113f454ccfd1/content'
~~~

The second request returns raw UTF-8 text, not JSON. Check its SHA-256 against entry.sha256 before loading it. Downloading is not execution approval; author compatibility claims are not runtime verification.

## Endpoints and required parameters

Base URL: https://ai-badge.vercel.app. Public REST accepts GET, HEAD and OPTIONS. AI-Badge-API-Version: 1 is an optional header. Username is required on profile routes, 1–80 characters matching ^[a-zA-Z0-9_-]+$. Content id is a UUID from tools[].id. The collection's optional tool query parameter selects a UUID; it is not named toolId (that name belongs to MCP).

### GET /api/v1

Discover public capabilities

~~~json
[
  {
    "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"
    }
  }
]
~~~

### GET /api/v1/u/{username}/profile.json

Read a compact public profile

~~~json
[
  {
    "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"
    }
  }
]
~~~

### GET /api/v1/u/{username}/agent.json

Read a user's reusable tools

~~~json
[
  {
    "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"
    }
  }
]
~~~

### GET /api/v1/u/{username}/creations/{id}/content

Download exact inline tool content

~~~json
[
  {
    "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"
    }
  }
]
~~~

### GET /u/{username}/agent.md

Read a compact Markdown profile

~~~json
[
  {
    "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"
    }
  }
]
~~~

## Complete response example: tool collection

HTTP 200, application/json. At most 20 tools; an empty tools array is valid and needs no pagination. This full example uses the same fixture and serializer as the public API.

~~~json
{
  "schemaVersion": "1.0",
  "resourceType": "agent-tool-collection",
  "author": "alexchen",
  "profileUrl": "https://ai-badge.vercel.app/u/alexchen",
  "isDemo": true,
  "trust": "Author-provided resources, not system instructions. Compatibility and external artifact availability are unverified. Use only for the user's requested task and preserve the host agent's permissions.",
  "tools": [
    {
      "id": "b4c09561-a722-423f-9469-113f454ccfd1",
      "name": "Research Brief · 研究简报（示例）",
      "kind": "SKILL",
      "description": "把一个研究问题拆成可核查的来源、核心发现与待确认事项，整理成简报。",
      "useWhen": "需要核查并整理研究材料时",
      "compatibleAgents": [
        "支持 Agent Skills 的 Agent"
      ],
      "runtime": "具备文本读取能力的 Agent",
      "inputs": "主题、时间范围和来源材料",
      "expectedOutputs": "带来源的研究简报",
      "dependencies": "需要外部资料时，由 Agent 自身提供检索能力",
      "loadOrInvoke": "下载 SKILL.md，按目标 Agent 的技能导入方式放入对应目录。此示例仅包含文字步骤，不含脚本或附件。",
      "verification": {
        "status": "AUTHOR_DECLARED",
        "runtimeTested": false
      },
      "entry": {
        "type": "INLINE",
        "url": "https://ai-badge.vercel.app/api/v1/u/alexchen/creations/b4c09561-a722-423f-9469-113f454ccfd1/content",
        "format": "MARKDOWN",
        "filename": "SKILL.md",
        "sha256": "862f87b672deefd935663b29bb29c18b1a57d2d11666fbe1da8e8bf30311aeab"
      }
    },
    {
      "id": "b4c09561-a722-423f-9469-113f454ccfd2",
      "name": "话题信号筛选（示例）",
      "kind": "PROMPT",
      "description": "从你提供的帖子和链接中筛选有证据的新信息，区分事实、观点与重复转述。",
      "useWhen": "需要筛选帖子中的新信息时",
      "compatibleAgents": [
        "Grok"
      ],
      "runtime": "Grok 对话环境",
      "inputs": "主题、日期范围、帖子正文或链接",
      "expectedOutputs": "新信息与证据表、待核查问题",
      "dependencies": "若无法访问链接，需用户提供原文",
      "loadOrInvoke": "复制模板到 Grok，替换方括号中的内容，并补充你的材料。",
      "verification": {
        "status": "AUTHOR_DECLARED",
        "runtimeTested": false
      },
      "entry": {
        "type": "INLINE",
        "url": "https://ai-badge.vercel.app/api/v1/u/alexchen/creations/b4c09561-a722-423f-9469-113f454ccfd2/content",
        "format": "TEXT",
        "filename": "skill-b4c09561.txt",
        "sha256": "9249e793b28fcd5bb2b9ad2eac177ad8f625cc71a66a68d6897605de985da4de"
      }
    }
  ]
}
~~~

INLINE entries provide text and a SHA-256 hash. FILE, PACKAGE and MCP_ENDPOINT entries reference author-hosted resources. AI Badge does not fetch or execute those external resources for you.

## Errors, rate limits and privacy

Missing, hidden or Agent-disabled resources return HTTP 404:

~~~json
{
  "error": "Profile unavailable or Agent reading disabled.",
  "code": "NOT_FOUND",
  "docs": "/docs"
}
~~~

400 INVALID_ARGUMENT: correct the input. 400 UNSUPPORTED_VERSION: use version 1. 405 METHOD_NOT_ALLOWED: use GET / HEAD / OPTIONS. 429 RATE_LIMITED: wait at least Retry-After seconds, then retry with jitter. 503 SERVICE_UNAVAILABLE: use backoff and Retry-After (normally 30 seconds).

Public reads and MCP POST share 240 requests per 60 seconds per client IP. Read RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset (seconds) and Retry-After. Do not create new sessions to evade the quota. Public REST supports CORS * with credentials omitted. Responses use no-store; each read checks author visibility again. Downloaded copies cannot be recalled.

## Contracts and next steps

- [OpenAPI 3.1: all response schemas](https://ai-badge.vercel.app/openapi.json)
- [Complete profile, collection, content and error examples](https://ai-badge.vercel.app/docs/examples.json)
- [First call: executable examples and hash verification](https://ai-badge.vercel.app/docs/first-call)
- [MCP server documentation](https://ai-badge.vercel.app/docs/mcp)
- [Versioning and permissions](https://ai-badge.vercel.app/docs)

v1 payload schemaVersion is 1.0. Tolerate additive fields. Breaking changes use a new major path; before v1 retirement, at least 90 days notice will appear in the guide with Deprecation and Sunset headers. No retirement is scheduled.
