Developer API
Chat completions
Send text messages and stream responses with Python or cURL.
Use the chat completions API for text conversations. Choose a public model with mode: chat that your key can access.
Send a conversation
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["TRITONAI_API_KEY"],
base_url="https://tritonai-api.ucsd.edu/v1",
)
completion = client.chat.completions.create(
model="gpt-5.4",
messages=[
{
"role": "system",
"content": "Answer with short, direct sentences.",
},
{
"role": "user",
"content": "What is a model context window?",
},
],
)
print(completion.choices[0].message.content)Stream a response
stream = client.chat.completions.create(
model="gpt-5.4",
messages=[
{
"role": "user",
"content": "Give me three ways to evaluate a summarization system.",
}
],
stream=True,
)
for chunk in stream:
text = chunk.choices[0].delta.content
if text:
print(text, end="", flush=True)Main request fields
Prop
Type
The Models page shows each route's supported_openai_params values. Do not send an unsupported field.