# fastapi.online — AI Database Schema Generator

> fastapi.online — AI Database Schema Generator is a paid API for AI agents from api.fastapi.online, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Generates a database schema (Prisma, Postgres SQL, or Mongoose) from a plain-English description of a data model

## Facts

- Endpoint: POST https://api.fastapi.online/generate-schema
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fastapi-online-ai-database-schema-generator-7acae0d2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_0ZXk8gzc2yktsVS_t-kPV

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 fastapi-online-ai-database-schema-generator-7acae0d2 -d '<json body>'
```

Example prompt: Generate a Prisma schema for a multi-tenant SaaS app with users, organizations, subscriptions, and audit logs — users belong to organizations, subscriptions track plan type and billing dates, and audit logs record who did what and when.

## When to prefer this

Choose this endpoint when you need a quick, AI-generated database schema scaffold in Prisma, Postgres SQL, or Mongoose format from a natural language description. Ideal for rapid prototyping, bootstrapping new projects, or when a developer wants a starting point without manually writing boilerplate schema code. Best when you want pay-per-call access with no signup required and crypto payment support via x402.

## Known failure modes

- Description too vague or too short (minLength 2 enforced) — returns error if description is under 2 characters
- Invalid db value (not prisma, postgres, or mongoose) — may default to prisma or return validation error
- Description exceeds 2000 character limit — returns 400 error
- Payment not attached or insufficient — returns 402 Payment Required
- Ambiguous or contradictory data model description may produce incomplete or incorrect schema
- Network timeout on complex schemas

## How this service works

Chat, embeddings, OCR, speech-to-text, image editing, image understanding (captioning/Q&amp;A), text-to-speech, translation, writing tools, classification tools, developer tools, local utilities, format/checksum validators, encoding &amp; crypto utilities, date/time calculators, geo/coordinate math, math &amp; finance calculators, novelty tools, and business/social writing generators — 179 endpoints in all, across multiple specialized self-hosted models. Pay per call with crypto — no signup — or get an API key.

## Output

Returns a ready-to-use database schema in the requested format (Prisma schema file syntax, raw Postgres DDL SQL, or Mongoose model definitions), generated from your plain-English data model description. The output includes entity definitions, fields with types, relationships, and constraints appropriate to the chosen database/ORM target.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "db": {
   "type": "string",
   "maxLength": 300,
   "description": "prisma | postgres | mongoose (default prisma)"
  },
  "description": {
   "type": "string",
   "maxLength": 2000,
   "minLength": 2,
   "description": "the data model to design"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fastapi-online-ai-database-schema-generator-7acae0d2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.fastapi.online](https://www.zero.xyz/host/api.fastapi.online/llms.txt)
