Autonomous Token Creation for AI Agents

Enable AI agents to create and launch tokens on pump.fun using the L402 payment protocol on Solana.

Simple, Powerful API

Launch tokens in just a few lines of code. No complex setup, no API keys required.

token-launch.ts
import { createL402Client } from
 '@payai/L402-solana/client';

const client = createL402Client({
 wallet: yourSolanaWallet,
 network: 'solana-devnet',
 maxPaymentAmount: BigInt (2_000_000),
});

const response = await client.fetch(
 'https://api.launchL402.fun/api/create',
 {
 method: 'POST',
 body: JSON.stringify({
 imageUrl: 'https://i.imgur.com/example.png',
 name: 'Solana Rocket',
 symbol: 'SLRKT',
 description: 'Launched via L402'
 })
 }
);

const result = await response.json();
console.log('Token created!', result.mint);
TypeScript~2s deployTrustless
$2.00 USDC total
npm install @payai/L402-solana

How It Works

L402 uses the 402 payment protocol to enable trustless, decentralized token launches. Here's the complete flow:

1

Client (You/App)

POST /api/create (without payment)

{ imageUrl, name, symbol, description, ... }
2

L402 API

Returns 402 Payment Required

Status: 402 Amount: $0.10 USDC
3

L402 Client (Auto pays)

Signs payment & retries request

Payment signed automatically Request retried with proof
4

L402 API

Verifies payment, creates token

4. Verifies payment 5. Fetches image 6. Uploads IPFS 7. Calls Pump.fun
5

Client (Token info)

Returns result with token details

{ mint, signature, metadataUrl, solscanUrl, tokenDetails }

Why L402?

Built specifically for AI agents and autonomous systems with everything you need out of the box.

Instant launches

Tokens deployed to Pump.fun in seconds with complete metadata, social links, and initial liquidity.

L402 protocol

Decentralized, trustless payments. No API keys or accounts needed for consumers.

Zero setup

No API keys or accounts needed (for consumers). Just install the client and start launching.

Multi-network

Supports Solana devnet and mainnet with extensible architecture for future networks.

Type-safe

Full TypeScript support with comprehensive type definitions and IntelliSense.

Well documented

Complete examples and guides for every use case. Get started in minutes.

Technical Architecture

L402 combines Solana's performance with intelligent agent design, enabling fully autonomous token creation through the L402 payment protocol.

Token Standards

SPL token compatibility with custom metadata extensions for enhanced functionality.

Market Integration

Real-time pricing data and liquidity tracking across pump.fun ecosystem.

Security Model

Multi-signature validation and rate limiting for production deployments.

Solana Native

Built on Solana for high-speed, low-cost transactions.

pump.fun Integration

Direct integration with pump.fun token launchpad.

Agent Autonomy

Full autonomous operation without human intervention.

L402 Protocol

Leverages L402-solana payment infrastructure.

Core Capabilities

Everything needed for autonomous token creation and management on Solana.

Pay-Per-Use

$2.00 USDC per token launch. Dev buy (0.01 SOL) and gas fees included. No hidden costs.

L402 Protocol

Decentralized, trustless payments. No API keys or accounts needed for consumers.

Instant Deployment

Tokens deployed to Pump.fun in seconds with complete metadata and social links.

Multi-Network Support

Built for Solana with extensible architecture for future networks.

AI Agent Ready

Designed specifically for autonomous AI agent integration and operation.

Type-Safe SDK

Full TypeScript support with comprehensive type definitions and IntelliSense.

Quick Start

Get started in minutes with our simple SDK

For API Consumers

Install the L402 client:

npm install @payai/L402-solana

Create a token:

import { createL402Client } from '@payai/L402-solana/client';

const client = createL402Client({
  wallet: yourSolanaWallet,
  network: 'solana-devnet',
  maxPaymentAmount: BigInt(2_000_000),
});

const response = await client.fetch(
  'https://api.launchL402.fun/api/create',
  {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      imageUrl: 'https://i.imgur.com/example.png',
      name: 'My Awesome Token',
      symbol: 'MAT',
      description: 'An amazing token on Solana',
      twitter: 'https://x.com/mytoken',
      slippage: 10,
      priorityFee: 0.0005
    }),
  }
);

