USSD stands for Unstructured Supplementary Service Data and is a way to communicate directly with the server of your Telco, almost always for free. Here are the major USSD codes in Thailand.
Here is an example video on how to check your balance on AIS 12Call with USSD method.
What can I use a USSD code for?
The most common uses for a USSD code are to load credit on to a prepaid phone and check your balance. Other uses include turning roaming on or off, subscribing to a voice or data plan, disabling or enabling data.
Will a USSD code work outside Thailand?
Yes, the good thing about a USSD code is you can use it out side Thailand. You might need it to check your balance or roaming.