Does discourse call AI APIs in the background

Yes, for many features like backfill of summaries, embeddings, sentiment, etc.

Of course, that is all dependent on which features you enabled and what settings do you have.