Skip to main content

Laser Setup

POST /v1/laser/setup

Zero-to-trading in a single request — no auth needed. Generates the credentials and default managed wallet required by trades, bundles, and token creation.

You can also call it directly:

const setup = await fetch(`${API_URL}/v1/laser/setup`, {
method: "POST",
}).then((r) => r.json());

Response

{
"api_key": "pb_...",
"wallet_public_key": "MANAGED_WALLET_PUBLIC_KEY",
"wallet_private_key": "BASE58_64_BYTE_SECRET_KEY"
}
FieldMeaning
api_keyYour new API key. Save it — it cannot be retrieved again.
wallet_public_keyAddress of your default managed wallet. Fund it with SOL before creating or trading.
wallet_private_keyThe wallet's secret key in base58, returned once as your backup. The server keeps an encrypted copy for signing.

The endpoint is rate limited to one call per IP every 5 seconds (429 otherwise), and the response is marked Cache-Control: no-store — none of these values are ever shown twice.

What This Creates

The setup action creates:

  • One SolanaLaser API key for Laser API requests.
  • One managed Solana wallet stored encrypted by SolanaLaser.
  • A one-time wallet private key response for backup or external wallet import.

The managed wallet becomes the default Laser wallet. Laser endpoints use it when a request does not include wallet.

Before You Trade

Fund the returned wallet_public_key with enough SOL for the requested trade or token creation, Solana network fees, rent for token accounts, and any configured Sender or Jito tip.

Then trade with your new key:

const response = await fetch(`${API_URL}/v1/trades/execute`, {
method: "POST",
headers: {
"content-type": "application/json",
"x-api-key": setup.api_key,
},
body: JSON.stringify({
action: "buy",
mint: "TOKEN_MINT_ADDRESS",
amount: 0.1,
}),
});