Skip to content

Using from LiteLLM

LiteLLM talks to Oraicle as an OpenAI-compatible provider. Nothing needs a custom handler: prefix the model with openai/, set the base URL, and pass your Oraicle key.

Get a key from the Dashboard. Keys begin with oai-.

Add the models you want to config.yaml. The model_name is what your application asks for; the model under litellm_params is Oraicle’s id, with openai/ in front so LiteLLM uses its OpenAI-compatible path.

model_list:
- model_name: glm-4.7-flash
litellm_params:
model: openai/zai-org/GLM-4.7-Flash
api_base: https://api.oraicle.me/v1
api_key: os.environ/ORAICLE_API_KEY
- model_name: gpt-oss-120b
litellm_params:
model: openai/openai/gpt-oss-120b
api_base: https://api.oraicle.me/v1
api_key: os.environ/ORAICLE_API_KEY

Then:

Terminal window
export ORAICLE_API_KEY=oai-...
litellm --config config.yaml

Your application points at the proxy and asks for glm-4.7-flash.

Without the proxy, pass the same three values to completion():

import os
from litellm import completion
response = completion(
model="openai/zai-org/GLM-4.7-Flash",
api_base="https://api.oraicle.me/v1",
api_key=os.environ["ORAICLE_API_KEY"],
messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)

Streaming works the same way — pass stream=True.

Every id from Models can go in the config. For the current list at any moment:

Terminal window
curl https://api.oraicle.me/v1/models

Each entry carries pricing.input and pricing.output in US dollars per million tokens, from the same table billing reads.

Every call is billed per token from your prepaid Oraicle wallet — no subscription, and no per-model plan to choose. LiteLLM’s own max_budget and rate-limit settings still apply on top, and are worth setting if the proxy is shared.

A call that fails before producing anything — a bad model id, an upstream outage — is not billed. A reply that starts streaming and then breaks is billed for the tokens it did produce, because the model produced them. A wallet with no balance returns an error rather than queueing.

Oraicle’s oracles — web, news, weather, stocks, crypto, maps, images — are switched on with a tools entry of the shape {"type": "weather"}. That is an extension to the OpenAI request, so LiteLLM will not produce it for you.

To use one, pass it through as an extra body parameter:

response = completion(
model="openai/openai/gpt-oss-120b",
api_base="https://api.oraicle.me/v1",
api_key=os.environ["ORAICLE_API_KEY"],
messages=[{"role": "user", "content": "What's the weather in Tokyo?"}],
extra_body={"tools": [{"type": "weather"}]},
)

Standard OpenAI function tools keep working alongside these, and LiteLLM handles those the usual way. Each oracle lookup is billed once on top of the tokens, and only when it succeeds — see Live data (oracles).