B2ALABS® - Smart API Gateway Platform
®
Documentation/Getting Started

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

20.10+

Go

For building from source

1.23+

Node.js & pnpm

For web platform development

22+ / 9.0+

Kubernetes

For production deployment

1.30+

Quick Start Guide

Follow these steps to get B2ALABS running on your local machine.

1

Clone the Repository

Get the B2ALABS source code on your local machine

git clone https://github.com/b2alabs/b2alabs.git
cd b2alabs
2

Start Services with Docker

Launch all services using Docker Compose

# Start all services
docker-compose up -d

# Verify services are running
docker-compose ps
3

Apply Database Migrations

Set up the database schema

cd packages/gateway-core
make migrate-up
4

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"
  }'
5

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!"
  }'
6

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

http://localhost:8080

Web Platform

Admin dashboard & UI

http://localhost:3000

Prometheus

Metrics & monitoring

http://localhost:9090

Grafana

Dashboards (admin/admin)

http://localhost:3001

Jaeger

Distributed tracing

http://localhost:16686

Verify Installation

Test that everything is working correctly:

# CheckIcon Gateway health
curl http://localhost:8080/health

# Expected response:
# {"status":"ok","database":"connected","redis":"connected"}

Having Issues?

CheckIcon our troubleshooting guide or reach out for help

Common Issues:

  • Services won't start: CheckIcon if ports 3000, 8080, 5432, 6379 are already in use
  • CircleStackIcon connection error: Wait 10-15 seconds for PostgreSQL to fully initialize
  • Migration fails: Ensure database is running with docker-compose ps

Need Help?

Join our community or reach out to our support team for assistance.

Was this page helpful?