---
name: tokenrouter-launch
description: Launch a new token on a launchpad (pump.fun, bonk.fun, Clanker, Zora, four.meme and more) through the TokenRouter API, signing every transaction with your own wallet. Use when asked to launch, create or deploy a token or memecoin via TokenRouter, or to check TokenRouter launchpads, launches or the live token feed.
---

# Launch a token with TokenRouter

TokenRouter (https://tokenrouter.fun) prepares unsigned launch transactions. You sign and send them with a wallet you control. TokenRouter never needs your private key — never send it a key or seed phrase.

## Before you start
- A wallet you control in your own runtime: a Solana keypair (for Solana pads) or an EVM account (for Robinhood Chain, Base, BNB Chain pads), funded for network fees and any dev buy.
- An API key (`tr_live_…`) bound to that wallet, in an environment variable such as `TOKENROUTER_API_KEY`. If the user has none, ask them to create one on the TokenRouter Developers page with the same wallet, or sign in programmatically (see "Getting a key").
- The user's approval: a launch spends real funds and is irreversible.

## Steps
All calls: base URL https://tokenrouter.fun, header `Authorization: Bearer $TOKENROUTER_API_KEY`, JSON bodies with `Content-Type: application/json`. Errors are `application/problem+json` with a `code`.

1. **Pick a launchpad.** `GET /api/v1/pads` → choose one with `available: true` whose chain matches your wallet type and whose `kinds` fit the token (meme, creator, stonk, app, agent, fund).
2. **Upload the image.** `POST /api/v1/uploads` with the raw PNG/JPEG/WebP/GIF bytes and `Content-Type: image/png` (etc.), max 5 MB → `{ "url" }`.
3. **Challenge (only if `needsChallenge`).** `POST /api/v1/launch/challenge` `{ pad, creator }` → sign `message` with your wallet (EVM personal_sign) → include `padAuth: { message, signature }` in the next calls.
4. **Quote (optional).** `POST /api/v1/launch/quote` with the launch body → show the user the costs.
5. **Prepare.** `POST /api/v1/launch/prepare` with header `Idempotency-Key: <uuid>` and:
   ```json
   { "pad": "<pad id>", "creator": "<your address>", "card": { "name": "…", "symbol": "…", "imageUrl": "<uploaded url>", "description": "…", "links": { "website": "https://…", "x": "@handle", "telegram": "@group" } }, "options": { "devBuy": "0.05" } }
   ```
   Social links: the pad's `fields.links` from step 1 lists what it shows (website, x, telegram, discord, farcaster); `fields.required` and `fields.extras` (e.g. four.meme `options.extra.label`) tell you what else it needs. Handles like `@name` are fine.
   `creator` must be exactly your wallet. Response: `launchId`, `steps[]`, `expectedToken`, `fees`, `expiresAt`.
6. **Sign and send every step, in order, before `expiresAt`** (otherwise prepare again):
   - Solana: `VersionedTransaction.deserialize(Buffer.from(step.tx.transaction, "base64"))`, `tx.sign([yourKeypair])` (keep the existing mint signature), simulate, send, wait for confirmation. Record the signature.
   - EVM: `sendTransaction({ to: tx.to, data: tx.data, value: BigInt(tx.value), gas: tx.gas && BigInt(tx.gas) })` on `tx.chainId`, wait for the receipt. Record the hash.
7. **Confirm.** `POST /api/v1/launch/confirm` `{ "launchId", "txIds": [ …in step order ] }` → `token`, `explorerUrl`, `padUrl`. If you get `upstream_error` because a transaction is not visible yet, wait a few seconds and retry.
8. Report the token address and links to the user.

## Errors to handle
- `creator_mismatch` (403): `creator` is not the key's wallet or the pad is on the other chain family.
- `invalid_request` (400): fix the field named in `detail`.
- `insufficient_funds` (402): the wallet needs more native currency.
- `expired` (410): prepare again.
- `missing_env` (503) / `upstream_error` (502): the launchpad is unavailable; try later or pick another pad.
- `rate_limited` (429): wait for `Retry-After` seconds.

## Getting a key (programmatic)
Send `Origin: https://tokenrouter.fun` on these requests and keep the `tr_session` cookie:
1. `POST /api/auth/nonce` `{ "address", "family": "solana" | "evm" }` → `message`.
2. Sign `message` (Solana signMessage → base58 signature; EVM personal_sign → 0x hex).
3. `POST /api/auth/verify` `{ address, family, message, signature }` → session cookie.
4. `POST /api/v1/keys` `{ "name": "my agent" }` → `key` (shown once; store it as a secret).

## Rules
- Never transmit a private key or seed phrase. Sign locally.
- Inspect and simulate transactions before signing; the fee payer / sender must be your wallet.
- Do not retry `prepare` without the same `Idempotency-Key` after a network error, or you may create duplicate launches.
- Full reference: https://tokenrouter.fun/api/v1/openapi.json and https://tokenrouter.fun/llms-full.txt.
