Spaces:
Paused
Paused
| # Start CLIProxyAPI with Cloudflare Tunnel | |
| # This script exposes your API publicly via Cloudflare Tunnel | |
| Write-Host "Starting CLIProxyAPI with Cloudflare Tunnel..." -ForegroundColor Cyan | |
| Write-Host "" | |
| # Cloudflared executable path | |
| $cloudflared = "C:\Program Files (x86)\cloudflared\cloudflared.exe" | |
| # Check if cloudflared exists | |
| if (-not (Test-Path $cloudflared)) { | |
| Write-Host "ERROR: cloudflared not found at $cloudflared" -ForegroundColor Red | |
| Write-Host "Please install it with: winget install Cloudflare.cloudflared" -ForegroundColor Yellow | |
| exit 1 | |
| } | |
| # Start the tunnel | |
| Write-Host "Creating Cloudflare Tunnel to http://localhost:8317..." -ForegroundColor Green | |
| Write-Host "The public URL will be displayed below. Use it with your API keys:" -ForegroundColor Green | |
| Write-Host "" | |
| Write-Host "API Keys configured in config.yaml:" -ForegroundColor Yellow | |
| Write-Host " - test-api-key-1" -ForegroundColor White | |
| Write-Host " - test-api-key-2" -ForegroundColor White | |
| Write-Host " - test-api-key-3" -ForegroundColor White | |
| Write-Host " - new-test-key" -ForegroundColor White | |
| Write-Host "" | |
| Write-Host "Example usage:" -ForegroundColor Yellow | |
| Write-Host ' curl https://<YOUR-TUNNEL-URL>/v1/models -H "Authorization: Bearer test-api-key-1"' -ForegroundColor White | |
| Write-Host "" | |
| Write-Host "Press Ctrl+C to stop the tunnel." -ForegroundColor Cyan | |
| Write-Host "==========================================" -ForegroundColor Cyan | |
| & $cloudflared tunnel --url http://localhost:8317 --protocol http2 | |