Train AI models. Earn $KEY. Generate without limits. Powered by Solana.
An AI platform powered by Solana's high-speed, low-cost blockchain. The first AI platform with a real-time, transparent buyback mechanism powered by Solana's speed.
π¦ Available on npm: @keyless-app/keyless-backend
Keyless is an AI generation platform that democratizes access to AI content creation through a Revenue-to-Buyback Flywheel powered by Solana:
Revenue β Spenders (developers) pay in USDC (SPL) to purchase "Points" for API access
Buyback β A large portion of that USDC is immediately swapped for $KEY (SPL) on a Solana DEX (Jupiter/Raydium)
Reward β Purchased $KEY is sent to the "Contributor Rewards Treasury"
Distribution β Contributors (users training models) earn $KEY from this treasury
This flywheel is highly efficient on Solana, as the buyback swaps are near-instant and cost fractions of a cent.
- Spenders: Developers who pay USDC (SPL) to purchase "Points" and use the AI API
- Contributors: Users who train models and earn $KEY tokens from the Rewards Treasury
- Solana Wallet Authentication: Connect your Phantom, Solflare, or any Solana wallet
- Pay-as-you-go: No credit cards, no monthly subscriptionsβjust USDC
- Transparent Buyback: All buyback transactions are on-chain and visible
- Fast & Cheap: Powered by Solana's speed and low fees
Purchase Points with USDC (SPL) and use them to generate AI content:
- Text Generation (5 points): Create articles, stories, summaries, and more
- Image Generation (8 points): Generate images from text descriptions
- Code Generation (6 points): Generate code snippets, functions, and programs
- Audio Generation (10 points): Create audio content and speech synthesis
- Data Analysis (6 points): Analyze data and generate insights
- Search & Research (6 points): Search and research topics with AI
Price: 1 Point = $0.001 USDC (e.g., 1000 points = $1 USDC)
Earn $KEY tokens by contributing to improve AI models:
- Provide training data (prompt/response pairs)
- Submit feedback on AI outputs
- Annotate data for model training
- Evaluate model performance
- Suggest improvements
Reward: $KEY tokens are paid out from the Rewards Treasury (funded by buyback)
- REST API: Comprehensive HTTP endpoints for all operations
- Wallet Authentication: Secure access using wallet address
- Rate Limiting: Protection against abuse
- Points Management: Track earnings, spending, and balance
- Generation History: Keep track of all AI generations
- Platform Statistics: Monitor usage and contributions
keyless/
βββ src/ # Main TypeScript Application
β βββ core/ # Core business logic (Keyless, PointsManager, etc.)
β βββ routes/ # API routes (generation, contributions, points, stats)
β βββ middleware/ # Express middleware
β βββ utils/ # Utilities
β βββ types/ # TypeScript types
β βββ config.ts # Configuration
β
βββ ai-services/ # Python AI Services (FastAPI)
β βββ text_generation/ # Text generation service
β βββ shared/ # Shared Python modules
β
βββ blockchain/ # Blockchain integration
β βββ services/ # Blockchain services
β
βββ shared/ # Shared TypeScript types
β βββ types/
β
βββ docs/ # Documentation
βββ examples/ # Example code
- Express.js REST API for HTTP requests
- Authentication & Authorization via JWT + Wallet ID
- Points Management and transaction tracking
- Request routing to Python AI services
- Business logic orchestration
- FastAPI microservices for each AI capability
- Text Generation: GPT-4, Claude integration
- Image Generation: DALL-E, Stable Diffusion
- Code Generation: Codex, Copilot
- Audio Generation: Whisper, ElevenLabs
- Data Analysis: Custom ML models
- Model Training: Retraining with contributions
- Solana Program for payment/buyback automation
- $KEY SPL Token on Solana mainnet
- USDC (SPL) payments from Spenders
- Jupiter/Raydium for USDC β $KEY swaps
- Transparent buyback transactions on-chain
- Solana wallet authentication (Phantom, Solflare, etc.)
- PostgreSQL for structured data
- Redis for caching
- Migrations for schema management
For complete structure details, see PROJECT_STRUCTURE.md and docs/architecture.md.
The package is available on npm: @keyless-app/keyless-backend
npm install @keyless-app/keyless-backendgit clone https://github.com/keyless-app/keyless-backend.git
cd keyless-backend
npm installcp env.example .env
# Edit .env with your configurationRequired environment variables:
JWT_SECRET=your-secret-key-change-in-production
JWT_EXPIRES_IN=24h
PORT=3000
NODE_ENV=production
CORS_ORIGIN=*
# Solana Configuration
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_NETWORK=mainnet-beta
KEY_TOKEN_MINT=your-key-token-mint-address
USDC_MINT=usd-key-here
REWARDS_TREASURY_WALLET=your-rewards-treasury-wallet
JUPITER_API_URL=https://quote-api.jup.ag/v6
POINTS_PRICE_USDC=0.001
# Optional: AI service configurations
TEXT_GENERATION_MODEL=gpt-4
IMAGE_GENERATION_MODEL=dall-e-3
CODE_GENERATION_MODEL=gpt-4
AUDIO_GENERATION_MODEL=whisper# Development mode
npm run dev
# Production mode
npm run build
npm startAll API endpoints require a valid Solana wallet address in the X-Wallet-Address header:
curl -H "X-Wallet-Address: {SOLANA_WALLET_ADDRESS}" \
https://{BASE_URL}/healthSupported Wallets: Phantom, Solflare, or any Solana wallet
GET /health- Service health status (no auth required)
POST /api/generation/text- Generate text contentPOST /api/generation/image- Generate image contentPOST /api/generation/code- Generate code contentPOST /api/generation/audio- Generate audio contentPOST /api/generation/analysis- Analyze dataPOST /api/generation/search- Search and researchGET /api/generation/history- Get generation history
POST /api/contributions- Add a contribution to earn pointsGET /api/contributions- Get user contributions
GET /api/points/balance- Get points balanceGET /api/points/transactions- Get points transaction history
GET /api/stats/user- Get user statisticsGET /api/stats/platform- Get platform statistics
| AI Tool | Points Cost |
|---|---|
| Text Generation | 5 points |
| Image Generation | 8 points |
| Code Generation | 6 points |
| Audio Generation | 10 points |
| Data Analysis | 6 points |
| Search & Research | 6 points |
Earn points by contributing to improve AI models:
- Training Data: 10-50 points depending on quality and quantity
- Feedback: 5-20 points per submission
- Annotations: 15-30 points per data point
- Evaluations: 10-25 points per evaluation
- Improvements: 20-50 points for significant contributions
curl -X POST \
-H "X-Wallet-Address: {SOLANA_WALLET_ADDRESS}" \
-H "Content-Type: application/json" \
-d '{
"usdcAmount": 10.0
}' \
https://{BASE_URL}/api/payment/purchaseThis will:
- Accept USDC payment from your wallet
- Credit your account with Points (1 Point = $0.001 USDC)
- Trigger automatic buyback: swap ~80% of USDC for $KEY
- Send $KEY to Rewards Treasury
curl -X POST \
-H "X-Wallet-Address: {SOLANA_WALLET_ADDRESS}" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Write a short story about an AI assistant",
"config": {
"maxTokens": 1000,
"temperature": 0.7
}
}' \
https://{BASE_URL}/api/generation/textcurl -X POST \
-H "X-Wallet-ID: {WALLET_ID}" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A futuristic AI city at sunset",
"config": {
"width": 1024,
"height": 1024
}
}' \
https://{BASE_URL}/api/generation/imagecurl -X POST \
-H "X-Wallet-ID: {WALLET_ID}" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Create a REST API endpoint in TypeScript",
"config": {
"language": "typescript"
}
}' \
https://{BASE_URL}/api/generation/codecurl -X POST \
-H "X-Wallet-Address: {SOLANA_WALLET_ADDRESS}" \
-H "Content-Type: application/json" \
-d '{
"type": "training_data",
"modelId": "model_001",
"data": {
"prompt": "Sample prompt",
"response": "Sample response"
},
"keyEarned": 50
}' \
https://{BASE_URL}/api/contributionsContributors earn $KEY tokens (not points). $KEY tokens are paid out from the Rewards Treasury.
curl -H "X-Wallet-Address: {SOLANA_WALLET_ADDRESS}" \
https://{BASE_URL}/api/points/balancecurl -H "X-Wallet-Address: {SOLANA_WALLET_ADDRESS}" \
https://{BASE_URL}/api/key/balancecurl -H "X-Wallet-ID: {WALLET_ID}" \
https://{BASE_URL}/api/stats/user- Wallet Authentication: Secure access using wallet addresses
- Rate Limiting: Protection against abuse
- CORS Protection: Cross-origin request security
- Input Validation: Request parameter validation
- Error Handling: Secure error responses
- Helmet: Security headers for Express
- HTTPS Support: Encrypted connections
- Request Validation: Zod schema validation
- Runtime: Node.js 18+
- Framework: Express.js + TypeScript
- Authentication: JWT + Wallet ID
- Database: PostgreSQL + Redis
- Framework: FastAPI
- Models: GPT-4, DALL-E, Claude, Stable Diffusion
- Training: PyTorch + Transformers
- Smart Contracts: Solana Programs (Rust/Anchor)
- Integration: @solana/web3.js, @solana/spl-token
- DEX Integration: Jupiter Aggregator API
- Token Standards: SPL Token
We welcome contributions! Please see our Contributing Guide for details.
- Follow TypeScript best practices
- Write comprehensive tests
- Maintain API documentation
- Follow REST API design principles
- Test new endpoints thoroughly
This project is licensed under the MIT License - see the LICENSE file for details.
Keyless: The first AI platform with a real-time, transparent buyback mechanism, powered by Solana's speed and low fees.
- Spenders pay USDC (SPL) β Purchase Points β Use API
- Buyback automatically swaps USDC β $KEY via Jupiter/Raydium
- $KEY goes to Rewards Treasury
- Contributors earn $KEY for training models
All powered by Solana's near-instant, low-cost transactions.