Both of those approaches are based on the assumption that your API clients are coming from HTTP / javascript served via Caddy, and that you can locate to effectively isolate and replace those bad responses.
You could also go for the ultimate jank of serving HTTPS on port 80. This is Wrong™, and Caddy will try to stop you from doing this by default, so you’d need to move HTTP off port 80 with the http_port global option. This will change the HTTP port (and therefore the redirect listener) for the whole server, so be aware, but it will let you listen on https://:80 and handle that however you please. I think better than that, though, would honestly be putting a layer 4 proxy in front to intercept HTTPS on port 80 and redirect it to 443, leaving Caddy’s HTTP server operating normally.
If the API client is a browser served scripts from another server, then Caddy can’t do anything to correct the outgoing links.
If Caddy can’t listen to HTTPS on port 80, then Caddy can’t do anything to accept the incoming requests.
You would be, therefore, at a deadlock unless you can put another listener in front of Caddy’s httpserver, to intercept the bad traffic and redirect it to the right place.