---
title: "Contract status badge"
method: GET
path: "/v1/contract/badge.svg"
tags: ["Content"]
---

# Contract status badge

`GET /v1/contract/badge.svg`

## Request

- Base URL: `https://api.gunspec.io`
- URL: `https://api.gunspec.io/v1/contract/badge.svg`
- Auth: one of:
  - none
  - API key in header `X-API-Key`
  - HTTP bearer

The latest run's verdict as an SVG badge, for a README or a directory listing: green with the number of checks that passed, red with the number that failed, or grey when nothing has been run. Drawn by this API from the same record `GET /v1/contract` serves, so the badge and the page cannot disagree. Cached for five minutes.

No API key required.

## Query parameters

- `surface` 'api' | 'mcp' | 'fitment' | 'catalogue' | 'integrity' | 'plausibility' | 'anomalies' | 'cartridges' | 'materials' | 'corroboration' | 'sources' | 'manufacturers' | 'links'
- `env` 'production' | 'staging' | 'local'
- `label` string
- `logo` '0' | '1'

## Response `200`

An SVG badge for the latest run

## Other responses

- `400`: Validation error
- `429`: A limit was reached. `RATE_LIMITED` is the per-minute limit: wait `Retry-After` seconds (a minute) and retry. `DAILY_CAP_EXCEEDED` is the plan's daily limit, per key: nothing will be served until the counters return to zero at midnight UTC. `MONTHLY_CAP_EXCEEDED` is the plan's monthly allowance, for the whole account: nothing will be served until midnight UTC on the first of next month, or until the plan changes. For both, `Retry-After` is the seconds until then and `error.resetsAt` says when as an instant. Calls made after a refusal are refused too and do not spend the month, and a free key that keeps calling is paused, so stop at the first one and resume at the reset.
- `500`: Internal server error

---

[API](https://skmtc.dev/gunspec/apis/gunspec-io-api.md) · [All operations](https://skmtc.dev/gunspec/apis/gunspec-io-api/llms.txt) · [OpenAPI document](https://skmtc.dev/gunspec/apis/gunspec-io-api/revisions/f2e974d8b05c?raw)
