This pull request adds support for OpenRouter as a new AI provider, specifically integrating the Claude 3.5 Sonnet mod
from Anthropic through OpenRouter's API.
Key changes:
Updated lib/models.json:
Added a new entry for the Claude 3.5 Sonnet model via OpenRouter:
Added OpenRouter configuration in the getModelClient function:
Set up API key and base URL for OpenRouter
Included optional headers for OpenRouter's rankings (HTTP-Referer and X-Title)
Updated environment variables:
Added OPENROUTER_API_KEY to the environment configuration
Included NEXT_PUBLIC_SITE_URL and NEXT_PUBLIC_SITE_NAME for OpenRouter's optional headers
No changes were required in components/chat.tsx or app/api/chat/route.ts as they were already set up to handle
different model providers.
This integration allows users to leverage the Claude 3.5 Sonnet model through OpenRouter, expanding the AI capabilitie
of our application. The changes maintain compatibility with existing providers while adding this new option.
To use this new model, users will need to set up their OpenRouter API key in the environment variables.
Testing:
Verified that the OpenRouter model appears in the model selection list
Tested API calls to ensure proper communication with OpenRouter
Checked that multi-modal capabilities work as expected with this model
Next steps:
Consider adding more OpenRouter models in the future if needed
Monitor usage and performance of the Claude 3.5 Sonnet model through OpenRouter
This pull request adds support for OpenRouter as a new AI provider, specifically integrating the Claude 3.5 Sonnet mod from Anthropic through OpenRouter's API.
Key changes:
Updated
lib/models.json
:Modified
lib/models.ts
:getModelClient
function:Updated environment variables:
OPENROUTER_API_KEY
to the environment configurationNEXT_PUBLIC_SITE_URL
andNEXT_PUBLIC_SITE_NAME
for OpenRouter's optional headersNo changes were required in
components/chat.tsx
orapp/api/chat/route.ts
as they were already set up to handle different model providers.This integration allows users to leverage the Claude 3.5 Sonnet model through OpenRouter, expanding the AI capabilitie of our application. The changes maintain compatibility with existing providers while adding this new option.
To use this new model, users will need to set up their OpenRouter API key in the environment variables.
Testing:
Next steps: