Overview
Thenpx method allows you to run Ollama API Proxy without cloning the repository or installing it globally. This is the fastest way to get started.
Prerequisites
- Node.js version 18.0.0 or higher
- At least one API key from OpenAI, Google Gemini, or OpenRouter
Quick Start
Set up environment variables
Create a
.env file with your API keys:The proxy will load the
.env file from your current working directory using the dotenv package.Advanced Usage
Specify Package Version
Run a specific version of the proxy:Use Latest Version
Force npx to fetch the latest version:Run with Custom Port
Specify a custom port via environment variable:Custom Model Configuration
Create amodels.json file in your working directory to customize available models:
models.json
models.json from the current working directory (see src/index.js:124).
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
OPENAI_API_KEY | Conditional* | - | OpenAI API key |
GEMINI_API_KEY | Conditional* | - | Google Gemini API key |
OPENROUTER_API_KEY | Conditional* | - | OpenRouter API key |
OPENROUTER_API_URL | No | https://openrouter.ai/api/v1 | OpenRouter API endpoint |
PORT | No | 11434 | Server port |
NODE_ENV | No | - | Environment mode (production or development) |
*At least one API key is required. The proxy will exit with an error if no keys are configured.
Verify Installation
Test the proxy server:Using with Bun
If you have Bun installed (version 1.2.0 or higher), you can usebunx for faster execution:
Troubleshooting
No API Keys Found
If you see this error:.env file exists in the current working directory and contains at least one valid API key.
Port Already in Use
If port 11434 is already in use:Package Not Found
If npx cannot find the package, verify the package name:Next Steps
Docker Installation
Deploy using Docker containers
Usage Guide
Configure JetBrains AI Assistant
