OpenRouter Integration #3361
Algorithm5838
started this conversation in
General
Replies: 2 comments
-
Thanks for providing the guide, works like a charm |
Beta Was this translation helpful? Give feedback.
0 replies
-
For anyone who doesn't want to handwrite all OpenRouter models, here is a simple python script to automate this: import requests
def list_all_model_ids(url: str):
response = requests.get(url)
if response.status_code == 200:
models = response.json()
return [model['id'] for model in models["data"]]
else:
raise Exception(f"Failed to get models. Status code: {response.status_code}")
if __name__ == "__main__":
model_ids = list_all_model_ids('https://openrouter.ai/api/v1/models')
print(','.join(model_ids)) It will print something like:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
OpenRouter is now compatible with ChatGPT-Next-Web, offering a wide range of models from various providers. With OpenRouter, you can connect to models from:
To get started, simply configure the following settings:
BASE_URL
or OpenAI Endpoint: Set this tohttps://openrouter.ai/api
.OPENAI_API_KEY
or OpenAI API Key: Enter your OpenRouter API key here.CUSTOM_MODELS
or Custom Models: Specify the model name as it is listed within OpenRouter.Reference: https://openrouter.ai/docs
Beta Was this translation helpful? Give feedback.
All reactions