How can you create a transaction with multiple inputs from the Blockcypher API? For example, I have two addresses and each of them has received 1 BTC. Now, I want to transfer 1.5 BTC to another address. How can I achieve this using the Blockcypher create transaction API?
Blockcypher API shows only the example of how to compose a transaction with a single input, therefore, it might look like the array of addresses will do the job, but no. If you'll do this by passing addresses into one array of inputs:
curl -d '{&quot;inputs&quot;:[{&quot;addresses&quot;:[&quot;addr1&quot;, &quot;addr2&quot;]}],&quot;outputs&quot;:[{&quot;addresses&quot;:[&quot;addr3&quot;],&quot;value&quot;:100000000}]}' https://api.blockcypher.com/v1/btc/test3/txs/new

You'll have only zero element grabbed from the addresses array from the inputs:
&quot;tx&quot;: {
    &quot;block_height&quot;: -1,
    &quot;block_index&quot;: -1,
    &quot;hash&quot;: &quot;002407bd35a6d0026cf0f5a018bd27311702560c03f1f64478105a547c91d895&quot;,
    &quot;addresses&quot;: [
      &quot;addr1&quot;, (inputs.addresses[0])
      &quot;addr3&quot; (outputs.addresses[0])
    ] ...

(Please note that I haven't included the whole tx blocks, only the ones containing the addresses.)
API will consider that you're using only one input, and may throw you an error if the value will be too big than the input's wallet balance.
&quot;Not enough funds in 1 inputs to pay for 1 outputs, missing -X&quot;

To create the tx with several inputs,  you'll have to pass arrays of addresses separately:
curl -d '{&quot;inputs&quot;:[{&quot;addresses&quot;:[&quot;addr1&quot;]}, {&quot;addresses&quot;:[&quot;addr2&quot;]}],&quot;outputs&quot;:[{&quot;addresses&quot;:[&quot;addr3&quot;],&quot;value&quot;:100000000}]}' https://api.blockcypher.com/v1/btc/test3/txs/new

This will give you the correct response, and the correct amount of inputs:
&quot;tx&quot;: {
    &quot;block_height&quot;: -1,
    &quot;block_index&quot;: -1,
    &quot;hash&quot;: &quot;ebcc8132c33a672cdd695a8953db503954abefa18bfd4727ea44f67b92c5ab6c&quot;,
    &quot;addresses&quot;: [
      &quot;addr1&quot;,
      &quot;addr2&quot;,
      &quot;addr3&quot;
    ] ...

In conclusion, it seems that the API itself is designed that way, at least at the moment of writing this answer.