models.json file to define which models are available and how they map to AI providers. This allows you to customize model names, add new models, and control which provider each model uses.
Configuration File
Create amodels.json file in your project root (the same directory where you run the proxy). If this file doesn’t exist, the proxy will use built-in defaults (src/index.js:128-149).
The proxy automatically loads
models.json from the current working directory at startup (src/index.js:124).File Format
Themodels.json file is a JSON object where each key is a model name and each value contains the provider and model identifier.
Structure
The name you’ll use when making API requests. This can be any string you choose.
The AI provider to use. Must be one of:
openai- Uses OpenAI API (requiresOPENAI_API_KEY)google- Uses Google Gemini API (requiresGEMINI_API_KEY)openrouter- Uses OpenRouter API (requiresOPENROUTER_API_KEY)
The actual model identifier used by the provider.
- For OpenAI:
gpt-4o,gpt-4o-mini,gpt-4.1-mini, etc. - For Google:
gemini-2.5-flash,gemini-2.5-flash-lite, etc. - For OpenRouter:
deepseek/deepseek-r1-0528:free,moonshotai/kimi-k2:free, etc.
Example Configuration
Here’s the actualmodels.json from the repository:
Built-in Defaults
If nomodels.json file exists, the proxy uses these built-in models (src/index.js:133-143):
When using built-in models, you’ll see:
ℹ️ Using built-in models. Create a models.json file to customize.Model Validation
When you make an API request, the proxy validates that:- The model name exists in
models.json(src/index.js:188-189) - The required provider is available (has an API key set) (src/index.js:191-193)
Listing Available Models
You can query which models are currently available using the/api/tags endpoint:
Adding New Models
To add a new model, simply add an entry tomodels.json and restart the proxy:
OpenAI Model
OpenRouter Model
Gemini Model
Make sure the model ID matches the actual model identifier from the provider’s documentation.
Startup Output
When the proxy loads yourmodels.json successfully, you’ll see:
