Browse documentation
Docs target stable release v0.18.2.Stable vs main checked 2026-10-31

OpenAI-compatible gateways

opentine includes a LiteLLM convenience wrapper and named wrappers for hosted providers and local runtimes. Install the compatible-adapter extra, then connect to a gateway you operate separately.

Terminal
pip install "opentine[compat]"
gateway.py
1import os
2
3from opentine import Agent
4from opentine.models.compat import LiteLLM
5
6model = LiteLLM(
7    model="team-sonnet",
8    host="http://localhost:4000",
9    api_key=os.environ["LITELLM_API_KEY"],
10)
11run = Agent(model=model).run_sync("Summarize this decision.")

Responsibility boundary

Routing, fallbacks, authentication, deployment names, and provider compatibility belong to the gateway. opentine records only the provider, model, and usage data visible through that endpoint.

Billing and capabilities

The LiteLLM wrapper uses provider identity litellmand does not borrow another provider's price. It defaults to unknown rather than unmetered because it can proxy a paid backend. Configure matching rates or a catalog entry for the gateway route; otherwise hosted billing remains explicitly unknown. Tool and thinking support depend on the target model, gateway configuration, and chat template.

For an arbitrary endpoint, use OpenAICompatible with an exact base_url. Named local wrappers default to unmetered unless rates are supplied.