A user accesses SAP ERP data via APIs (e.g. via RFC). How do we have to license such accesses?

The technical API which is used to access the SAP system is not relevant for SAP and therefore has no influence on licensing aspects. Moreover, it does not matter if an API is used for online or offline tasks.

Hence, the Named Users of the third-party system and/or the user directly accessing the internal system are to be licensed.

Source: SAP System Measurement Guide, Version 7.0 (according to the manufacturer, this source may not be reproduced or transmitted)