Docs/AI-Powered Mocking

AI-Powered Mocking

Mock Studio integrates with AI to help you generate realistic mock data, create response variants, and build scenarios — all from natural language descriptions.

AI Providers

Configure your AI provider in Settings → AI Integration.

Managed AI (Pro)

Zero-config AI powered by Mock Studio's cloud service:

  • No API key required — just enable and use
  • Rate limits: 10 requests/minute, 60 requests/day
  • Requires a Pro subscription

Custom / Local AI

Bring your own AI provider:

OpenAI / Compatible APIs

  • Set the Endpoint URL (default: https://api.openai.com/v1)
  • Enter your API Key (e.g., sk-...)
  • Set the Model (e.g., gpt-4o, gpt-4o-mini)
  • Works with any OpenAI-compatible API (OpenRouter, Together AI, etc.)

Local AI (Ollama)

  • Set the Endpoint URL to http://localhost:11434/api/generate
  • No API key needed for local models
  • Set the Model (e.g., llama3, mistral)
  • Perfect for offline development and privacy-sensitive projects

AI Features

1. Generate Mock Data

Available in the Mock Editor:

  1. Click the AI sparkle icon (✨)
  2. Describe the data you want in plain English
  3. AI generates a JSON response matching your description

The AI uses the current response body as context, so you can iteratively refine:

  • "Add pagination metadata"
  • "Make the email addresses more realistic"
  • "Add 5 more items to the array"

2. Generate Variants (Pro)

Automatically create response variants for a mock:

  1. Open any mock in the editor
  2. Click "Generate Variants"
  3. AI analyzes the endpoint and generates 3-5 variants, such as:

- Not Found (404)

- Empty List (200 with empty array)

- Server Error (500)

- Unauthorized (401)

Each generated variant includes a name, status code, response body, and headers.

3. Scenario Name Generation (Pro)

When creating scenarios from network capture:

  1. Select requests and click "Create Scenario"
  2. Click the AI button to auto-generate a scenario name and description
  3. AI analyzes the request patterns to suggest meaningful names like "User Login Flow" or "Product Search"

Tips

  • Be specific — "Generate 5 users with realistic names, emails, avatars, and roles" works better than "generate users"
  • Use context — AI sees your current response body, so you can say "modify this to have 10 items" instead of describing from scratch
  • Iterate — Generate, review, then prompt again to refine