mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-31 12:30:30 +08:00
20 lines
369 B
Python
20 lines
369 B
Python
|
|
dependencies = [
|
|
"openrouter",
|
|
"os",
|
|
]
|
|
|
|
import os
|
|
from openrouter import OpenRouter
|
|
|
|
with OpenRouter(
|
|
api_key=os.getenv("OPENROUTER_API_KEY"),
|
|
) as sdk:
|
|
result = sdk.chat.complete(
|
|
messages=[
|
|
{"role": "user", "content": "Hello, world!"},
|
|
],
|
|
model="openai/gpt-3.5-turbo",
|
|
)
|
|
print("Basic completion:", result)
|