azure openai docs

This commit is contained in:
Shroominic
2025-09-04 15:29:06 +01:00
parent 207cafe285
commit fa4b78abec
2 changed files with 27 additions and 1 deletions
+18 -1
View File
@@ -10,6 +10,7 @@ Routstr Core is configured through environment variables. This guide covers all
|----------|-------------|---------|----------|
| `UPSTREAM_BASE_URL` | Base URL of the OpenAI-compatible API to proxy | - | ✅ |
| `UPSTREAM_API_KEY` | API key for the upstream service | - | ❌ |
| `CHAT_COMPLETIONS_API_VERSION` | Append `api-version` to `/chat/completions` (Azure OpenAI) | - | ❌ |
| `DATABASE_URL` | SQLite database connection string | `sqlite+aiosqlite:///keys.db` | ❌ |
| `ADMIN_PASSWORD` | Password for admin dashboard access | - | ⚠️ |
@@ -84,6 +85,15 @@ MODEL_BASED_PRICING=true
MODELS_PATH=/app/config/anthropic-models.json
```
### Azure OpenAI (optional)
```bash
# .env
UPSTREAM_BASE_URL=https://<resource>.openai.azure.com/openai/deployments/<deployment>
UPSTREAM_API_KEY=<azure_api_key>
CHAT_COMPLETIONS_API_VERSION=2024-05-01-preview
```
### High-Security Setup
```bash
@@ -174,6 +184,7 @@ Create a `models.json` file:
### Admin Password
Generate a strong password:
```bash
openssl rand -base64 32
```
@@ -211,18 +222,21 @@ curl http://localhost:8000/v1/info
### Common Issues
**Missing Upstream URL**
```
ERROR: UPSTREAM_BASE_URL not set
Solution: Set UPSTREAM_BASE_URL in .env
```
**Invalid Cashu Mint**
```
ERROR: Failed to connect to mint
Solution: Verify CASHU_MINTS URLs are accessible
```
**Database Errors**
```
ERROR: Database connection failed
Solution: Check DATABASE_URL and file permissions
@@ -233,6 +247,7 @@ Solution: Check DATABASE_URL and file permissions
### Multiple Mints
Configure fallback mints:
```bash
CASHU_MINTS=https://primary.mint,https://backup1.mint,https://backup2.mint
```
@@ -240,6 +255,7 @@ CASHU_MINTS=https://primary.mint,https://backup1.mint,https://backup2.mint
### Custom Database
Use PostgreSQL instead of SQLite:
```bash
DATABASE_URL=postgresql+asyncpg://user:pass@localhost/routstr
```
@@ -247,6 +263,7 @@ DATABASE_URL=postgresql+asyncpg://user:pass@localhost/routstr
### Proxy Settings
For corporate environments:
```bash
HTTP_PROXY=http://proxy.company.com:8080
HTTPS_PROXY=http://proxy.company.com:8080
@@ -256,4 +273,4 @@ HTTPS_PROXY=http://proxy.company.com:8080
- [User Guide](../user-guide/introduction.md) - Start using Routstr
- [Admin Dashboard](../user-guide/admin-dashboard.md) - Manage your node
- [Custom Pricing](../advanced/custom-pricing.md) - Advanced pricing strategies
- [Custom Pricing](../advanced/custom-pricing.md) - Advanced pricing strategies
+9
View File
@@ -10,6 +10,15 @@ Routstr maintains full compatibility with the OpenAI API, meaning:
- Only the base URL and API key need to change
- All parameters and responses match OpenAI's format
### Azure OpenAI compatibility
To use Azure OpenAI through Routstr with minimal changes:
- Set `UPSTREAM_BASE_URL` to your Azure deployments URL, for example: `https://<resource>.openai.azure.com/openai/deployments/<deployment>`
- Set `CHAT_COMPLETIONS_API_VERSION=2024-05-01-preview`
When this env var is set, Routstr automatically appends `api-version=2024-05-01-preview` to all upstream `/chat/completions` requests.
## Basic Setup
### Python