Prepositions are often tiny words, like with, on, for, by, in, up, of. They don't really jump out at us but the funny thing is, they're powerful. The addition of those little words to common verbs greatly changes their meaning. Consider the differences in meaning of hang out, hang up, hang on or hang in there.
The same goes for the verb "chat" and the additions of the words "with" or "up." Sometimes the two are confused; as it turns out, they're not interchangeable.
Imagine running into a coworker in the supermarket. Chances are good you'll chat with that person. Chatting the person up, however, might earn you an invitation to HR (or a date, depending on the situation).
The expressions "to chat with" someone and "to chat up" someone are vastly different. To "chat with" simply means to engage in pleasant, breezy conversation. By sharp contrast, to "chat up" means to flirt or "to hit on," as another popular expression goes.
Given that, compare these two sentences:
The teacher happily chatted with pupils in the hallway.
While the first sentence conjures an innocent schooldays scene, the second sentence is downright creepy.
The teacher happily chatted up pupils in the hallway.
Source: Oxford Dictionary of Current English, 2001.