| title | Getting Started |
|---|---|
| description | Get up and running with DOAI Proxy in minutes |
- Node.js 18 or higher
- API key for your chosen provider (Straico, OpenAI, etc.)
git clone <repository-url>
cd doai-proxy
npm installcp .env.example .envEdit .env and add your provider's API key:
For Straico (default):
PROVIDER_TYPE=straico
STRAICO_API_KEY=your_actual_api_key_herenpm startOr run in development mode with hot-reload:
npm run devcurl http://localhost:8000/healthExpected output:
{"status":"ok","service":"doai-proxy","timestamp":"2026-02-04T23:30:00.000Z"}OpenAI-Compatible Client (OpenCode, etc.)
↓ "Hi, I'd like to speak to OpenAI please"
DOAI Proxy (localhost:8000)
↓ "One moment... *frantically translates*"
Provider API (Straico, etc.)
- server.js - Express server that handles all requests and orchestrates proxy logic
- streaming.js - Module that converts non-streaming responses into SSE format with 2 streaming modes
- tools.js - Module that handles function calling by injecting tools into prompts and parsing responses
- utils.js - Helper functions for logging, delays, and response formatting
- providers/ - Provider abstraction layer supporting multiple AI providers
- base-provider.js - Abstract base class defining provider interface
- provider-factory.js - Factory for creating provider instances
- straico-provider.js - Straico API implementation
npm test
npm run lintnpm run devThis uses node --watch to automatically restart on file changes.
Run quality checks:
npm run lint # Lint code
npm test # Run testsFix linting issues:
npm run lint:fix # Auto-fixWhen contributing:
- Follow code style guidelines (run
npm run lintto check) - Run quality checks before submitting
- Use descriptive commit messages
- Test thoroughly with both streaming and function calling
- Configuration Guide - Customize proxy behavior and provider settings
- Streaming Guide - Learn about SSE streaming modes
- Function Calling Guide - Use tool calls through the proxy
- API Endpoints - Full endpoint reference