Make Unity games without a live server: mock HTTP/REST API backends, script mock response sequences with custom status/latency/headers/body, JSON capture, env variables, persistent play session logs.- This package is render‑pipeline agnostic and works with Built‑in RP, URP and HDRP, Tested with Unity 2021.3 LTS and above.- Contains only C# scripts, Editor UI and ScriptableObjects – no custom shaders or materials.- Requires the official com.unity.nuget.newtonsoft-json 3.2.1 package (Unity will prompt to install it if missing).API Mocking Toolkit lets you keep building online features even when your backend API is missing, unstable or slow. Instead of hard‑coded test URLs or throw‑away JSONs, you manage all of your HTTP/REST endpoints from one Editor window and flip between real/local/qa servers or just mock them with rich customisable response (sequences) of headers/bodies/latency/status codes, etc.What you configure – In a single, focused editor window you define collections of endpoints (for example "Auth + Player Profile" or "Storefront API"), choose HTTP method, URL, match mode, status code, latency and JSON body, and group them into reusable collections you can share with your team. You can keep separate collections for features, teams or projects, load only what you need, and export/import collections in OpenAPI 3.0 or native JSON — both are round‑trip safe (OpenAPI uses vendor extensions to preserve mock data losslessly) — so they can live in source control or be shared with backend/API teammates; a smart merge dialog prevents duplicates when re‑importing.How you use it while playing – Your game continues to talk to your usual HTTP wrapper / `ApiClient`. The toolkit quietly intercepts those calls and, based on your settings, either forwards them to the real server (dev/QA/prod) or returns a mock response. Toggling Use Mock switches between real and simulated responses without touching gameplay code, so you can quickly explore slow servers, error codes or specific payloads while watching requests in the session log, revisiting logs from previous play sessions, and jumping straight back to the endpoint that handled them.Typical use cases – Prototyping online features, letting designers and QA explore flows without a backend, writing repeatable integration tests that never hit production, and quickly reproducing bugs that depend on specific payloads or timing.How it works – The toolkit stores your endpoints as reusable collections edited through the window. At runtime it intercepts HTTP calls made via its API and decides between a real `UnityWebRequest` and a mock response based on your settings. Environment profiles (Dev/Staging/Prod) let you flip base URLs, and the session log tracks every call.Limitations – Focused on HTTP/HTTPS APIs that use `UnityWebRequest`; it does not currently mock WebSockets, gRPC or streaming APIs.Designed and tested with Unity 2021.3 LTS+.For more details visit: https://api-mocking-toolkit.codecarnage.com/Focused editor window for managing reusable collections of HTTP endpointsPer‑endpoint method, URL, match type, status code, latency, headers and JSON bodyMock / Real toggle per endpoint – switch between real dev/QA/prod servers and local mocks without changing gameplay codeEnvironment system with Dev / Staging / Prod profiles, environment variables (for example `{{baseUrl}}`, API keys) and an `AllowInBuild` flag so only safe production environments end up in final game builds (enforced by a build preprocessor)Built‑in API client inside the editor to send live HTTP requests against your dev/QA/prod servers, inspect headers and body, and capture the response body into success or error mocks you can then editImport/export of endpoint collections as native JSON or OpenAPI 3.0 JSON — both are round‑trip safe (OpenAPI uses `x-amt-*` vendor extensions to preserve mock variants, headers, match types and folder structure losslessly); smart merge on re‑import (matched by stable Id or URL+Method) prevents duplicate endpointsPlay session API history logging with request/response headers and bodies, latency, and a mock‑vs‑real flag; sessions are saved to disk, reloadable later, and include a "🔗 View Endpoint" button to map api response from history into the collection endpoint.Demo scene showing a simple "Test API" button with success, error and latency flowsAsync‑friendly runtime API that integrates with `UnityWebRequest` and your existing HTTP wrapperWorks with Built‑in RP, URP and HDRP (no shader or art dependencies)Documentation for quick start, testing and known limitationsDepends on Unity package `com.unity.nuget.newtonsoft-json` 3.2.1 (official Newtonsoft Json binding)For more details visit: https://api-mocking-toolkit.codecarnage.com/I used AI assistants (such as ChatGPT/Claude) to help with documentation and boilerplate/test scaffolding, and code reviews.All suggestions were reviewed, edited and tested by me before inclusion.The package does not include any textures, models, audio or other art assets that were generated by AI.


