What it does
Send a unified diff. Get back the full PR body.
curl -X POST https://x402.agentutility.ai/pr-description-from-diff \
-d '{"diff": "diff --git a/auth.ts b/auth.ts\n@@\n+function login() {}\n"}'
{
"title": "Add login function to auth module",
"summary": [
"Adds initial login() function in auth.ts",
"Wires the empty stub for future OAuth flow"
],
"test_plan": [
"Run npm test, confirm new login.test.ts passes",
"Hit /auth/login locally, confirm 501 stub response"
],
"breaking_change": false,
"body": "## Summary\n\n- Adds initial login() function in auth.ts\n- Wires the empty stub for future OAuth flow\n\n## Test plan\n\n- [ ] Run npm test, confirm new login.test.ts passes\n- [ ] Hit /auth/login locally, confirm 501 stub response"
}
Costs $0.01 USDC. Takes a diff up to 60k chars (most PRs fit). The Markdown body field is ready to drop straight into gh pr create --body-file -.
Why this isn't the same as commit-message-from-diff
We've shipped commit-message-from-diff for a while. That one returns a Conventional Commits subject line and an optional body. Great for git commit -m. Not great for a PR.
A PR description does different work:
- It explains the change to a reviewer who didn't see the commits go in
- It surfaces the test plan as a checklist so the reviewer (or the author) can actually verify
- It calls out breaking changes loudly
- It includes the ticket reference if there is one
So this endpoint outputs more structure: title, summary bullets, test plan checklist items, breaking-change flag with an optional migration note, plus the rendered Markdown body. The structured fields let the caller compose their own template if they don't want ours.
Both endpoints stay live. Use commit-message for commits, pr-description for PRs.
Who calls this
- Coding agents that ship via PR (Claude Code, Cursor's "Compose PR" path, Replit Agent's review step)
- CI pipelines that auto-open PRs from automated migrations or dependency bumps and need a real body, not "auto-generated"
- Devs running a CLI tool like
gh pr createwho want a draft to edit instead of a blank text box
What's in the box
title_hint — optional. The model refines but stays close. Pass "add login" and you'll get "Add login function to auth module", not some bloated rewrite. The style file's banned-word list applies to the output too.
ticket — optional. Pass "JIRA-1234" and the title ends with (JIRA-1234) plus a body reference. Empty string skips it.
breaking_change — true only when the diff removes or renames public API. Adding a function isn't breaking. Removing one is.
Why $0.01 instead of $0.005
The prompt is heavier than commit-message (more output, more structure, longer diffs). Output ceiling is 1500 tokens vs 800. Morpheus + Venice both run, with retry on 5xx, so an agent that pays once almost always gets a response.
Doesn't replace human review
The model writes the title. It writes the bullets. It writes the test plan. The reviewer (human or agent) still reads them and decides. Auto-generated PR bodies are a starting point — better than a blank box, worse than a thoughtful author. Use accordingly.
Call it. It pairs with commit-message-from-diff and code-review-snippet for a full agent-driven PR loop.