The question is maybe a bit off-topic a d vague. That's because I struggle to express it with the right terms:
I'm looking for a generic tool to build and then serve:
Accept Incoming request (API contract A)
Send outgoing request (API contract B) potentially with parameters from the incoming request
Receiving incoming response (API contract B)
Do some translations/string manipulation
Send outgoing response (API contract A)
mitmproxy (https://mitmproxy.org/) has scripting support that will let you do most of this.
For example, you can expose mitmproxy, listen to HTTP requests for a specific host (using this API: https://docs.mitmproxy.org/stable/api/mitmproxy/http.html), intercept the request, do whatever API calls you need, and inject a response without ever forwarding the request to the original server.
If you don't want to act like a proxy, you're going to approach this like a normal web applications that does HTTP requests using whatever HTTP client your framework of choice uses.
I'm looking for a generic tool to build and then serve:
Accept Incoming request (API contract A) Send outgoing request (API contract B) potentially with parameters from the incoming request Receiving incoming response (API contract B) Do some translations/string manipulation Send outgoing response (API contract A)