mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-08-09 11:04:36 +00:00
18 lines
470 B
Python
18 lines
470 B
Python
import os
|
|
|
|
from openai import OpenAI
|
|
|
|
# The OpenAI SDK handles the 'responses' endpoint if it's updated to the latest version
|
|
# and the base_url points to a compatible proxy like Routstr.
|
|
client = OpenAI(
|
|
api_key=os.environ.get("TOKEN"),
|
|
base_url=os.environ.get("API_URL", "https://api.routstr.com/v1"),
|
|
)
|
|
|
|
response = client.responses.create(
|
|
model="gpt-5-mini",
|
|
input="Tell me a three sentence bedtime story about a unicorn.",
|
|
)
|
|
|
|
print(response.output)
|