---
title: "Get Badge"
method: GET
path: "/api/v1/badges/{agent_id}.svg"
tags: ["badges"]
---

# Get Badge

`GET /api/v1/badges/{agent_id}.svg`

## Request

- Base URL: `https://api.badgeia.com`
- URL: `https://api.badgeia.com/api/v1/badges/{agent_id}.svg`
- Auth: none declared

Generate an SVG badge for an agent's score.

Query parameters:
- style: "flat" (default) or "flat-square"
- metric: "composite" (default), "success_rate", "reliability", or "elo"

ROAD-002 §WP-F — every successful render fires a server-side PostHog
`badge_rendered` event (agent_id + referrer ORIGIN only, no PII),
throttled in-process to once per (badge, referrer origin) per hour so a
busy README doesn't fire per pixel-load. The throttle is a lock-guarded
dict lookup and the capture is fire-and-forget — the route stays cheap
and keeps its 1h public Cache-Control. Not-found badges emit nothing.

## Path parameters

- `agent_id` string, required

## Query parameters

- `style` string
- `metric` string

## Response `200`

Successful Response

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/badgeia/apis/badge.md) · [All operations](https://skmtc.dev/badgeia/apis/badge/llms.txt) · [OpenAPI document](https://skmtc.dev/badgeia/apis/badge/revisions/7e7f7fee8b77?raw)
