Is Traverse a replacement for REST APIs?
No. Traverse does not replace REST APIs. They solve different problems at different layers. REST APIs handle network-accessible endpoints, authentication, routing, and resource management. Traverse handles portable execution of business logic with contract enforcement. The two work together — your REST API is often the transport layer that calls a Traverse capability internally.
What REST APIs do that Traverse does not
- Handle HTTP routing and verbs
- Manage authentication and authorization
- Expose resources to external clients over the network
- Handle pagination, filtering, and resource relationships
- Provide versioned public interfaces for other teams or third parties
What Traverse does that REST APIs do not
- Execute business logic in a sandboxed WASM environment
- Enforce preconditions and postconditions on every call
- Run the same binary in the browser, edge, and server with identical behavior
- Produce a trace artifact for every execution
- Expose capabilities to AI agents via MCP without building API endpoints
A common pattern
You keep your REST API. When a POST request to /orders/calculate comes in, your API handler authenticates the caller, extracts the request body, and calls the Traverse calculate_order_total capability. The capability runs with contract enforcement. The API handler formats the result and returns a response. Traverse handles the business logic layer. Your API handles everything else.
The portability angle
The reason you would reach for Traverse over a plain function call inside your API handler is portability and consistency. If you want the same pricing logic to run in the browser for instant previews and on the server for billing — with identical results and full enforcement — Traverse gives you that. A REST API endpoint cannot run in a browser without a network call.