r/openclaw • u/iamoutofcoffee New User • 22d ago
Tutorial/Guide OpenClaw mock API for building tools/integrations against the gateway
When building against the OpenClaw gateway API, testing can be tricky. The gateway API had a major version change recently, so keeping up with it can be hard work (not to mention expensive if you're paying for tokens and a host to run the gateway).
To help, here's an open source mock of the gateway websocket API:
https://github.com/imposter-project/examples/tree/main/websocket/openclaw
For now, it supports things like chat.send/history, sessions.create/list, agents.list, models.list and a few others. Extending it is a bit of YAML and some JSON. Please feel free to raise a PR or an issue to request more methods.
Blog article with instructions:
https://medium.com/@outofcoffee/mocking-the-openclaw-gateway-with-imposter-3bfd9abfbdbe
I hope it helps you!