I hope I understood your phrase correctly:
In English you say "excuse me" when you need someone's attention, e.g. talking to a stranger for the first time or asking for a help in a shop. And you say "sorry" when you have accidentally done something that might upset someone, e.g. accidentally bumped into them when walking past.
Finnish does not have this so we use "anteeksi" for everything. (Finnish has also adopted "sori" or "sorry", but that is in spoken language, but we use that for both meanings as well.)
It's used when the phrase doesn't have an interrogation word (mikä, mitä, missä etc. or kuka, ketä, kenen etc.). Right now I can't think of any other occassion when it would not be used, so I say it's mandatory.
You can also attach that to almost any of the other words in the phrase if you want to emphasize them instead of the verb, e.g.: "Anteeksi, mutta sinäkö puhut suomea?" means something like "Sorry, but is it you who is speaking/can speak Finnish?" or "Are you (really) speaking Finnish?"