Why a key pair is used in OpenSSL ECDSA_sign or ECDSA_do_sign instead of only private key ? If the digital signature in ECC (ECDSA) is made using a private key, why is the OpenSSL library using ECKEY pair as an input parameter instead of the private key only ?
ECKEY object may contain:


Group
Private key
Public key


Both Group and Private key are needed to be able to calculate signature. It is most convenient to use generic ECKEY object (from API perspective), as it easy to e.g. convert between commonly used PKCS#8 PEM encoded EC private keys and ECKEY objects, and because just a BIGNUM would not be sufficient.

It is possible to use ECKEY object that does not have public key field filled in for ECDSA signing. Likewise, certain functions (most notably verify operation, where private key usually is not accessible) can be used with ECKEY that does not private key filled in (i.e., it is NULL).