generate api for credits