Mock API Skill for Openclaw

A lightweight Python-based utility to instantly generate mock RESTful APIs for local development and integration testing.

sky-lv
v1.0.0
Apr 8, 2026
0
391
1

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install mock-api-skill

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install mock-api-skill using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Mock API Skill?

The Mock API Skill is a powerful tool designed to streamline the development lifecycle by allowing developers to simulate fully functional RESTful APIs. It eliminates dependencies on backend availability by providing a highly configurable environment for generating JSON responses across various HTTP methods including GET, POST, PUT, and DELETE.

Integrating this skill into your workflow through Openclaw Skills allows you to define complex API behaviors, including path parameters, query strings, and simulated network latency. Whether you are building a frontend application or testing agent-to-agent communication, this skill provides the necessary endpoints to ensure your logic is sound without waiting for a production backend.

Mock API Skill Use Cases

  • Rapidly prototype frontend interfaces before the backend implementation is ready.
  • Conduct integration testing with controlled API responses and simulated network delays.
  • Debugging client-side error handling by forcing specific HTTP status codes.
  • Demonstrating AI agent capabilities by providing predictable data sources via Openclaw Skills.

How Mock API Skill Works

  1. Initialize the service by pointing the Python script to a specific port or configuration file.
  2. The system parses the provided JSON configuration to map specific URL paths to their respective mock responses.
  3. For every incoming HTTP request, the skill matches the route and method to determine the output.
  4. It injects defined latencies and status codes before returning the JSON payload to the requester.
  5. Logs and built-in echo endpoints provide immediate feedback for request validation.

Mock API Skill Setup

To get started with the Mock API Skill, ensure you have Python installed. Use the following commands to run the server:

# Start on the default port (3000)
python mock_api.py

# Run on a custom port
python mock_api.py --port 8080

# Load a specific configuration file
python mock_api.py --config my_api.json

You can find more integration patterns in the Openclaw Skills documentation.

Mock API Skill Data Schema & Taxonomy

The skill uses a structured JSON configuration file to define endpoints.

Property Type Description
port Integer The local port the server listens on.
path String The endpoint URL, supporting variables like :id.
method String HTTP method (GET, POST, etc.).
response Object The JSON data returned by the API.
status Integer HTTP status code (e.g., 200, 404).
delay Integer Simulated response time in milliseconds.

Mock API Skill Advanced Features

  • Dynamic path parameter handling for simulating resource-specific lookups.
  • Built-in echo functionality for verifying headers and request bodies.
  • Programmable delay endpoints to test application resilience under laggy conditions.
  • Cross-Origin Resource Sharing (CORS) support enabled by default for seamless web development using Openclaw Skills.
  • Support for random data generation endpoints to stress-test UI components.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*