Overview
A production-ready WordPress plugin that provides a complete AI Gateway and Credit Management system for the AIBuddy VS Code Extension.
Core Features
π€ AI Gateway (Main Feature)
- Multi-Provider Support: OpenAI, Anthropic Claude, Google Gemini
- Smart Routing: Automatically selects the fastest/best available provider
- Auto-Failover: Switches to backup provider if primary fails
- Token Counting: Real-time tracking and credit deduction
π³ Payment & Credits
- Stripe Integration: Secure payment processing
- Credit Packages: Configurable pricing tiers (Starter, Pro, Business, etc.)
- Custom Amounts: Users can request custom credit amounts
- Transaction History: Complete purchase and usage tracking
π Rewards System
- Reward Tasks: Admin creates tasks (social media, referrals, content)
- Proof Submission: Users submit proof and earn credits
- Admin Approval: Review and approve/reject submissions with notes
- Auto-Credits: Credits added automatically upon approval
- Email Notifications: Users notified on approval/rejection
- Submission History: Users can view their submission status
π Frontend Pages (8 Shortcodes)
- PricingΒ – Display packages and purchase credits
- DashboardΒ – User account overview and statistics
- API KeyΒ – Generate/regenerate key for VS Code Extension
- RewardsΒ – View and complete reward tasks
- LoginΒ – Custom login page with dynamic redirects
- RegisterΒ – Custom registration page
- SuccessΒ – Payment confirmation page
- NavigationΒ – Menu widget with active page highlighting
βοΈ Admin Dashboard
- Settings: Gateway, Stripe, Pricing, Page Management (tabbed interface)
- Users: View all users, credits, API keys, manual credit addition
- AI Providers: Configure OpenAI, Claude, Gemini API keys with encryption
- Usage Logs: Real-time API usage tracking
- Rewards Management: Tasks, submissions, analytics (tabbed)
- Provider Health: Monitor AI provider status
- Analytics: Usage statistics and reports
π REST API (Version 2)
- Base URL:Β
https://aibuddy.life/wp-json/aibuddy-code/v2/ - AI InferenceΒ (
/inference): Unified AI requests endpoint - User InfoΒ (
/user-info): Get credits and account data - Health CheckΒ (
/health): Provider status monitoring - PaymentsΒ (
/create-checkout,Β/webhook): Stripe integration - Custom CreditsΒ (
/custom-credits-request): Custom amount requests - RewardsΒ (
/rewards,Β/submit-proof,Β/user-rewards): Task system
ποΈ Database
- 6 custom tables for users, usage, transactions, health, rewards
- Auto-fix system creates missing tables automatically
- Pre-populated with 4 default reward tasks
π¨ Elementor Integration
- Purchase Button Widget: Customizable credit purchase buttons
- Navigation Widget: Menu with active page detection
- Template Support: Pre-built Elementor templates
π Developer Resources
- API Documentation: Complete endpoint reference
- Postman Collection: Ready-to-import for testing
- Testing Guide: Step-by-step instructions
- Quick Reference: All endpoints with examples
- Features Overview: Concise feature list
- Complete Documentation: Detailed setup and usage guide
Statistics
| Metric | Count |
|---|---|
| Total Features | 60+ |
| REST API Endpoints | 9 |
| Frontend Shortcodes | 8 |
| Elementor Widgets | 2 |
| Admin Pages | 6 |
| Database Tables | 6 |
| AI Providers | 3 |
| Documentation Files | 6+ |
Key Benefits
β All-in-One Solution: Complete AI Gateway + Credit Management β Production Ready: No linter errors, follows WordPress standards β Secure: API key auth, nonce verification, input sanitization β Scalable: Smart routing, caching, optimized queries β User-Friendly: Modern UI, responsive design, intuitive forms β Well-Documented: Comprehensive documentation files for developers
For VS Code Extension Developer
The plugin provides a single API endpoint for all AI requests:
POST https://aibuddy.life/wp-json/aibuddy-code/v2/inference
Request Body:
{
"api_key": "aibuddy_xxx...",
"messages": [{"role": "user", "content": "Hello"}],
"model": "gpt-4",
"provider": "openai"
}
The extension only needs:
- User’s AIBuddy API key (generated from API Key page)
- Above endpoint URL
The backend handles:
- Routing to OpenAI/Claude/Gemini
- Token counting and cost calculation
- Credit deduction
- Automatic failover
- Usage logging
- Provider health monitoring
Plugin Ready For Production β