API Mock Responses
Generate a realistic mock API response with headers, status code and a body that matches the schema.
Pay by wallet (x402) AI-generated
api-mock-response Example
Input
{
"url": "https://example.com"
} Answer
{
"url": "https://example.com",
"body": {
"data": {
"id": "user_123456",
"name": "John Doe",
"email": "john.doe@example.com",
"status": "active",
"profile": {
"bio": "Software Engineer",
"location": "San Francisco, CA",
"avatar_url": "https://example.com/avatars/user_123456.jpg"
},
"created_at": "2023-06-15T08:30:00Z",
"updated_at": "2024-01-10T14:32:15Z"
},
"meta": {
"version": "1.0",
"timestamp": "2024-01-10T14:32:15Z"
},
"success": true
},
"method": "GET",
"headers": {
"Date": "Wed, 10 Jan 2024 14:32:15 GMT",
"ETag": "W/\"33a64df551425fcc55e4d42a148795d9f25f89d4\"",
"Server": "nginx/1.24.0",
"Connection": "keep-alive",
"Content-Type": "application/json",
"X-Request-Id": "550e8400-e29b-41d4-a716-446655440000",
"Cache-Control": "public, max-age=300",
"X-RateLimit-Limit": "5000",
"X-RateLimit-Reset": "1699564800",
"X-RateLimit-Remaining": "4999"
},
"status_code": 200,
"content_type": "application/json"
} Inputs
| Field | Type | Required | What it is |
|---|---|---|---|
url | string | Yes | — |
method | string | No | — |
status_code | integer | No | — |
response_schema | object | No | — |
Output fields
How reliably each field appears in a successful answer.
| Field | Type | Appears |
|---|---|---|
body | any | Always (present in every successful answer) |
headers | object | Always (present in every successful answer) |
status_code | integer | Always (present in every successful answer) |
content_type | string | Always (present in every successful answer) |
How to call it
The same tool through each route. MCP clients reach it through Strale’s server at https://api.strale.io/mcp; the call below is what the agent sends.
# Needs an API key. max_price_cents caps what this call may cost.
curl -X POST https://api.strale.io/v1/do \
-H "Authorization: Bearer $STRALE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"capability_slug": "api-mock-response",
"inputs": {
"url": "https://example.com"
},
"max_price_cents": 5
}' {
"tool": "strale_execute",
"arguments": {
"slug": "api-mock-response",
"inputs": {
"url": "https://example.com"
},
"max_price_cents": 5
}
} import { Strale } from "straleio";
const strale = new Strale({ apiKey: process.env.STRALE_API_KEY! });
const result = await strale.do({
capability_slug: "api-mock-response",
inputs: {
"url": "https://example.com"
},
max_price_cents: 5,
}); import os
from straleio import Strale, DoRequest
strale = Strale(api_key=os.environ["STRALE_API_KEY"])
result = strale.do(DoRequest(
capability_slug="api-mock-response",
inputs={
"url": "https://example.com",
},
max_price_cents=5,
)) # No account. The first request answers 402 with the price in USDC;
# an x402 client pays it from your wallet and repeats the request.
curl -i 'https://api.strale.io/x402/v2/api-mock-response?url=https%3A%2F%2Fexample.com' Limitations
Mock values may fail rules spanning several fields
Generates plausible mock data based on schema — mock values may not satisfy complex cross-field validation rules
What to do instead: Provide example responses in the input to guide mock generation for fields with specific value constraints
Related tools
- Agent Trace Analysis €0.20
- API Docs Generator €0.20
- Changelog Generator €0.03
- Code Converter €0.05
- Commit Message Generator €0.05
- Context Window Optimiser €0.03