Integrations

OpenAI SDK

Use the OpenAI SDKs with Sovereign by changing the base URL and the key. Chat Completions and Responses both work.

Set it up

from openai import OpenAI

client = OpenAI(base_url="https://sov.solibra.ai/v1", api_key="sov_live_…")
reply = client.chat.completions.create(
    model="gpt-6.1-sol",
    messages=[{"role": "user", "content": "Give me three names for a billing service."}],
)
print(reply.choices[0].message.content)

The SDK's OPENAI_BASE_URL and OPENAI_API_KEY environment variables work too, which also covers many tools built on the SDK.

Responses API

response = client.responses.create(model="gpt-6.1-sol", input="Give me three names for a billing service.")
print(response.output_text)

Conversations stored by OpenAI

A request that continues a conversation stored by OpenAI, with previous_response_id or conversation, stays on OpenAI's models: only OpenAI holds the earlier turns. Send the full input instead to let Sovereign choose freely.

Streaming

stream = client.chat.completions.create(
    model="gpt-6.1-sol",
    messages=[{"role": "user", "content": "Count to five."}],
    stream=True,
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

Usage is included in every response, streamed or not.

Any model name

Claude, Gemini and other models are reachable through the OpenAI format too: use any name from GET /v1/models, like claude-sonnet-5-5 or google/gemini-4-argon.