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:

Request

const response = await fetch("https://api.solanalaser.xyz/v1/laser/setup", {
method: "POST",
});

const setup = await response.json();

Response

{
"api_key": "sl_...",
"wallet_public_key": "MANAGED_WALLET_PUBLIC_KEY",
"wallet_private_key": "BASE58_64_BYTE_SECRET_KEY"
}
FieldMeaning
api_keyYour new API key. Save it because it cannot be retrieved again.
wallet_public_keyAddress of your default managed wallet.
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.

Use Your New Key

Use the returned api_key as the x-api-key header for authenticated Laser API requests:

Request

const response = await fetch("https://api.solanalaser.xyz/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,
}),
});

const trade = await response.json();

Response

{
"signature": "TRANSACTION_SIGNATURE",
"confirmed": true,
"venue": "bonding_curve"
}