Getting Started with B2ALABS
Get up and running with B2ALABS AI Gateway in under 10 minutes. Follow this guide to install, configure, and make your first API request.
What You'll Build
By the end of this guide, you'll have a fully functional B2ALABS AI Gateway running locally, complete with authentication, API key management, and the ability to route requests to multiple AI providers including OpenAI, Anthropic, and Google Gemini.
Prerequisites
Required & Optional Tools
Make sure you have these tools installed before starting
Docker & Docker Compose
Go
For building from source
Node.js & pnpm
For web platform development
Kubernetes
For production deployment
Quick Start Guide
Follow these steps to get B2ALABS running on your local machine.
Clone the Repository
Get the B2ALABS source code on your local machine
git clone https://github.com/b2alabs/b2alabs.git cd b2alabs
Start Services with Docker
Launch all services using Docker Compose
# Start all services docker-compose up -d # Verify services are running docker-compose ps
Apply Database Migrations
Set up the database schema
cd packages/gateway-core make migrate-up
Create Your First User
Register a new user account via the API
curl -X POST http://localhost:8080/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "demo@b2alabs.com",
"password": "SecurePass123!",
"name": "Demo User"
}'Login and Get Token
Authenticate and receive a JWT token
curl -X POST http://localhost:8080/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "demo@b2alabs.com",
"password": "SecurePass123!"
}'Create an API Key
Generate an API key for programmatic access
curl -X POST http://localhost:8080/api/v1/auth/api-keys \
-H "Authorization: Bearer <your-jwt-token>" \
-H "Content-Type: application/json" \
-d '{
"name": "My First API Key",
"permissions": ["ai_gateway", "proxy", "read", "write"]
}'Access Your Services
Available Services
Once all services are running, you can access them at these URLs
Gateway API
Core API gateway
Web Platform
Admin dashboard & UI
Prometheus
Metrics & monitoring
Grafana
Dashboards (admin/admin)
Jaeger
Distributed tracing
Verify Installation
Test that everything is working correctly:
# CheckIcon Gateway health
curl http://localhost:8080/health
# Expected response:
# {"status":"ok","database":"connected","redis":"connected"}Next Steps
Now that you have B2ALABS running, explore these resources to learn more:
Explore API Reference
Learn about all available endpoints and their parameters
Configure AI Providers
Set up OpenAI, Anthropic, or Google Gemini integration
Deploy to Production
Follow our production deployment guide for Kubernetes
Use the CLI Tools
Install and configure the B2ALABS CLI for easier management
Having Issues?
CheckIcon our troubleshooting guide or reach out for help
Was this page helpful?
