Solana Token Deployment API

Firekeeper

Overview

The Solana Token Deployment endpoint enables you to create new fungible tokens on Solana with a single API call. It supports both the standard SPL Token program and the newer Token-2022 program with advanced features.

Endpoint: POST /v1/solana/deploy

Base URL: https://api.thirdweb.com


Authentication

This endpoint requires server-side authentication using your secret key. Never expose your secret key in client-side code.

x-secret-key: YOUR_SECRET_KEY

Request Parameters

ParameterTypeRequiredDescription
fromstringSolana wallet address that pays for deployment
chainIdstringNetwork identifier: solana:mainnet or solana:devnet
namestringToken name (1-32 characters)
symbolstringToken symbol (1-10 characters)
decimalsnumberDecimal places (0-9, default: 9)
initialSupplystringAmount to mint in base units
mintAuthoritystringAddress allowed to mint (defaults to from)
freezeAuthoritystringAddress allowed to freeze accounts
tokenProgramstringspl-token (default) or token-2022

Response

{
"result": {
"transactionId": "5ttCNobho7nk5F1Hh4pU4d9T2o1yAFn3...",
"mintAddress": "7GCihgDB8fe6KNjn2MYtkzZcRjQy3t9GHdC8uHYmW2hr"
}
}
FieldDescription
transactionIdThe Solana transaction signature
mintAddressThe address of your new token mint

Quick Start

Deploy a Basic Token

curl -X POST "https://api.thirdweb.com/v1/solana/deploy" \
-H "Content-Type: application/json" \
-H "x-secret-key: YOUR_SECRET_KEY" \
-d '{
"from": "YOUR_WALLET_ADDRESS",
"chainId": "solana:devnet",
"name": "My Token",
"symbol": "MTK",
"decimals": 9
}'

Deploy with Initial Supply

Mint 1,000,000 tokens at deployment (with 9 decimals):

curl -X POST "https://api.thirdweb.com/v1/solana/deploy" \
-H "Content-Type: application/json" \
-H "x-secret-key: YOUR_SECRET_KEY" \
-d '{
"from": "YOUR_WALLET_ADDRESS",
"chainId": "solana:devnet",
"name": "My Token",
"symbol": "MTK",
"decimals": 9,
"initialSupply": "1000000000000000"
}'
Note: initialSupply is in base units. For 9 decimals, multiply your desired amount by 10^9.

Deploy a Token-2022 Token

curl -X POST "https://api.thirdweb.com/v1/solana/deploy" \
-H "Content-Type: application/json" \
-H "x-secret-key: YOUR_SECRET_KEY" \
-d '{
"from": "YOUR_WALLET_ADDRESS",
"chainId": "solana:devnet",
"name": "My Stable",
"symbol": "MYS",
"decimals": 6,
"tokenProgram": "token-2022"
}'

Deploy with Custom Authorities

curl -X POST "https://api.thirdweb.com/v1/solana/deploy" \
-H "Content-Type: application/json" \
-H "x-secret-key: YOUR_SECRET_KEY" \
-d '{
"from": "YOUR_WALLET_ADDRESS",
"chainId": "solana:mainnet",
"name": "Governance Token",
"symbol": "GOV",
"decimals": 9,
"mintAuthority": "TREASURY_WALLET_ADDRESS",
"freezeAuthority": "ADMIN_WALLET_ADDRESS"
}'

Code Examples

TypeScript / JavaScript

const response = await fetch(
"https://api.thirdweb.com/v1/solana/deploy",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"x-secret-key": "YOUR_SECRET_KEY",
},
body: JSON.stringify({
from: "YOUR_WALLET_ADDRESS",
chainId: "solana:devnet",
name: "My Token",
symbol: "MTK",
decimals: 9,
initialSupply: "1000000000000000", // 1M tokens
}),
},
);
const { result } = await response.json();
console.log("Token deployed!");
console.log("Mint address:", result.mintAddress);
console.log("Transaction:", result.transactionId);

Python

import requests
response = requests.post(
"https://api.thirdweb.com/v1/solana/deploy",
headers={
"Content-Type": "application/json",
"x-secret-key": "YOUR_SECRET_KEY",
},
json={
"from": "YOUR_WALLET_ADDRESS",
"chainId": "solana:devnet",
"name": "My Token",
"symbol": "MTK",
"decimals": 9,
"initialSupply": "1000000000000000",
},
)
result = response.json()["result"]
print(f"Token deployed! Mint: {result['mintAddress']}")

Token Programs

SPL Token (Default)

The standard Solana token program. Recommended for most use cases.

  • ✅ Widely supported by wallets and DEXs
  • ✅ Lower transaction fees
  • ✅ Maximum compatibility

Token-2022

The newer Token Extensions program with advanced features.

  • ✅ Transfer fees
  • ✅ Interest-bearing tokens
  • ✅ Confidential transfers
  • ✅ Non-transferable tokens
  • ⚠️ Not all wallets/DEXs support Token-2022 yet

Decimal Places Guide

Use CaseRecommended Decimals
SOL-like tokens9
Stablecoins (USDC-like)6
NFT-adjacent tokens0
High-precision DeFi9

Error Responses

StatusDescription
400Invalid request parameters
401Missing or invalid authentication
500Server error during deployment
504Transaction confirmation timeout

Best Practices

  1. Test on Devnet first — Always deploy to solana:devnet before mainnet
  2. Secure your secret key — Use environment variables, never commit to code
  3. Verify the mint address — Check the returned mintAddress on a Solana explorer
  4. Plan your authorities — Consider who should control minting and freezing
  5. Calculate supply correctly — Remember to account for decimals in initialSupply

Related Resources