API and agents