Hosted models from H2O.ai: calibrated decisions, time-series forecasts and tabular predictions.
h2o-lightning-4b.h2o-lightning-31b.POST /v1/systemone, /v1/forecasts or /v1/tabular/classify with Authorization: Bearer <key>. The full model list with prices is at /api/v1/models.openai SDK and curl): interactive (/docs), /redoc, and the OpenAPI spec /openapi.json.openai SDK is all you need: the data goes as JSON or CSV text in the user message (never an image), and the model options go in extra_body. The answer's message content is the result as JSON; usage counts data points (input points as prompt tokens, returned values as completion tokens). Options: TimeH2O horizon (or end the series with rows whose target is empty), quantile_levels, target, id_column, timestamp_column, clip_nonnegative, snap_integer; TabH2O task (classify or regress), target (rows with an empty target are predicted), quantile_levels, n_estimators, softmax_temperature, seed. stream and tools work as in OpenAI's API."mode": "jevbench" (the model card's JevBench setup), "mode": "decision_index" (its Decision Index setup) or "mode": "aa" (Decision Index plus an "I don't know" rule, for questions that offer that option), where a model offers them. Leaving it out, or "mode": "auto", is aa where offered. The response's effort_used.mode names the mode served; every mode is billed per input token as sent. The modes each model offers are listed in /api/v1/models.aa and decision_index (and in every mode of h2o-lightning-31b) a yes/no probability strictly between 0.199 and 0.801 is moved to the nearer of the two, so the answer keeps its side but not its exact probability; answers outside that band, and choice and score answers, are returned as read. For calibrated yes/no probabilities send "kwargs": {"floor": {"apply": false}}. The response's effort_used.floor gives the floor in force and the ids of the answers it moved.from openai import OpenAI
client = OpenAI(base_url="https://api.h2olightning.com/v1", api_key="<key>")
forecast = client.chat.completions.create(
model="h2oai/timeh2o-v1",
messages=[{"role": "user", "content": "[112, 118, 132, 129, 121, 135, 148, 148, 136, 119]"}],
extra_body={"horizon": 3, "quantile_levels": [0.1, 0.5, 0.9]})
churn = client.chat.completions.create(
model="h2oai/tabh2o-v1.1",
messages=[{"role": "user", "content": "tenure,plan,churn\n3,basic,yes\n40,pro,no\n5,pro,"}],
extra_body={"task": "classify", "target": "churn"})
print(forecast.choices[0].message.content) # {"object":"forecast","forecasts":[{"median":[...],"quantiles":{...}}],...}
print(churn.choices[0].message.content) # {"object":"tabular.classify","classes":["no","yes"],"labels":[...],"probabilities":[...]}