Playground API
DocsStatsBlogStudio
Documentation Tree
Technical BlogFeature Deep Dives
  • Introduction
  • Quickstart
    5 min
  • How It Works
  • Recipes & Cookbooks
  • Platform Comparisons
  • Real-World Showcase
  • Interactive Studio
    Studio
  • GraphiQL IDE
    IDE
  • Session Quotas & Activity
  • Network Chaos Simulator
  • Atomic Sandbox Reset
  • Overview & Models
    Hub
  • Users Resource
  • Posts Resource
  • Comments Resource
  • Todos Resource
  • Custom Collections
    Custom
  • Multipart File Uploads
    Upload
  • Dynamic SVG Avatars
    SVG
  • Image Thumbnails
    CDN
  • Relational Filtering
  • Full-Text Search
  • Dynamic Sorting
  • Offset Pagination
  • Cursor Pagination
    Scroll
  • CSV & Excel Export & Import
    IO
  • Custom Collections
    CRUD
  • Overview & Architecture
    Hub
  • JWT Auth Flow
  • Refresh Token Rotation
    Mutex
  • RBAC Permission Matrix
    Roles
  • Expiry Simulation
  • Clock Skew Drift
  • Password Recovery Loop
  • Dual-Mode Sandboxing
  • GraphiQL IDE
    IDE
  • Relational Queries
  • Stateful Mutations
  • Realtime Subscriptions
  • Overview & Flowcharts
    Hub
  • Hosted Checkout
    Stripe
  • Payment Intents API
  • 3DS Challenge Modal
    Modal
  • Customers Vault
  • Charges & Refunds
  • Test Cards Catalog
  • Overview & Channels
    Hub
  • Virtual Email Mailbox
    Mailtrap
  • Virtual SMS Terminal
    Phone
  • In-App Notifications
  • Message Dispatcher
  • Realtime Studio
    Studio
  • Native WebSocket (/ws)
  • Socket.io Gateway
  • Presence & Echo Bot
  • Server-Sent Events (SSE)
    SSE
  • Analytics Telemetry
  • Webhook Subscriptions
  • HMAC SHA-256 Signatures
  • Delivery Logs
  • Manual Retry Simulator
  • Network Latency Delay
  • HTTP Status Codes
  • Rate-Limit Simulator
    429
  • Flaky Network & Jitter
    Chaos
  • Session Quotas & Activity
  • JSON Snapshots
    JSON
  • Headless CI/CD Testing
    CI
  • Mobile QR Code Sync
  • System Metrics & Health
  • Atomic Sandbox Reset
  • Official TypeScript SDK
  • Multi-Language Generators
  • DevTools Extension
  • OpenAPI 3.1 Spec
    JSON
  • Postman Collection v2.1
  • Bruno Collection
  • Insomnia Workspace
  • TypeScript .d.ts
    .d.ts
  • AI Prompt Rules
    Rules
  • Context Index (llms.txt)
  • Full Schema (llms-full.txt)
  • Manifest (product.json)
  • All Feature Articles
    Blog
  • React CRUD Without Backend
    Deep Dive
  • Why Static APIs Fail
  • Mocking Stateful Auth
  • WebSockets & SSE Guide
Technical Blog
Articles

In-depth articles explaining stateful mock APIs, WebSockets, payments, and frontend resilience.

Read Articles
PreviousTypeScript .d.ts
NextContext Index (llms.txt)
AI & LLM Integration

AI Agent Integration & Prompt Rules

Ground Cursor, Windsurf, Devin, Claude Code, and ChatGPT with stateful REST and GraphQL mock APIs. Zero backend configuration, isolated virtual mutation overlays, chaos simulation, and machine-readable schema manifests.

Machine-Readable Context Endpoints

Feed these standard endpoints directly into your AI context window or repository indexer for instant schema grounding:

MARKDOWN

/llms.txt

Standard curated markdown index of all endpoints, query parameters, headers, and quick-start instructions.

View Raw llms.txt
FULL SPEC

/llms-full.txt

