turnip-agent
v0.1.0
Published
An agent for generating and tokenizing unique AI art on-chain using OpenAI, PumpPortal, and Helius
Maintainers
Readme
🥕 Turnip Agent
An agent for generating and tokenizing unique AI art on-chain using OpenAI GPT Image 1.5, PumpPortal, and Helius APIs on Solana.
Features
- AI Art Generation - Generate unique images using OpenAI's GPT Image 1.5
- One-Click Token Launch - Deploy AI-generated art as tokens on pump.fun
- Portfolio Dashboard - Track your deployed tokens and holdings
- Prompt Enhancement - AI-powered prompt optimization for better images
Installation
npm install -g turnip-agentQuick Start
- Initialize configuration:
turnip init- Edit
.envwith your API keys:
OPENAI_API_KEY="sk-..."
HELIUS_API_KEY="..."
WALLET_PRIVATE_KEY="..."- Generate and launch a token:
turnip launch "a cosmic turnip floating in space" --name "Cosmic Turnip" --ticker CTRNPCommands
Generate AI Art
# Basic generation
turnip generate "a purple cat riding a skateboard"
# With options
turnip generate "abstract art" -q high -s 1024x1792 -o my-art.png
# With AI prompt enhancement
turnip generate "cool art" --enhanceDeploy as Token
# Deploy an existing image
turnip deploy ./my-art.png --name "My Token" --ticker MYT
# With metadata
turnip deploy ./art.png -n "Token Name" -t TICK --twitter @handle --website https://example.comLaunch (Generate + Deploy)
# Full launch in one command
turnip launch "vibrant pixel art of a turnip" -n "Pixel Turnip" -t PTRN
# With dev buy
turnip launch "rare pepe" -n "Rare Pepe" -t RPEPE --dev-buy 0.5Dashboard
# Live dashboard
turnip dashboard
# Snapshot (no refresh)
turnip dashboard --snapshotUtilities
# Check balance
turnip balance
# Validate configuration
turnip config --check
# Create .env template
turnip initProgrammatic Usage
import { TurnipAgent } from 'turnip-agent';
const agent = new TurnipAgent({
openaiApiKey: 'sk-...',
heliusApiKey: '...',
walletPrivateKey: '...',
network: 'mainnet-beta',
});
// Generate an image
const image = await agent.generate({
prompt: 'a beautiful sunset over mountains',
quality: 'high',
});
// Deploy as token
const result = await agent.deploy({
image,
name: 'Sunset Token',
ticker: 'SUNSET',
});
// Or do it all in one step
const launched = await agent.launch({
prompt: 'cosmic abstract art',
name: 'Cosmic Token',
ticker: 'COSM',
devBuyAmount: 0.1,
});
console.log(`Token deployed: ${launched.token.pumpUrl}`);Configuration
| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| OPENAI_API_KEY | Yes | - | OpenAI API key for image generation |
| HELIUS_API_KEY | Yes | - | Helius API key for Solana RPC |
| WALLET_PRIVATE_KEY | Yes | - | Solana wallet private key (base58) |
| SOLANA_NETWORK | No | mainnet-beta | Network (mainnet-beta or devnet) |
| IMAGE_QUALITY | No | high | Image quality (low, medium, high) |
| IMAGE_SIZE | No | 1024x1024 | Image dimensions |
| IMAGE_FORMAT | No | png | Output format (png, jpeg, webp) |
| DEFAULT_SLIPPAGE | No | 10 | Default slippage percentage |
| DEV_BUY_AMOUNT | No | 0 | Default dev buy amount in SOL |
Costs
| Action | Estimated Cost | |--------|----------------| | Image Generation (high) | ~$0.04 | | Image Generation (medium) | ~$0.02 | | Image Generation (low) | ~$0.01 | | Token Deployment | ~0.02 SOL | | Prompt Enhancement | ~$0.001 |
Links
- Website: turnip.sh
- Documentation: turnip.sh/docs
- Twitter: @turnip
- GitHub: github.com/steph3nm/turnip
License
MIT © steph3n
