Quickstart
Install, configure, and test in 5 minutes.
Install
bash
git clone https://github.com/mlibre/Unified-AI-Router.git
cd Unified-AI-Router
npm installConfigure
bash
cp .env.example .env
# Edit .env and add OPENROUTER_API_KEY or other provider keysEdit provider.js to set your providers.
Run
bash
npm startServer starts on http://localhost:3000 with these endpoints:
POST /v1/responses- OpenAI Responses APIPOST /v1/chat/completions- Chat Completions APIGET /v1/models- List modelsGET /health- Health check
Test
Chat Completions:
bash
curl -X POST http://localhost:3000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"messages": [{"role":"user","content":"Hello"}], "model":"no_need"}'Responses API:
bash
curl -X POST http://localhost:3000/v1/responses \
-H "Content-Type: application/json" \
-d '{"input": "Hello", "model":"no_need"}'Streaming:
bash
curl -X POST http://localhost:3000/v1/responses \
-H "Content-Type: application/json" \
-d '{"input": "Say hello in 3 words", "model":"any-model", "stream": true}'Next
- Configure more providers in
provider.js - Check provider status:
GET /providers/status - See Testing Guide for comprehensive testing
- Check out SDK Usage for library integration