move credits into function for reuse on server docs