SDKs

OpenAI SDK

Use the official OpenAI SDKs with Roteo for text and images.

Roteo's text and image endpoints are OpenAI-compatible, so the official OpenAI SDKs, and any client built on them, work by setting the base URL to https://api.roteo.ai/v1 and your sk_ key as the API key.

Text

from openai import OpenAI

client = OpenAI(
  base_url="https://api.roteo.ai/v1",
  api_key="sk_your_key",
)

response = client.chat.completions.create(
  model="gpt-6.1-sol",
  messages=[{"role": "user", "content": "Hello, Roteo!"}],
)
print(response.choices[0].message.content)
python · 12 lines

Any text model works here: change model to a claude-*, gpt-* or open-weight id from Models. Streaming, tools and reasoning_effort work as documented by the SDK; see Chat Completions. For GPT models, client.responses.create reaches the Responses API too.

Images

from openai import OpenAI

client = OpenAI(
  base_url="https://api.roteo.ai/v1",
  api_key="sk_your_key",
)

result = client.images.generate(
  model="nano-banana-pro",
  prompt="a neon koi drifting through violet storm clouds",
)
print(result.data[0].b64_json[:32], "...")
python · 12 lines

See the Images API reference for size, aspect_ratio and the edit endpoint.

OpenAI SDK | Roteo