B2ALABS® - Smart API Gateway Platform
®
Documentation/Quickstart

5-Minute Quickstart

5 min

The fastest way to get B2ALABS running and make your first API call.

From Zero to First API Call

Complete setup in under 5 minutes. Just copy, paste, and run!

Prerequisites

You'll need Docker & Docker Compose installed. If you don't have them, see installation guide.

1

Clone & Start

Clone repository and start all services with Docker Compose

1 min
git clone https://github.com/b2alabs/b2alabs.git
cd b2alabs
docker-compose up -d
2

Setup Database

Apply database migrations

30 sec
cd packages/gateway-core
make migrate-up
3

Register User

Create your first user account

30 sec
curl -X POST http://localhost:8080/api/v1/auth/register \
  -H "Content-Type: application/json" \
  -d '{"email":"you@email.com","password":"Pass123!","name":"Your Name"}'
4

Get Token

Login and receive JWT token (copy the "token" value)

30 sec
curl -X POST http://localhost:8080/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"you@email.com","password":"Pass123!"}'
5

Create API Key

Generate an API key for programmatic access

30 sec
curl -X POST http://localhost:8080/api/v1/auth/api-keys \
  -H "Authorization: Bearer YOUR_TOKEN_HERE" \
  -H "Content-Type: application/json" \
  -d '{"name":"My Key","permissions":["ai_gateway","proxy"]}'
6

Make First Request

Make your first AI Gateway request (requires OPENAI_API_KEY in .env)

1 min
curl -X POST http://localhost:8080/api/v1/ai/chat/completions \
  -H "Authorization: YOUR_API_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-5","messages":[{"role":"user","content":"Hello!"}]}'

🎉 Congratulations!

You've successfully set up B2ALABS and made your first API request. Your AI Gateway is now ready to route requests to multiple providers including OpenAI, Anthropic, and Google Gemini.

Having Issues?

Services won't start?

CheckIcon if ports 3000, 8080, 5432, 6379 are already in use with netstat -ano | findstr "3000 8080"

Connection errors?

Wait 10-15 seconds for services to fully start, then retry

AI requests failing?

Add OPENAI_API_KEY=sk-... to your .env file

Need Help?

Stuck on something? Our community and support team are here to help.

Was this page helpful?