how to avoid timeouts with remote API requests?

how to avoid timeouts with remote API requests?