Skip to content

Mock API Generation ​

Instant REST APIs from your schema—no backend needed. Unblock frontend and mobile teams immediately.


How It Works ​

┌─────────────────────────────────────────────────────────────────┐
│                      MOCK API GENERATION                         │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│  Schema                          Live API                        │
│  ┌───────────────┐               ┌───────────────────────────┐  │
│  │ models:       │               │                           │  │
│  │   User:       │   Generate    │  GET  /users              │  │
│  │     id        │ ───────────▶  │  GET  /users/:id          │  │
│  │     name      │               │  POST /users              │  │
│  │     email     │               │  PUT  /users/:id          │  │
│  │   Product:    │               │  DELETE /users/:id        │  │
│  │     ...       │               │                           │  │
│  └───────────────┘               │  Base: api.phony.cloud/   │  │
│                                  │        your-project       │  │
│                                  └───────────────────────────┘  │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

How It Runs ​

The hosted Mock API is the one Phony feature served from Phony's cloud — and it can be, because it serves synthetic data only, generated on the fly from your schema. No production rows are ever involved, which is exactly why mocking is hosted while sync and snapshots run locally in your infrastructure. Prefer local or offline? phony mock start runs the same engine on your machine, free and unlimited. Details: Mock API Architecture.


API Modes ​

ModeFeaturesBest For
Read-OnlyGET only, deterministic, infinite paginationFrontend dev, demos, testing
Stateful CRUDFull CRUD, configurable TTL (1h/24h/7d/never)E2E testing, mobile dev

Deterministic Pagination ​

Same request always returns the same data. Page 999 works—generated on-demand, not stored.

Request: GET /users?page=5&per_page=10

Algorithm:
1. page_seed = hash(project_seed + endpoint + page_number)
2. For each item i in page:
   item_seed = hash(page_seed + i)
   generate(item_seed) → deterministic user

Result:
• Same request always returns same data
• Relationships maintained via FK seeds
• No storage cost (generated on-the-fly)

Filtering:

GET /users?age_gt=30
→ Generate candidates, filter, return page_size matches
→ Consistent via deterministic generation

Features ​

  • Custom subdomain: my-project.api.phony.cloud
  • Custom domains: (Team+) api.yourcompany.com
  • OpenAPI/Swagger: Auto-generated documentation
  • Auth simulation: API key, Bearer token, OAuth mock
  • Webhook simulation: Test webhook integrations
  • Latency simulation: Test timeout handling
  • Nested routes: /users/1/posts

Tier Limits ​

The local mock server (phony mock start) is free and unlimited for everyone; hosted endpoints are the paid feature.

FeatureFREESTARTERTEAMBUSINESS
Local Mock Server (CLI)✓✓✓✓
Hosted Endpoints✗525Unlimited
Stateful CRUD✗✓✓✓
State TTL—24h7 daysUnlimited
Custom Domain✗✗1Unlimited
Auth Simulation✗✓✓✓
Webhook Simulation✗✗✓✓

Phony Cloud — Documentation & Specification