docs/content/guides/developer/getting-started/get-coins.mdx
To perform transactions on a Sui network, you need SUI tokens to pay for gas and storage.
For applications on Mainnet, you must buy real SUI on exchanges like Coinbase, OKX, or Robinhood. Its value is determined by market factors such as supply and demand, network utility, and perceived value.
Because Mainnet tokens cost real money, development can be expensive. That's why Sui provides Devnet and Testnet networks, which mirror Mainnet features and enable you to build and test safely for an affordable cost.
:::important
SUI tokens on Devnet and Testnet are free and hold no monetary value.
:::
You can get free SUI tokens from the Sui faucet, which lets you deploy and interact with smart contracts and objects on Devnet, Testnet, or a local network. There is no faucet for Mainnet.
<Tabs className="tabsHeadingCentered--small"> <TabItem value="prereq" label="Prerequisites">Set up your Sui account and CLI environment.
Create Sui account and setup CLI environment.
</summary>$ sui client
If this is the first time running the sui client CLI tool, it asks you to provide a Sui full node server URL (or press enter for the default Testnet), select an encryption scheme to generate an address, and stores the configuration in a client.yaml file. For more information, refer to the Sui client CLI tutorial.
If this is not your first time running sui client, then you already have a client.yaml file in your local environment. If you'd like to create a new address for this tutorial, use the command:
$ sui client new-address ed25519
Visit the online faucet to request SUI tokens: https://faucet.sui.io/
Then, follow these steps:
sui client active-address.To request more SUI, refresh your browser and click the Request SUI button again. The requests are rate limited, however, so too many requests results in a waiting period before you are able to request more tokens.
You can also use the following community-provided faucets to obtain SUI tokens:
These faucets have their own separate limits, such as one request per day or one request every few hours.
To check your balance of SUI tokens and confirm you received some from the faucet, use the command:
$ sui client balance
Alternatively, use a Sui Explorer such as SuiVision or SuiScan to check the SUI token balance of an address.
You should have a balance of SUI tokens:
╭────────────────────────────────────────────╮
│ Balance of coins owned by this address │
├────────────────────────────────────────────┤
│ ╭────────────────────────────────────────╮ │
│ │ coin balance (raw) balance │ │
│ ├────────────────────────────────────────┤ │
│ │ Sui 56804696124 0.50 SUI │ │
│ ╰────────────────────────────────────────╯ │
╰────────────────────────────────────────────╯
If you do not have a balance, repeat the request SUI tokens from faucet steps, or use an alternative faucet method.
The faucet drains from a finite pool of SUI. If the pool empties, it disrupts faucet service for the rest of the community. To help ensure this doesn't happen, you can use the online faucet to return your unused SUI to the Testnet pool. You cannot return SUI to the Devnet or Localnet pools.
There are two ways to return unused Testnet SUI tokens:
Connect your wallet to the online faucet, and click the Return tokens to faucet button. Approve the transaction using your wallet and your SUI tokens are returned to the pool.
If you prefer not to connect your wallet, send the tokens to the address 0x7a9d19d4c210663926eb549da59a54e25777fef63161bfccda08277b58b4212e via a separate transaction.
If you need an alternative method to get SUI tokens for deployment on Testnet or Devnet, you have several options.
:::tip
Every method to obtain SUI tokens for Testnet and Devnet is rate limited. If you need a large amount of SUI tokens, use a local network.
:::
<Tabs> <TabItem value="discord" label="Discord">Join Discord.
If you try to join the Sui Discord channel using a newly created Discord account, you might need to wait a few days for validation.
Request SUI tokens in the Sui #devnet-faucet or #testnet-faucet Discord channels. Send the following message to the channel, replacing <YOUR SUI ADDRESS> with your client address:
!faucet <YOUR SUI ADDRESS>
Use the following cURL commands to set console variables and request tokens directly from the faucet server. Set NETWORK to either testnet or devnet.
$ ADDRESS=$(sui client active-address)
$ NETWORK=testnet
$ curl --location --request POST "https://faucet.${NETWORK}.sui.io/v2/gas" \
--header "Content-Type: application/json" \
--data-raw "{
\"FixedAmountRequest\": {
\"recipient\": \"${ADDRESS}\"
}
}"
If you're working with a local network, replace "https://faucet.${NETWORK}.sui.io/v2/gas" with the appropriate value based on which package runs your network:
sui-faucet: http://127.0.0.1:5003/gassui: http://127.0.0.1:9123/gasYou can access the faucet using the Sui TypeScript SDK.
import { getFaucetHost, requestSuiFromFaucetV2 } from '@mysten/sui/faucet';
// get tokens from the Devnet faucet server
await requestSuiFromFaucetV2({
// connect to Devnet
host: getFaucetHost('devnet'),
recipient: '<YOUR SUI ADDRESS>',
});
If you are running a local Sui network, you can get SUI tokens from your local faucet. See the Connect to a Local Network topic for details.
<div className="next-steps-module"> <div className="next-steps-header"> <h3>Next steps</h3> </div> <div className="next-steps-grid"> <Card className="plausible-event-name=faucet+hello+button" title="Hello, World!" href="/guides/developer/getting-started/hello-world" > Clone and build the "Hello, World!" project. </Card> <Card className="plausible-event-name=faucet+apps+button" title="View More Example Apps" href="/guides/developer/app-examples" > Clone and build the "Hello, World!" project. </Card> </div> </div>