# PR Description From a Diff

> PR Description From a Diff is a paid API for AI agents from api.aiskills402.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-11-20).

Generates a structured pull request title and description (Summary, Changes, Tests, Risks sections) from a pasted unified diff, as a downloadable SKILL.md file

## Facts

- Endpoint: GET https://api.aiskills402.com/v1/skills/pr-description-from-diff/file?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pr-description-from-a-diff-7ea0dd78
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_gSCJkhwzKlIWREQ8mHv7L

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability pr-description-from-a-diff-7ea0dd78
```

Example prompt: Here's the unified diff from my latest branch — can you write a pull request title and description for it with Summary, Changes, Tests, and Risks sections, mentioning every file touched?

## When to prefer this

Choose this endpoint when you need a deterministic, strictly scoped PR description that names every changed file without fabricating intent, speed claims, or security benefits — ideal for automated CI/CD pipelines or agent workflows that want honest, structured PR documentation paid per-use via USDC on Base (x402 protocol) with no subscription required.

## Known failure modes

- Payment not settled — 402 response if USDC payment on Base is not confirmed
- Invalid HTTP method — only GET/HEAD accepted; POST or other methods will be rejected
- Malformed request headers — missing or incorrect content-type or authorization headers may cause 400 errors
- Empty or missing diff input — the skill file may be returned but with minimal or generic content if no diff was provided at call time
- Network timeout — slow settlement or upstream latency may cause request to hang

## How this service works

PR Description From a Diff — Writes a pull request title and description from a pasted unified diff, as Markdown only - a title line of at most 72 characters, then four fixed sections - Summary, Changes, Tests and Risks - where every file the diff touches is named once, including renames, deletions, binary files, mode changes, lockfiles and formatting-only edits, and nothing is claimed that the diff does not show. It describes what the hunks change and leaves out a reason, a speed gain, a secur…

## Output

Returns a JSON object containing a SKILL.md file with the PR title and Markdown-formatted description (four sections: Summary, Changes, Tests, Risks), plus metadata including the skill name, version, SHA256 of the file, a redownload URL and token, and a payment settlement receipt.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD"
     ],
     "type": "string"
    },
    "headers": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "file": {
   "name": "SKILL.md",
   "content": "<the SKILL.md file>",
   "encoding": "utf-8"
  },
  "name": "PR Description From a Diff",
  "skill": "pr-description-from-diff",
  "sha256": "<sha256 of SKILL.md>",
  "receipt": {
   "tx": "0x<settlement transaction>",
   "settled": true
  },
  "version": "1.0.0",
  "redownload": {
   "url": "<api>/v1/purchases/<token>",
   "token": "<64 hex chars>"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pr-description-from-a-diff-7ea0dd78/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.aiskills402.com](https://www.zero.xyz/host/api.aiskills402.com/llms.txt)
