Zareh, if you just want to build your own JS API applications and attach to external map services (such as Esri) then you don't need any license. You can just attach to the Esri server to pull the API and their map services.
If you are talking about publishing your own map services via REST to be consumed in your JS applications then I think you need ArcGIS Server 9.3 or higher. Good luck!