You can enable the API using the command Enable-SecAPIAccess. The LoadMaster must be licensed for this command to work.

$eapi = Enable-SecAPIAccess -LoadBalancer $LMIP -Credential $creds
$eapi | Format-List
ReturnCode : 200
Response   : The API is enabled
Data       :
Note: If you license a LoadMaster using the API, the API is automatically enabled.