OpenAI SDK
Official Python and TypeScript clients
The API follows the OpenAI Chat Completions schema. Install the official SDK, set base_url /
baseURL and api_key, and the rest of your code stays the same.
| Base URL | https://api.orientx.ai/v1 |
| Auth | ORIENTX_API_KEY |
Install
pip install openaiCreate a client
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.orientx.ai/v1",
api_key=os.environ["ORIENTX_API_KEY"],
)Send a request
completion = client.chat.completions.create(
model="<MODEL_ID>",
messages=[{"role": "user", "content": "In one sentence, what is an API gateway?"}],
)
print(completion.choices[0].message.content)Replace <MODEL_ID> with an id from GET /v1/models. Streaming uses stream=True / stream: true
the same way as OpenAI — see the Quick Start.
Most libraries built on this schema (LangChain, LlamaIndex, the Vercel AI SDK) take the same two
fields under base_url, baseURL, or api_base.