From Galaxypedia

Credits are the main currency in Galaxy. They are used to manufacture or purchase Ships, buy Materials, upgrade a player's Warehouse, complete Quests, upgrade or loan to Starbases, and more.

Typically, people earn credits by Mining or Trading. However, some more experienced players Pirate to earn credits.

Buying Credits

As an alternative to the normal methods, Credits may be purchased using ROBUX. Buying credits helps support Galaxy.