This provider allows GPTScript to use models available through OpenRouter, giving you access to a wide range of AI models.
- Get your OpenRouter API key from OpenRouter.
- Set the environment variable:
Alternatively, you can add the API key to a
export OPENROUTER_API_KEY=YOUR_API_KEY.envfile in your home directory:OPENROUTER_API_KEY=YOUR_API_KEY
export GPTSCRIPT_MODEL=openai/gpt-4-turbo
gptscript --default-model='openai/gpt-4-turbo from github.com/RobinVivant/gptscript-openrouter-provider' examples/helloworld.gptgptscript --default-model='anthropic/claude-3.5-sonnet:beta from github.com/RobinVivant/gptscript-openrouter-provider' github.com/gptscript-ai/llm-basics-demoTo see all available models through OpenRouter:
gptscript --list-models github.com/RobinVivant/gptscript-openrouter-providerYou can change the GPTSCRIPT_MODEL environment variable to use any model available through OpenRouter. Alternatively, you can use the --default-model flag when running gptscript. The --default-model flag takes precedence over the GPTSCRIPT_MODEL environment variable if both are set.
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any issues or have questions, please open an issue on GitHub.