# Commit Message Generator from Git Diff

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

Generates structured conventional commit messages (subject, body, type, scope) from a git diff or change description

## Facts

- Endpoint: GET https://api.strale.io/x402/commit-message-generate
- Price: $0.054001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 2
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-strale-io-8f824591
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_B-CeAc-elkCpsENF3fEbc

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 api-strale-io-8f824591
```

Example prompt: Generate a conventional commit message from this git diff: `- const x = 1\n+ const x = config.timeout` — use the 'conventional' style and give me the type, scope, subject, and body.

## When to prefer this

Use this endpoint when you need to auto-generate commit messages that conform to the Conventional Commits specification from raw git diffs or plain-English change descriptions. Ideal for CI/CD pipelines, developer tools, or AI coding assistants that need structured commit metadata (type + scope + subject + body) rather than a freeform message.

## Known failure modes

- Missing required 'diff' query parameter returns an error
- Empty or malformed diff may produce a generic or low-quality commit message
- Very large diffs may be truncated or result in overly broad messages
- Invalid 'style' enum value may fall back to default conventional format

## How this service works

Generate conventional commit messages from git diffs or change descriptions. Returns subject, body, type, scope.

## Output

Returns a structured commit message with: subject line (type + scope + short description), body (longer explanation of changes), commit type (e.g. feat, fix, chore, refactor), and scope (affected module or area)

## Example request

```json
{
 "diff": "- function calculateTotal(items) {\n-   return items.reduce((sum, item) => sum + item.price, 0);\n- }\n+ function calculateTotal(items) {\n+   const taxRate = 0.1;\n+   return items.reduce((sum, item) => sum + (item.price * (1 + taxRate)), 0);\n+ }",
 "style": "conventional"
}
```

## 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",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "diff"
     ],
     "properties": {
      "diff": {
       "type": "string"
      },
      "style": {
       "type": "string",
       "description": "conventional/angular/simple"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-strale-io-8f824591/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.strale.io](https://www.zero.xyz/host/api.strale.io/llms.txt)
