# Strale Schema Migration Generator

> Strale Schema Migration Generator is a paid API for AI agents from api.strale.io, paid per call via x402, $0.054/call, status unknown (last checked 2026-09-15).

Generates database schema migration scripts from a current schema to a desired schema, with optional ORM-specific output (Drizzle, Prisma, Knex, or raw SQL).

## Facts

- Endpoint: GET https://api.strale.io/x402/v2/schema-migration-generate
- Price: $0.054/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/strale-schema-migration-generator-8ff618ba
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ZUYtArkbNN7JDe5knpCPG

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 strale-schema-migration-generator-8ff618ba
```

Example prompt: Generate a Prisma migration script to go from my current schema — which has a users table with id, name, and email — to a desired schema that also includes a created_at timestamp and a role enum column.

## When to prefer this

Choose this endpoint when you need to automatically generate a database migration script between two known schemas, especially when targeting a specific ORM like Drizzle, Prisma, or Knex. It is ideal for developer agents automating CI/CD pipelines or schema version control. Prefer it over manual migration authoring when you have both the current and desired schema available as structured strings and want ORM-native or raw SQL output with an audit trail.

## Known failure modes

- Missing required desired_schema parameter returns a validation error
- Incompatible or unparseable schema strings may produce incorrect or empty migrations
- Unsupported ORM value in the orm parameter results in an error or fallback to raw SQL
- Network or service unavailability returns a non-200 HTTP status
- Ambiguous schema diff (e.g. column rename vs drop+add) may yield a best-guess migration requiring review

## How this service works

The trust layer for AI agents — 250+ independently tested data capabilities across 27 countries. Execute capabilities via REST, MCP, A2A, or x402 micropayments. Every call returns an audit record with cryptographic chain hashing.

## Output

Returns a generated migration script (in the requested ORM format or raw SQL) that transforms the current schema into the desired schema, along with a cryptographic audit record with chain hashing for traceability.

## 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": [
      "desired_schema"
     ],
     "properties": {
      "orm": {
       "type": "string",
       "description": "drizzle/prisma/knex/raw"
      },
      "current_schema": {
       "type": "string"
      },
      "desired_schema": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/strale-schema-migration-generator-8ff618ba/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)
