how to avoid timeouts with remote API requests?

how to avoid timeouts with remote API requests?

error code: 523