Last active
July 13, 2025 02:07
-
-
Save iamavnish/31140408c68dfdf17dd2f9fb82de900b to your computer and use it in GitHub Desktop.
Access LLMs through OpenRouter (Provider)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from openai import OpenAI | |
client = OpenAI( | |
base_url="https://openrouter.ai/api/v1", | |
api_key="<YOUR OPEN ROUTER API KEY>", | |
) | |
completion = client.chat.completions.create( | |
model="tngtech/deepseek-r1t2-chimera:free", | |
messages=[ | |
{ | |
"role": "user", | |
"content": "What is the meaning of life?" | |
} | |
] | |
) | |
print(completion.choices[0].message.content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment