Mock Server
Schema-validated mock API responses for development and testing without credentials
The RevKeen mock server returns realistic, schema-validated responses generated from the OpenAPI specification. No API key required, no data persisted, no side effects.
Hosted Mock Server
RevKeen hosts a public mock server -- no setup required:
| Base URL | https://mock-api.revkeen.com/v2 |
| Auth | None required |
| CORS | All origins allowed |
| Rate limit | 30 requests/second per IP |
Try it now:
# No API key needed
curl https://mock-api.revkeen.com/v2/customers
curl https://mock-api.revkeen.com/v2/products
curl https://mock-api.revkeen.com/v2/invoicesHow It Works
The mock server is powered by the Scalar CLI and uses the OpenAPI specification to generate responses:
- Request validation -- Incoming requests are validated against the spec (correct path, method, required parameters)
- Response generation -- A response is generated from the schema definition, using example values where available
- Status codes -- The mock server returns the appropriate status code for each endpoint
- No persistence -- Nothing is stored. Each request returns a fresh response from the schema
Mock responses are deterministic and generated from the schema. They will not reflect data you have created or modified -- for that, use the Sandbox environment at sandbox-api.revkeen.com.
When to Use Mock vs Sandbox
| Scenario | Mock Server | Sandbox |
|---|---|---|
| Prototype a UI without signing up | Yes | No |
| Validate request/response shapes | Yes | No |
| Integration tests with realistic flows | No | Yes |
| CI pipeline shape validation | Yes | No |
| End-to-end payment testing | No | Yes |
| Test webhook delivery | No | Yes |
| Client demos | Either | Either |
| SDK development | Yes | Yes |
| Load testing | No | No |
Rule of thumb: Use the mock server for shape validation and UI prototyping. Use Sandbox when you need data persistence, state changes, or realistic payment flows.
Using With SDKs
Point any SDK at the mock server by overriding the base URL:
import RevKeen from '@revkeen/sdk';
const client = new RevKeen({
apiKey: 'mock_key', // Any value works
baseUrl: 'https://mock-api.revkeen.com',
});
const customers = await client.customers.list();from revkeen import RevKeen
client = RevKeen(
api_key="mock_key",
base_url="https://mock-api.revkeen.com"
)
customers = client.customers.list()use RevKeen\Client;
$client = new Client('mock_key', [
'base_url' => 'https://mock-api.revkeen.com'
]);
$customers = $client->customers->list();Local Mock Server
For offline development or when you need the mock server locally:
# Install and run (one command)
npx @scalar/cli mock https://api.revkeen.com/v2/openapi.json --port 4010
# Available at http://localhost:4010/v2If you have the repo cloned:
# From the packages/openapi directory
pnpm mock
# Starts on http://localhost:4010Limitations
The mock server does not support:
- Data persistence -- POST requests return mock responses but do not store anything
- Stateful flows -- Creating a customer and then listing it will not show the created customer
- Payment processing -- No gateway interaction occurs
- Webhook delivery -- No events are fired
- Authentication -- API keys are not validated (any value works)
- Rate limiting -- No rate limits are enforced (hosted mock has per-IP limits only)
For any of these, use the Sandbox environment.