File size: 538 Bytes
8244d06 a95e477 8244d06 0698b88 8244d06 214a9a9 8244d06 cb7a721 8244d06 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | from openai import OpenAI
# Initialize the OpenAI client
client = OpenAI(
base_url="https://openrouter.ai/api/v1",
api_key="sk-or-v1-667a54ccc7364be8d56e257d4ac294cc813af8a9e696e19f6d7bed8521e1f6b",
)
# Create a chat completion
completion = client.chat.completions.create(
extra_body={},
model="deepseek/deepseek-v3-base:free",
messages=[
{
"role": "user",
"content": "What is the meaning of life?"
}
]
)
# Print the response
print(completion.choices[0].message.content) |