onrup

SDKs and HTTP · Python

OpenAI Python SDK

How do I use OpenAI Python SDK with Onrup?

Point the OpenAI Python client at your deployment base URL and pass an Onrup API key. Every other line of your code stays the same — the chat completions request and response shapes are identical, including streaming.

The official Python client for the OpenAI API, and the most common way Python code talks to a language model.

Minimal working example

from openai import OpenAI

client = OpenAI(
    base_url="https://serve.onrup.com/<tenant>/<deployment>/v1",
    api_key="onrup_sk_...",
)

response = client.chat.completions.create(
    model="default",
    messages=[{"role": "user", "content": "Summarise this ticket."}],
)
print(response.choices[0].message.content)

The thing that catches people out

The `model` parameter is not ignored, but it does not select a model — the deployment already determines that. Pass "default" unless you have several adapters attached to one deployment, in which case pass the adapter name.

Worth knowing

Other sdks and http

Start with the free tier

A magic link creates your account, your tenant and your first API key. No card until you ask for compute.