K6 Helper API

Image Generation, Schema Proxy & Payload Generation APIs

Home Payload Generator UI

API Endpoints


Schema Proxy API

Fetches Swagger/OpenAPI specs from OrderMesh API environments, bypassing CORS restrictions. Use this to retrieve live endpoint definitions for generating API calls.

Fetch Swagger Schema

GET
/api/proxy-schema?url={encoded_swagger_url}

Query Parameters:

url (string) required

Full URL to a Swagger/OpenAPI JSON spec. Must be from an allowed OrderMesh domain.

Allowed Domains:

api.dev.ordermesh.io api.qa.ordermesh.io api.uat.ordermesh.io api.stg.ordermesh.io api.perf.ordermesh.io api.ordermesh.io

Swagger URL Pattern:

https://{environment}/{service}/swagger/v1/swagger.json

Available Services (21):

order user carrier catalog config files geolocation history insight integration inventory merchant note notification routing shipment sku tax template transformation vendor
Examples:
# Fetch order service schema from dev GET /api/proxy-schema?url=https%3A%2F%2Fapi.dev.ordermesh.io%2Forder%2Fswagger%2Fv1%2Fswagger.json # Fetch user service schema from prod GET /api/proxy-schema?url=https%3A%2F%2Fapi.ordermesh.io%2Fuser%2Fswagger%2Fv1%2Fswagger.json # Fetch catalog service schema from QA GET /api/proxy-schema?url=https%3A%2F%2Fapi.qa.ordermesh.io%2Fcatalog%2Fswagger%2Fv1%2Fswagger.json
cURL:
curl "https://generator.ordermesh.io/api/proxy-schema?url=https%3A%2F%2Fapi.dev.ordermesh.io%2Forder%2Fswagger%2Fv1%2Fswagger.json"
JavaScript (fetch):
const env = 'dev'; const service = 'order'; const swaggerUrl = `https://api.${env}.ordermesh.io/${service}/swagger/v1/swagger.json`; const proxyUrl = `/api/proxy-schema?url=${encodeURIComponent(swaggerUrl)}`; const response = await fetch(proxyUrl); const schema = await response.json(); // schema.paths contains all endpoints // schema.components.schemas contains all request/response models console.log('Endpoints:', Object.keys(schema.paths)); console.log('Models:', Object.keys(schema.components?.schemas || {}));
k6 usage:
import http from 'k6/http'; export default function () { // Fetch the schema const swaggerUrl = 'https://api.dev.ordermesh.io/order/swagger/v1/swagger.json'; const proxyUrl = `https://generator.ordermesh.io/api/proxy-schema?url=${encodeURIComponent(swaggerUrl)}`; const schema = JSON.parse(http.get(proxyUrl).body); // Use endpoints from schema for (const [path, methods] of Object.entries(schema.paths)) { console.log(`${Object.keys(methods).join(',')} ${path}`); } }

Response:

200 — Full Swagger/OpenAPI JSON spec (cached 5 minutes)
400 — Missing url query parameter
403 — Domain not in allowlist
500 — Upstream fetch failed

Try It: Fetch Schema

Select an environment and service to fetch its Swagger spec.

Result:


Image Generation API

Generate test images on-the-fly for use in k6 load tests, file upload testing, and UI tests.

Try It: Generate Image

Result:

Generate Image (Query Parameters)

GET POST
/api/generate-image

Query Parameters / POST Body:

width (number, 100-5120)

Image width in pixels

height (number, 100-2880)

Image height in pixels

pattern (string)

Pattern type: geometric, gradient, noise, abstract (default: geometric)

seed (number, optional)

Random seed for deterministic generation

thumbnail (boolean)

Return thumbnail instead of original (default: false)

random (boolean)

Generate random dimensions (default: false)

Examples:
GET /api/generate-image GET /api/generate-image?width=1024&height=768 GET /api/generate-image?width=800&height=600&pattern=gradient&seed=12345 GET /api/generate-image?random=true&pattern=noise

Generate Image (Filename-based)

GET
/api/image/{filename}

Filename Formats:

Seed only

s{seed}.png — defaults to 800x600, geometric

Pattern only

p{pattern}.png — defaults to 800x600

Seed + pattern

s{seed}_p{pattern}.png — defaults to 800x600

Dimensions

{width}x{height}.png

Dimensions + seed

{width}x{height}x{seed}.png

Dimensions + pattern

{width}x{height}x{pattern}.png

Full

{width}x{height}x{seed}x{pattern}.png

Underscore format

h_{height}_w_{width}_s{seed}_p{pattern}.png

Examples:
GET /api/image/pgeometric.png GET /api/image/s12345.png GET /api/image/s12345_pgradient.png GET /api/image/800x600.png GET /api/image/1024x768x12345.png GET /api/image/600x400xgeometric.png GET /api/image/1024x768x12345xgradient.png GET /api/image/h_768_w_1024_s12345_pgradient.png

Response

Content-Type: image/png

Returns a PNG image file that can be used directly in HTML, downloaded, or uploaded in tests.

Usage in HTML:
<img src="/api/generate-image?width=800&height=600&seed=123" /> <img src="/api/image/800x600x123.png" />
Usage in k6 Tests:
import http from 'k6/http'; export default function () { const imageUrl = 'https://generator.ordermesh.io/api/image/1024x768x12345.png'; const imageData = http.get(imageUrl).body; const formData = { file: http.file(imageData, 'test.png', 'image/png') }; http.post('https://api.example.com/upload', formData); }

Pattern Types

geometric

Random shapes (rectangles, circles, triangles)

gradient

Linear gradient with random colors

noise

Random pixel noise pattern

abstract

Random curves and lines