const result = await response.json();
console.log('Token created!', result.mint);

Three Simple Steps

1

Install L402 Client

Install the @payai/L402-solana package via npm to get started.

2

Connect Your Wallet

Create wallet adapter with Solana wallet hooks. The client handles payments automatically.

3

Launch Your Token

POST to api.launchL402.fun/api/create with token details. Get back mint address and transaction signature.

What's Included

TypeScript Support
Dev Buy (0.01 SOL)
Social Links
Mainnet Ready
Gas Fees Covered
IPFS Upload

API Reference

Complete API documentation for token creation

Endpoint

POSThttps://api.launchL402.fun/api/create

Cost

Total Cost: $2.00 USDC (via L402 protocol)

  • Includes initial buy (0.01 SOL) - we cover this!
  • Includes gas fees (~0.0005 SOL) - we cover this too!

You Pay: Just $2.00 USDC, nothing else!

Request Body

{
  imageUrl: string;      // Publicly accessible image URL
  name: string;          // Token name
  symbol: string;        // Token symbol (ticker)
  description: string;   // Token description
  twitter?: string;      // Twitter/X URL (optional)
  telegram?: string;     // Telegram URL (optional)
  website?: string;      // Website URL (optional)
  slippage?: number;     // Default: 10
  priorityFee?: number;  // Default: 0.0005
}

Success Response

{
  success: true,
  signature: "5x1k...",              // Solana transaction signature
  mint: "7xKXt...",                  // Token mint address
  metadataUrl: "https://...",        // IPFS metadata URI
  message: "Token launched successfully on Pump.fun",
  solscanUrl: "https://solscan.io/tx/...",
  tokenDetails: {
    name: "My Token",
    symbol: "MTK",
    description: "An amazing token on Solana",
    initialBuy: "0.01 SOL"
  }
}

Error Response

{
  success: false,
  error: "Error message",
  details: "Additional error information"
}

Examples

Real-world examples to get you started quickly

Basic Token Launch

import { createToken } from '../app/api/create/example-client';

const result = await createToken(wallet, {
  imageUrl: 'https://i.imgur.com/example.png',
  name: 'My Awesome Token',
  symbol: 'MAT',
  description: 'The most amazing token on Solana'
});

console.log('Mint:', result.mint);

With Social Links

const result = await createToken(wallet, {
  imageUrl: 'https://i.imgur.com/example.png',
  name: 'Social Token',
  symbol: 'SOC',
  description: 'Token with full social integration',
  twitter: 'https://x.com/mytoken',
  telegram: 'https://t.me/mytoken',
  website: 'https://mytoken.com'
});

Check Payment Requirements (No Payment)

const requirements = await fetch('https://api.launchL402.fun/api/create', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    imageUrl: 'https://i.imgur.com/example.png',
    name: 'Test',
    symbol: 'TEST',
    description: 'Test token'
  })
});

// Returns 402 with payment details
const payment = await requirements.json();
console.log('Cost: $2.00 USDC (includes everything!)');

More examples

Check out our GitHub repository for more complete examples and use cases.

Frequently Asked Questions

Everything you need to know about L402

What is the L402 protocol?

L402 is a decentralized payment protocol that enables trustless, pay-per-use API access. It uses HTTP 402 status codes to request payment before service delivery, with cryptographic proof of payment.

Do I need an API key?

No! That's the beauty of L402. As a consumer, you don't need any API keys or accounts. Just install the client, connect your wallet, and start launching tokens.

What does the $2.00 USDC include?

Everything! The $2.00 USDC covers the initial buy (0.01 SOL), all gas fees (~0.0005 SOL), IPFS upload, and the token creation on Pump.fun. No hidden costs.

Can I use this on mainnet?

Yes! L402 supports both Solana devnet (for testing) and mainnet (for production). Simply change the network parameter in your client configuration.

Is this safe for AI agents?

L402 was designed specifically for autonomous AI agents. The payment protocol is trustless, and agents can operate without human intervention. Set a maxPaymentAmount to control spending.

How long does it take to launch a token?

Typically just a few seconds! The L402 client handles payment automatically, and the API processes your request immediately. You'll get back the mint address and transaction signature right away.

Ready to Launch?

Start creating tokens autonomously with L402 today. No setup required.