YMYour Model
Integrations

Python SDK

Use the OpenAI Python SDK with a custom Your Model base URL.

import os
from openai import OpenAI

api_key = os.environ.get("YOURMODEL_API_KEY")
if not api_key:
    raise RuntimeError("YOURMODEL_API_KEY is not set")

client = OpenAI(
    api_key=api_key,
    base_url="https://y-models.com/v1",
)

response = client.chat.completions.create(
    model="YOUR_MODEL_ID",
    messages=[
        {"role": "user", "content": "Hello"}
    ],
)

print(response.choices[0].message.content)

Use a real model ID from /v1/models.