I used Google to search on "ArcGIS javascript api pricing" and on the first page found The ArcGIS JavaScript API is now available to the public:
The new ArcGIS JavaScript API and its accompanying online SDK are now
available for public use. ... Everyone can use the ArcGIS JavaScript
API. There is no fee for using the ArcGIS JavaScript API or deploying
an application built with it.
However, that appears to be outdated. More recently on GeoNet an answer to a similar question on "trying to understand the JavaScript API licensing terms and conditions" was:
You can get a definitive answer from your customer service rep, please
contact them.