# Git Commit Message Generator from Diff

> Git Commit Message Generator from Diff is a paid API for AI agents from x402-deployer.x402-deployer.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Generates a Conventional Commits-formatted git commit message (type, scope, subject, body, breaking_change flag) from a provided code diff

## Facts

- Endpoint: POST https://x402-deployer.x402-deployer.workers.dev/commit-message-from-diff
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-deployer-x402-deployer-workers-dev-0ed1e3b8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_qNWgmyintgtjfDKd-H_kI

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 x402-deployer-x402-deployer-workers-dev-0ed1e3b8 -d '<json body>'
```

Example prompt: Generate a Conventional Commits message for this diff — it refactors the authentication middleware to use JWT instead of sessions and removes the old session store, which is a breaking change: `diff --git a/src/middleware/auth.js ...`

## When to prefer this

Use this endpoint when you need a structured, Conventional Commits-compliant commit message automatically derived from a real code diff. Ideal for CI/CD pipelines, developer tooling agents, or IDE plugins that want to automate commit message authoring while adhering to semantic versioning conventions. Prefer this over generic text generation when you need the specific type/scope/subject/body/breaking_change schema.

## Known failure modes

- Empty or malformed diff input returns an error
- Diff too large may exceed processing limits
- Ambiguous or context-free diffs may produce low-quality or generic commit messages
- Payment failure returns 402 status before processing

## How this service works

Git commit message generator / Conventional Commits / AI commit-msg. Type, scope, subject, body, breaking_change flag. Ready for git commit -m.

## Output

Returns a structured Conventional Commits object with: type (e.g. feat, fix, refactor, chore), scope (affected module/area), subject (short imperative summary), body (detailed explanation), and a breaking_change boolean flag — ready to use directly with git commit -m.

## Example request

```json
{
 "diff": "diff --git a/src/utils/logger.js b/src/utils/logger.js\nindex abc1234..def5678 100644\n--- a/src/utils/logger.js\n+++ b/src/utils/logger.js\n@@ -1,8 +1,12 @@\n const fs = require('fs');\n const path = require('path');\n \n-function logMessage(message) {\n-  console.log(message);\n+function logMessage(message, level = 'info') {\n+  const timestamp = new Date().toISOString();\n+  const logEntry = `[${timestamp}] ${level.toUpperCase()}: ${message}`;\n+  console.log(logEntry);\n }\n \n-module.exports = { logMessage };\n+function logError(error) {\n+  logMessage(error.message, 'error');\n+}\n+\n+module.exports = { logMessage, logError };"
}
```

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "properties": {
      "diff": {
       "type": "string",
       "description": "Git diff text in unified format. Max 30,000 chars."
      },
      "style": {
       "type": "string",
       "enum": [
        "conventional",
        "plain"
       ],
       "description": "Optional. 'conventional' (default) for Conventional Commits format, or 'plain' for a simple chore-style message."
      },
      "scope": {
       "type": "string",
       "description": "Optional. Preferred Conventional Commits scope, e.g. 'auth'. Max 30 chars; used unless clearly wrong for the diff."
      }
     },
     "required": [
      "diff"
     ]
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "type": {
       "type": "string"
      },
      "scope": {
       "type": "string"
      },
      "subject": {
       "type": "string"
      },
      "full_message": {
       "type": "string"
      }
     }
    }
   },
   "required": [
    "type"
   ]
  }
 },
 "required": [
  "input"
 ]
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-deployer-x402-deployer-workers-dev-0ed1e3b8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-deployer.x402-deployer.workers.dev](https://www.zero.xyz/host/x402-deployer.x402-deployer.workers.dev/llms.txt)