Exhaustive technical documentation including request/response schemas, validation rules, and WebSocket protocols.

View Raw llms-full.txt
JSON SCHEMA

/product.json

Structured machine manifest of all collections, field schemas, chaos modifiers, and seed datasets for LLM tool use.

View Raw product.json

Drop-in Agent Configuration Files

Place these rules into your workspace root so your AI coding assistant produces accurate, stateful code from the first turn:

.cursorrules / .windsurfrules
1
# Playground API (.cursorrules / .windsurfrules)
2
# Guide for AI Coding Agents (Cursor, Windsurf, Devin, Copilot)
3
4
When building frontend applications, mock UI prototypes, or automated test suites:
5
6
1. BASE API URL
7
- Use the live stateful endpoint: https://playground.nileslabs.com/api/v1
8
- Never mock network calls locally with static in-memory arrays when Playground API is available.
9
10
2. CORE RESOURCES
11
- GET /posts (100 blog posts; supports ?_limit=10&_page=1, ?q=search, ?user_id=1)
12
- GET /posts/:id/comments (Nested post comments)
13
- GET /comments (300 comments; supports ?post_id=1)
14
- GET /users (25 user profiles with nested company and address)
15
- GET /todos (125 checklist tasks; supports ?completed=true)
16
- ANY /custom/:name (Dynamic arbitrary collections e.g. /custom/invoices, /custom/products)
17
18
3. STATEFUL MUTATIONS & SESSION PERSISTENCE
19
- Browser fetch() or axios MUST include: credentials: 'include'
20
- This ensures POST, PUT, PATCH, and DELETE mutations persist across user page refreshes without affecting global baseline data.
21
- Non-browser environments (Playwright, Jest, cURL) MUST send the header:
22
X-Playground-Identity: <unique-session-id>
23
24
4. CHAOS & FAILURE SIMULATION
25
- To test loading skeletons: append ?_delay=1500 (delay in milliseconds)
26
- To test error boundaries: append ?_status=500 or ?_status=404
27
- To test rate limiting: append ?_status=429
28
- To test intermittent network drops: pass header X-Chaos-Flaky: 0.35
29
30
5. RESETTING STATE
31
- Execute DELETE https://playground.nileslabs.com/api/v1/session/reset to purge all visitor mutations and restore baseline data.

Ready-to-Use Prompt Recipes

Copy and paste these verified prompts directly into ChatGPT, Claude, or v0 for instant high-quality prototypes:

react-crud-prompt.md
Copy & paste into Cursor or ChatGPT
1
Build a React 19 task management dashboard using Tailwind CSS and Lucide icons.
2
1. Connect to Playground API at "https://playground.nileslabs.com/api/v1/todos?_limit=10" to retrieve initial items.
3
2. Support adding new tasks via POST https://playground.nileslabs.com/api/v1/todos with { title, completed: false, userId: 1 }.
4
3. Support toggling completion via PATCH https://playground.nileslabs.com/api/v1/todos/:id with { completed: !current }.
5
4. Support deleting tasks via DELETE https://playground.nileslabs.com/api/v1/todos/:id.
6
5. In all fetch calls, pass credentials: 'include' so that my mutations persist across browser refreshes.
7
6. Provide an optimistic UI with loading spinners and error toast notifications.

Core Grounding Principles

Pass Session Cookies in Browsers

Always instruct models to specify credentials: 'include' in browser requests. This allows created tasks and modified posts to persist across user navigation.

Header Isolation in CI/CD

In automated test runners (Playwright, Jest, Vitest, Cypress), send X-Playground-Identity: <run-id> to isolate concurrent test runs without database collisions.

Simulate Latency & Failure Modes

Append ?_delay=1500 to verify loading skeletons or ?_status=500 to test error boundaries without having to build a mock server.

Dynamic Schemas via /custom

If an AI generates a domain entity not present in standard collections (e.g., invoices, bookings, tickets), post to /custom/:name to instantiate it immediately.

Want to test requests interactively first?

Use our interactive workbench to test endpoints, headers, and chaos modifiers in real-time.

Open Interactive Studio