{
 "openapi": "3.1.0",
 "info": {
  "title": "H2O-Lightning API",
  "version": "2026-11-19",
  "description": "The hosted H2O-Lightning API: calibrated **decisions** (H2O-Lightning-4B and H2O-Lightning-31B answer yes/no, choice and\nscore questions about a text or an image with a probability for every answer), **time-series forecasts** (TimeH2O,\nTimeH2O-tiny) and **tabular predictions** (TabH2O). Every example on this page is a real request and the answer the live\nAPI gave to it; the Python samples use the official `openai` SDK and the curl samples send the identical HTTP request.\n\nPages: [interactive reference](/docs) · [reference (Redoc)](/redoc) · [OpenAPI spec](/openapi.json) ·\n[home](/) · [model list with prices](/api/v1/models)\n\n## Authentication\n\nEvery model route takes an API key from H2O.ai as a bearer token:\n\n    Authorization: Bearer $LIGHTNING_API_KEY\n\nA missing or wrong key is a `401`. A key lists the models (and routes) it may call; `GET /v1/models` shows them.\nRepeated wrong keys from one address are throttled (`429` with `Retry-After: 60`).\n\n## Base URLs and regions\n\n| Address | Serves |\n|---|---|\n| `https://api.h2olightning.com` (also `https://api.lightning.h2oai.com`) | every model, from the site that serves it; the nearest site answers |\n| `https://api-us.h2olightning.com` (also `api-us.lightning.h2oai.com`) | pinned to the US site (us-east-1) |\n| `https://api-eu.h2olightning.com` (also `api-eu.lightning.h2oai.com`) | pinned to the EU site (eu-central-1) |\n\nWith the OpenAI SDK, use the address plus `/v1` as `base_url`. Instead of a pinned address you can send the header\n`X-Lightning-Region: us` or `eu` (`auto` = nearest); a pinned address wins over the header. A pinned request is never\nmoved to the other region: a model that region does not serve is a `400` (`model_not_in_region`) naming the region that\nserves it, and a region that is down is a `503` with `Retry-After`. Every response names the region that answered in\n`x-lightning-region`; a model answer also names the region of the model that answered in `x-lightning-backend`.\n\nWhere the models run today (also in `/api/v1/models`, `datacenters`): H2O-Lightning-4B in eu-central-1, H2O-Lightning-31B\nin us-east-1, TimeH2O / TimeH2O-tiny / TabH2O in us-east-1. Both regional addresses answer the foundation models.\n\n## Models\n\n| Model id | What it does | Routes | Price (USD per million) |\n|---|---|---|---|\n| `h2o-lightning-4b` (also `H2O-Lightning-4B`, `h2oai/h2o-lightning-4b`) | decisions, text and images | `/v1/systemone`, `/v1/decisions`, `/api/alpha/decisions` | 0.007 input tokens (0.0019 on a request with an image) |\n| `h2o-lightning-31b` (also `H2O-Lightning-31B`, `H2O-Lightning`, `h2oai/h2o-lightning-31b`) | decisions, text and images | same | 0.015 input tokens (0.0041 with an image) |\n| `h2oai/timeh2o-v1` | forecasts with quantiles, covariates | `/v1/chat/completions`, `/v1/forecasts`, `/api/alpha/forecasts` | 0.25 input / 1.00 output points |\n| `h2oai/timeh2o-v1-tiny` | smaller, faster forecasts, no covariates | same | 0.02 / 0.10 points |\n| `h2oai/tabh2o-v1.1` | classification and regression from training rows in the request | `/v1/chat/completions`, `/v1/tabular/classify`, `/v1/tabular/regress`, `/api/alpha/tabular` | 0.10 input / 0.40 output cells |\n\nDecisions are billed per input token as you sent them, in every mode (`usage.input_tokens`); output tokens are not billed.\nFoundation models are billed per data point (one point = one number or table cell in, one value out); on the chat route\nthe points are reported as `prompt_tokens` / `completion_tokens`. The live price list is `GET /api/v1/models`.\n\n## Decisions\n\nA decision request is a **record** (`state`: text, an image, or both) and up to 128 named **questions**. Question types:\n\n- **yes/no** (`noul` on the native wire, `predicate` on the OpenAI-style wire): the answer is P(yes).\n- **choice**: one of 2-255 options; the answer is the chosen option, its confidence and every option's probability.\n- **score**: an ordered scale of 2-10 levels; the answer is the expected level (0-based), the most likely level's\n  confidence and every level's probability.\n\nThree wires carry the same models and answers: `POST /v1/systemone` (the native wire, answers keyed by question name),\n`POST /v1/decisions` (OpenAI-style shapes: `input`, a question list, answers as a list) and `POST /api/alpha/decisions`\n(OpenRouter's decisions wire). `/systemone` and `/decisions` are aliases of the `/v1/` routes.\n\n**Modes** (top-level `mode`, or `kwargs.mode`): `jevbench` (the model card's JevBench setup), `decision_index` (its\nDecision Index setup: a second read of unsure questions), `aa` (Decision Index plus an \"I don't know\" rule for a choice\nquestion that offers exactly one such option). Leaving it out, or `auto`, serves `aa`. The response's\n`effort_used.mode` says what was served. A second read a mode makes is not billed (`usage.processed_input_tokens`).\n\n**Yes/no floor**: in `aa` and `decision_index` (and in every mode of the 31B) a P(yes) strictly between 0.199 and 0.801\nis moved to the nearer of the two, so the answer keeps its side; send `\"kwargs\": {\"floor\": {\"apply\": false}}` for the\ncalibrated P(yes). `effort_used.floor` gives the floor in force and the questions it moved.\n\n**Reading direction**: `attention_mode` `\"bidirectional\"` (two-way, the default where the model offers it) or `\"causal\"`\n(one-way); the response's `attention_mode` says which ran.\n\n**Images**: on `/v1/systemone` as data URLs in `images`; on `/v1/decisions` as `input_image` parts; on\n`/api/alpha/decisions` as `image_url` parts inside `state`.\n\n**Timeouts**: the request's own deadline is the optional top-level `timeout` (seconds, at most 120). In `aa` mode a\n31B request with one choice question and no images may think for up to ~145 s before answering: use a client read\ntimeout of at least 180 s.\n\n## Foundation models (TimeH2O, TabH2O)\n\nThe simplest way is the standard OpenAI chat-completions request: put the data as JSON or CSV **text** in the user\nmessage (never an image) and the model options in `extra_body` (they travel as top-level JSON fields). The answer's\n`message.content` is the result as JSON. `stream` and `tools` work as in OpenAI's API. The native routes\n(`/v1/forecasts`, `/v1/tabular/*`, and the OpenRouter-style `/api/alpha/forecasts`, `/api/alpha/tabular`) take the same\ndata as JSON objects and give the same numbers.\n\n## Errors\n\nErrors are JSON: `{\"error\": {\"message\", \"type\", \"param\", \"code\"}}`; the message names the field, never your data.\n\n| Status | When |\n|---|---|\n| 400 | an invalid request: a missing or wrong field, an unknown mode, an option of another model, a model the pinned region does not serve (`model_not_in_region`) |\n| 401 | no API key, or a wrong one |\n| 403 | the key may not call this model or route |\n| 404 | an unknown model, or a path that is not part of the API |\n| 405 | a decision or foundation route called with a method other than POST (`Allow: POST`) |\n| 408 / 413 / 415 | the body arrived too slowly / is over 16 MiB / is not JSON |\n| 422 | no question of the request fits the model (for example a record that cannot be read within the model's context with `state.cutoff` `\"reject\"`) |\n| 429 | a rate limit: wait `Retry-After` seconds |\n| 503 | the model or region is busy or down: retry after `Retry-After` seconds (a region-pinned request never moves region) |\n\n## Rate limits\n\nEach key has a requests-per-minute limit, a tokens-per-minute limit and a parallel-request limit; every model answer\nreports them in the `x-ratelimit-api_key-*` headers (limit and remaining). The foundation models allow 60 requests per\nminute per model and key. Calls without a key, and the key-less pages, are limited per address. Past a limit the answer\nis a `429` with `Retry-After`. Request bodies are limited to 16 MiB.\n\n## Response headers\n\n| Header | Meaning |\n|---|---|\n| `x-lightning-region` | the region that answered (`us-east-1` or `eu-central-1`), on every response |\n| `x-lightning-backend` | the region of the model that answered, on a model answer |\n| `x-lightning-region-state` | `serving`, or `degraded-remote` when the answering region relies on the other region |\n| `x-ratelimit-api_key-limit-requests`, `-remaining-requests` | the key's requests per minute, and what is left |\n| `x-ratelimit-api_key-limit-tokens`, `-remaining-tokens` | the key's tokens per minute, and what is left |\n| `x-ratelimit-api_key-limit-max_parallel_requests`, `-remaining-max_parallel_requests` | the key's parallel requests |\n| `x-litellm-response-cost` | the cost of this answer in USD |\n| `x-lightning-queue-depth`, `x-lightning-queue-estimate-ms` | the decision queue when your request was admitted |\n| `Retry-After` | seconds to wait, on a 429 or 503 |\n\n## Policies\n\n[Privacy policy](/privacy) · [Terms of use](/terms) · [Data policy](/data-policy) ·\n[Service status](https://status.lightning.h2oai.com/)",
  "termsOfService": "https://api.h2olightning.com/terms",
  "contact": {
   "name": "H2O.ai",
   "url": "https://h2o.ai"
  }
 },
 "servers": [
  {
   "url": "https://api.h2olightning.com",
   "description": "Nearest site (every model)"
  },
  {
   "url": "https://api-us.h2olightning.com",
   "description": "US site (us-east-1)"
  },
  {
   "url": "https://api-eu.h2olightning.com",
   "description": "EU site (eu-central-1)"
  },
  {
   "url": "https://api.lightning.h2oai.com",
   "description": "Nearest site (h2oai.com name)"
  }
 ],
 "security": [
  {
   "bearerAuth": []
  }
 ],
 "tags": [
  {
   "name": "Decisions",
   "description": "H2O-Lightning-4B and H2O-Lightning-31B: calibrated answers to yes/no, choice and score questions."
  },
  {
   "name": "Foundation models",
   "description": "TimeH2O, TimeH2O-tiny and TabH2O through the OpenAI chat-completions request."
  },
  {
   "name": "Foundation models (native routes)",
   "description": "The same models with JSON request objects (and OpenRouter's wire)."
  },
  {
   "name": "Models",
   "description": "What you can call, and the public price list."
  },
  {
   "name": "Service",
   "description": "Liveliness."
  }
 ],
 "paths": {
  "/v1/models": {
   "get": {
    "operationId": "listModels",
    "tags": [
     "Models"
    ],
    "summary": "List the models your key may call",
    "description": "OpenAI's model list. Foundation models carry a `lightning` block with their task, routes, limits and prices.",
    "x-codeSamples": [
     {
      "lang": "Python",
      "label": "Python",
      "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(base_url=\"https://api.h2olightning.com/v1\", api_key=os.environ[\"LIGHTNING_API_KEY\"])\n\nfor model in client.models.list():\n    print(model.id)\n"
     },
     {
      "lang": "Shell",
      "label": "curl",
      "source": "curl https://api.h2olightning.com/v1/models \\\n  -H \"Authorization: Bearer $LIGHTNING_API_KEY\"\n"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "models": {
          "summary": "List the models your key may call",
          "value": {
           "data": [
            {
             "id": "h2o-lightning-4b",
             "object": "model",
             "created": 1677610602,
             "owned_by": "openai"
            },
            {
             "id": "h2o-lightning-31b",
             "object": "model",
             "created": 1677610602,
             "owned_by": "openai"
            },
            {
             "id": "h2oai/timeh2o-v1",
             "object": "model",
             "created": 1677610602,
             "owned_by": "openai",
             "lightning": {
              "provider": "lightning_fm",
              "hugging_face_id": "h2oai/timeh2o-v1",
              "readiness": "ready",
              "processing_region": "us-east-1",
              "pricing": {
               "unit": "point",
               "input_usd_per_million": 0.25,
               "output_usd_per_million": 1.0
              },
              "default_quantile_levels": [
               0.1,
               0.2,
               0.3,
               0.4,
               0.5,
               0.6,
               0.7,
               0.8,
               0.9
              ],
              "task": "time-series-forecasting",
              "endpoints": [
               "/v1/forecasts",
               "/api/alpha/forecasts"
              ],
              "covariates": true,
              "limits": {
               "max_series": 256,
               "max_horizon": 1024,
               "max_covariates": 32,
               "max_points": 4000000,
               "context_steps": 16384
              }
             }
            },
            {
             "id": "h2oai/timeh2o-v1-tiny",
             "object": "model",
             "created": 1677610602,
             "owned_by": "openai",
             "lightning": {
              "provider": "lightning_fm",
              "hugging_face_id": "h2oai/timeh2o-v1-tiny",
              "readiness": "ready",
              "processing_region": "us-east-1",
              "pricing": {
               "unit": "point",
               "input_usd_per_million": 0.02,
               "output_usd_per_million": 0.1
              },
              "default_quantile_levels": [
               0.1,
               0.2,
               0.3,
               0.4,
               0.5,
               0.6,
               0.7,
               0.8,
               0.9
              ],
              "task": "time-series-forecasting",
              "endpoints": [
               "/v1/forecasts",
               "/api/alpha/forecasts"
              ],
              "covariates": false,
              "limits": {
               "max_series": 256,
               "max_horizon": 1024,
               "max_covariates": 32,
               "max_points": 4000000,
               "context_steps": 16384
              }
             }
            },
            {
             "id": "h2oai/tabh2o-v1.1",
             "object": "model",
             "created": 1677610602,
             "owned_by": "openai",
             "lightning": {
              "provider": "lightning_fm",
              "hugging_face_id": "h2oai/tabh2o-v1.1",
              "readiness": "ready",
              "processing_region": "us-east-1",
              "pricing": {
               "unit": "cell",
               "input_usd_per_million": 0.1,
               "output_usd_per_million": 0.4
              },
              "default_quantile_levels": [
               0.1,
               0.2,
               0.3,
               0.4,
               0.5,
               0.6,
               0.7,
               0.8,
               0.9
              ],
              "task": "tabular-classification-regression",
              "endpoints": [
               "/v1/tabular/classify",
               "/v1/tabular/regress",
               "/api/alpha/tabular"
              ],
              "limits": {
               "max_train_rows": 10000,
               "max_test_rows": 10000,
               "max_columns": 500,
               "max_cells": 1000000,
               "max_classes": 100
              }
             }
            }
           ],
           "object": "list"
          }
         }
        },
        "schema": {
         "$ref": "#/components/schemas/ModelList"
        }
       }
      },
      "headers": {
       "x-lightning-region": {
        "$ref": "#/components/headers/x-lightning-region"
       },
       "x-lightning-backend": {
        "$ref": "#/components/headers/x-lightning-backend"
       },
       "x-lightning-region-state": {
        "$ref": "#/components/headers/x-lightning-region-state"
       },
       "x-ratelimit-api_key-remaining-requests": {
        "$ref": "#/components/headers/x-ratelimit-api_key-remaining-requests"
       },
       "x-ratelimit-api_key-remaining-tokens": {
        "$ref": "#/components/headers/x-ratelimit-api_key-remaining-tokens"
       },
       "x-litellm-response-cost": {
        "$ref": "#/components/headers/x-litellm-response-cost"
       }
      }
     },
     "400": {
      "description": "Invalid request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "No or wrong API key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limited: see Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "Busy or down: retry after Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/models": {
   "get": {
    "operationId": "publicCatalogue",
    "tags": [
     "Models"
    ],
    "summary": "Public catalogue (no key)",
    "description": "Every hosted model with prices, regions and decision modes; no key needed; cached for 60 s.",
    "security": [],
    "x-codeSamples": [
     {
      "lang": "Shell",
      "label": "curl",
      "source": "curl https://api.h2olightning.com/api/v1/models\n"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "catalogue": {
          "summary": "The public catalogue (no key)",
          "value": {
           "data": [
            {
             "schema_version": "2.4",
             "id": "h2o-lightning-4b",
             "name": "H2O-Lightning-4B",
             "hugging_face_id": "h2oai/h2o-lightning-4b",
             "created": 1791331200,
             "quantization": "fp8",
             "description": "H2O.ai's 4B open-weight decision model for text and images, compatible with the System One and Decisions APIs. #1 open-weight model on JevBench's Composite Score (Oct 7–12, 2026), ahead of Jev.",
             "input_modalities": [
              {
               "type": "text",
               "supported_inputs": {
                "max_context_length": {
                 "value": 131072,
                 "unit": "token"
                }
               },
               "pricing": [
                {
                 "type": "prompt",
                 "unit": "token",
                 "cost_usd": "0.000000007"
                }
               ]
              },
              {
               "type": "image",
               "pricing": [
                {
                 "type": "prompt",
                 "unit": "token",
                 "cost_usd": "0.0000000019"
                }
               ]
              }
             ],
             "output_modalities": [
              {
               "type": "decisions",
               "supported_parameters": {}
              }
             ],
             "datacenters": [
              {
               "country_code": "DE",
               "region": "eu-central-1"
              }
             ],
             "deployment_region": "global",
             "is_ready": true,
             "x_h2o": {
              "modes": {
               "field": "mode",
               "values": [
                "auto",
                "jevbench",
                "decision_index",
                "aa"
               ],
               "auto_serves": "aa",
               "where": "top-level \"mode\" (or kwargs.mode) on POST /v1/systemone, /v1/decisions and /api/alpha/decisions",
               "echo": "effort_used.mode (the mode served) and effort_used.mode_requested",
               "billing": "usage.input_tokens: the input as sent, in every mode; a mode's second reads are reported in usage.processed_input_tokens and are not billed",
               "jevbench": "the model card's JevBench setup: the released package's default serve (two-way reading, yes/no floor off, images up to 1,638,400 pixels at temperature 1.0, the record read whole up to 40,960 tokens)",
               "decision_index": "the model card's Decision Index setup (PROFILE=di): jevbench plus a second read of every text question under 0.8 confidence with its input written twice (answered 2:1 with the first), yes/no floor 0.801",
               "aa": "decision_index plus the \"I don't know\" rule: a choice question that offers exactly one \"I don't know\" option answers it when its best real answer, renormalised, is under 0.80"
              }
             }
            },
            {
             "schema_version": "2.4",
             "id": "h2o-lightning-31b",
             "name": "H2O-Lightning-31B",
             "hugging_face_id": "h2oai/h2o-lightning-31b",
             "created": 1792537228,
             "quantization": "fp8",
             "description": "H2O.ai's 31B decision model for text and images, compatible with the System One and Decisions APIs: calibrated answers to choice, yes/no and score questions about a record.",
             "input_modalities": [
              {
               "type": "text",
               "supported_inputs": {
                "max_context_length": {
                 "value": 131072,
                 "unit": "token"
                }
               },
               "pricing": [
                {
                 "type": "prompt",
                 "unit": "token",
                 "cost_usd": "0.000000015"
                }
               ]
              },
              {
               "type": "image",
               "pricing": [
                {
                 "type": "prompt",
                 "unit": "token",
                 "cost_usd": "0.0000000041"
                }
               ]
              }
             ],
             "output_modalities": [
              {
               "type": "decisions",
               "supported_parameters": {}
              }
             ],
             "datacenters": [
              {
               "country_code": "US",
               "region": "us-east-1"
              }
             ],
             "deployment_region": "global",
             "is_ready": true,
             "x_h2o": {
              "modes": {
               "field": "mode",
               "values": [
                "auto",
                "jevbench",
                "decision_index",
                "aa"
               ],
               "auto_serves": "aa",
               "where": "top-level \"mode\" (or kwargs.mode) on POST /v1/systemone, /v1/decisions and /api/alpha/decisions",
               "echo": "effort_used.mode (the mode served) and effort_used.mode_requested",
               "billing": "usage.input_tokens: the input as sent, in every mode; a mode's second reads are reported in usage.processed_input_tokens and are not billed",
               "jevbench": "the model card's JevBench setup: the released package's two-way profile (two-way reading within 8,192 tokens, one-way above it or past 4,096 summed prompt tokens; one read; the record whole up to 126,976 tokens, BM25-selected above)",
               "decision_index": "the model card's Decision Index setup: jevbench plus a second read of every unsure choice or yes/no question (under 0.9) in the questions-first layout, averaged with the first, for requests up to 2,000 tokens; unsure image questions (under 0.8) read again at 1,120 soft tokens; image temperature 0.96",
               "aa": "decision_index plus the \"I don't know\" rule (cutoff 0.80)"
              }
             }
            },
            {
             "schema_version": "2.4",
             "id": "h2oai/timeh2o-v1",
             "name": "timeh2o-v1",
             "hugging_face_id": "h2oai/timeh2o-v1",
             "created": 1792681256,
             "quantization": "fp32",
             "input_modalities": [
              {
               "type": "text",
               "supported_inputs": {
                "max_context_length": {
                 "value": 4000000,
                 "unit": "token"
                }
               },
               "pricing": [
                {
                 "type": "prompt",
                 "unit": "token",
                 "cost_usd": "0.00000025"
                }
               ]
              }
             ],
             "output_modalities": [
              {
               "type": "text",
               "supported_parameters": {
                "horizon": {
                 "type": "integer",
                 "min": 1,
                 "max": 1024
                },
                "quantile_levels": {
                 "type": "array",
                 "items": {
                  "type": "range",
                  "min": 0,
                  "max": 1
                 },
                 "max_items": 19
                },
                "target": {
                 "type": "unknown"
                },
                "id_column": {
                 "type": "unknown"
                },
                "timestamp_column": {
                 "type": "unknown"
                },
                "flip_equivariant": {
                 "type": "boolean",
                 "default": true
                },
                "clip_nonnegative": {
                 "type": "boolean",
                 "default": false
                },
                "snap_integer": {
                 "type": "boolean",
                 "default": false
                },
                "stream": {
                 "type": "boolean",
                 "default": false
                },
                "tools": {
                 "type": "unknown"
                },
                "tool_choice": {
                 "type": "unknown"
                }
               },
               "pricing": [
                {
                 "type": "completion",
                 "unit": "token",
                 "cost_usd": "0.000001"
                }
               ]
              }
             ],
             "datacenters": [
              {
               "country_code": "US",
               "region": "us-east-1"
              }
             ],
             "deployment_region": "US",
             "is_ready": true,
             "x_h2o": {
              "endpoints": [
               "POST /v1/chat/completions",
               "POST /v1/forecasts",
               "POST /api/alpha/forecasts"
              ],
              "limits": {
               "max_series": 256,
               "max_horizon": 1024,
               "max_points": 4000000,
               "context_steps": 16384,
               "max_covariates": 32
              },
              "point": "one billed token = one data point; input: every target and covariate value sent; output: every forecast value returned",
              "data": {
               "formats": [
                "JSON array of numbers",
                "JSON object {target, future_covariates, past_covariates} or {series: [...]}",
                "JSON records",
                "CSV text (header row)"
               ],
               "where": "the last user message, as text; image parts are refused",
               "options": "request parameters (the openai SDK's extra_body), or in the message as {\"data\": ..., <option>: ...}",
               "future_rows": "records/CSV: trailing rows with an empty target are the forecast horizon"
              },
              "outputs": [
               "median",
               "mean",
               "quantiles"
              ],
              "default_quantile_levels": [
               0.1,
               0.2,
               0.3,
               0.4,
               0.5,
               0.6,
               0.7,
               0.8,
               0.9
              ],
              "processing_region": "us-east-1",
              "covariates": true
             }
            },
            {
             "schema_version": "2.4",
             "id": "h2oai/timeh2o-v1-tiny",
             "name": "timeh2o-v1-tiny",
             "hugging_face_id": "h2oai/timeh2o-v1-tiny",
             "created": 1791704236,
             "quantization": "fp32",
             "input_modalities": [
              {
               "type": "text",
               "supported_inputs": {
                "max_context_length": {
                 "value": 4000000,
                 "unit": "token"
                }
               },
               "pricing": [
                {
                 "type": "prompt",
                 "unit": "token",
                 "cost_usd": "0.00000002"
                }
               ]
              }
             ],
             "output_modalities": [
              {
               "type": "text",
               "supported_parameters": {
                "horizon": {
                 "type": "integer",
                 "min": 1,
                 "max": 1024
                },
                "quantile_levels": {
                 "type": "array",
                 "items": {
                  "type": "range",
                  "min": 0,
                  "max": 1
                 },
                 "max_items": 19
                },
                "target": {
                 "type": "unknown"
                },
                "id_column": {
                 "type": "unknown"
                },
                "timestamp_column": {
                 "type": "unknown"
                },
                "flip_equivariant": {
                 "type": "boolean",
                 "default": true
                },
                "clip_nonnegative": {
                 "type": "boolean",
                 "default": false
                },
                "snap_integer": {
                 "type": "boolean",
                 "default": false
                },
                "stream": {
                 "type": "boolean",
                 "default": false
                },
                "tools": {
                 "type": "unknown"
                },
                "tool_choice": {
                 "type": "unknown"
                }
               },
               "pricing": [
                {
                 "type": "completion",
                 "unit": "token",
                 "cost_usd": "0.0000001"
                }
               ]
              }
             ],
             "datacenters": [
              {
               "country_code": "US",
               "region": "us-east-1"
              }
             ],
             "deployment_region": "US",
             "is_ready": true,
             "x_h2o": {
              "endpoints": [
               "POST /v1/chat/completions",
               "POST /v1/forecasts",
               "POST /api/alpha/forecasts"
              ],
              "limits": {
               "max_series": 256,
               "max_horizon": 1024,
               "max_points": 4000000,
               "context_steps": 16384,
               "max_covariates": 0
              },
              "point": "one billed token = one data point; input: every target and covariate value sent; output: every forecast value returned",
              "data": {
               "formats": [
                "JSON array of numbers",
                "JSON object {target, future_covariates, past_covariates} or {series: [...]}",
                "JSON records",
                "CSV text (header row)"
               ],
               "where": "the last user message, as text; image parts are refused",
               "options": "request parameters (the openai SDK's extra_body), or in the message as {\"data\": ..., <option>: ...}",
               "future_rows": "records/CSV: trailing rows with an empty target are the forecast horizon"
              },
              "outputs": [
               "median",
               "mean",
               "quantiles"
              ],
              "default_quantile_levels": [
               0.1,
               0.2,
               0.3,
               0.4,
               0.5,
               0.6,
               0.7,
               0.8,
               0.9
              ],
              "processing_region": "us-east-1",
              "covariates": false
             }
            },
            {
             "schema_version": "2.4",
             "id": "h2oai/tabh2o-v1.1",
             "name": "tabh2o-v1.1",
             "hugging_face_id": "h2oai/tabh2o-v1.1",
             "created": 1793014151,
             "quantization": "fp32",
             "input_modalities": [
              {
               "type": "text",
               "supported_inputs": {
                "max_context_length": {
                 "value": 1000000,
                 "unit": "token"
                }
               },
               "pricing": [
                {
                 "type": "prompt",
                 "unit": "token",
                 "cost_usd": "0.0000001"
                }
               ]
              }
             ],
             "output_modalities": [
              {
               "type": "text",
               "supported_parameters": {
                "task": {
                 "type": "enum",
                 "values": [
                  "classify",
                  "regress"
                 ]
                },
                "target": {
                 "type": "unknown"
                },
                "quantile_levels": {
                 "type": "array",
                 "items": {
                  "type": "range",
                  "min": 0,
                  "max": 1
                 },
                 "max_items": 19
                },
                "n_estimators": {
                 "type": "integer",
                 "min": 1,
                 "max": 32,
                 "default": 8
                },
                "random_state": {
                 "type": "integer",
                 "min": 0,
                 "max": 4294967295,
                 "default": 42
                },
                "seed": {
                 "type": "integer",
                 "min": 0,
                 "max": 4294967295
                },
                "softmax_temperature": {
                 "type": "range",
                 "min": 0
                },
                "stream": {
                 "type": "boolean",
                 "default": false
                },
                "tools": {
                 "type": "unknown"
                },
                "tool_choice": {
                 "type": "unknown"
                }
               },
               "pricing": [
                {
                 "type": "completion",
                 "unit": "token",
                 "cost_usd": "0.0000004"
                }
               ]
              }
             ],
             "datacenters": [
              {
               "country_code": "US",
               "region": "us-east-1"
              }
             ],
             "deployment_region": "US",
             "is_ready": true,
             "x_h2o": {
              "endpoints": [
               "POST /v1/chat/completions",
               "POST /v1/tabular/classify",
               "POST /v1/tabular/regress",
               "POST /api/alpha/tabular"
              ],
              "limits": {
               "max_train_rows": 10000,
               "max_test_rows": 10000,
               "max_columns": 500,
               "max_cells": 1000000,
               "max_classes": 100
              },
              "point": "one billed token = one data point; input: every train and test cell and train target sent; output: every predicted value and probability returned",
              "data": {
               "formats": [
                "JSON records",
                "CSV text (header row)",
                "JSON object {columns, train: {rows, target}, test: {rows}}"
               ],
               "where": "the last user message, as text; image parts are refused",
               "options": "request parameters (the openai SDK's extra_body), or in the message as {\"data\": ..., <option>: ...}",
               "predicted_rows": "records/CSV: rows with an empty target are predicted, the others train"
              },
              "outputs": [
               "labels",
               "probabilities",
               "mean",
               "median",
               "quantiles"
              ],
              "default_quantile_levels": [
               0.1,
               0.2,
               0.3,
               0.4,
               0.5,
               0.6,
               0.7,
               0.8,
               0.9
              ],
              "processing_region": "us-east-1"
             }
            }
           ],
           "x_h2o": {
            "schema": "OpenRouter provider model document 2.4; every entry validates once its x_h2o block is removed",
            "decision_feed": "/openrouter/v1/models"
           }
          }
         }
        },
        "schema": {
         "$ref": "#/components/schemas/Catalogue"
        }
       }
      }
     }
    }
   }
  },
  "/health/liveliness": {
   "get": {
    "operationId": "liveliness",
    "tags": [
     "Service"
    ],
    "summary": "Liveliness (no key)",
    "description": "200 while the gateway that answered is up.",
    "security": [],
    "x-codeSamples": [
     {
      "lang": "Shell",
      "label": "curl",
      "source": "curl https://api.h2olightning.com/health/liveliness\n"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "liveliness": {
          "summary": "Liveliness (no key)",
          "value": "I'm alive!"
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/systemone": {
   "post": {
    "operationId": "systemone",
    "tags": [
     "Decisions"
    ],
    "summary": "Decide (native wire)",
    "description": "Answer named yes/no (`noul`), choice and score questions about a record. Answers come back under the question names. Alias: `POST /systemone`.",
    "x-codeSamples": [
     {
      "lang": "Python",
      "label": "Python text",
      "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(base_url=\"https://api.h2olightning.com/v1\", api_key=os.environ[\"LIGHTNING_API_KEY\"])\n\n# not one of the SDK's typed methods: client.post sends this body as it is and returns the JSON answer\nanswer = client.post(\"/systemone\", cast_to=object, body={\n    \"model\": \"h2o-lightning-4b\",\n    \"state\": \"Ticket 4411: checkout has been down for all customers for 20 minutes; payments fail with HTTP 500.\",\n    \"questions\": {\n        \"urgent\": {\n            \"type\": \"noul\",\n            \"instructions\": \"Is this an urgent incident?\",\n            \"criteria\": {\"true\": \"yes\", \"false\": \"no\"},\n        },\n        \"team\": {\n            \"type\": \"choice\",\n            \"instructions\": \"Which team should handle it?\",\n            \"criteria\": {\n                \"payments\": \"the payments team\",\n                \"search\": \"the search team\",\n                \"docs\": \"the documentation team\",\n            },\n        },\n        \"severity\": {\n            \"type\": \"score\",\n            \"instructions\": \"How severe is it?\",\n            \"criteria\": [\"minor\", \"moderate\", \"major\", \"critical\"],\n        },\n    },\n})\nprint(answer[\"answers\"])\n"
     },
     {
      "lang": "Shell",
      "label": "curl text",
      "source": "curl https://api.h2olightning.com/v1/systemone \\\n  -H \"Authorization: Bearer $LIGHTNING_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"h2o-lightning-4b\",\n    \"state\": \"Ticket 4411: checkout has been down for all customers for 20 minutes; payments fail with HTTP 500.\",\n    \"questions\": {\n        \"urgent\": {\n            \"type\": \"noul\",\n            \"instructions\": \"Is this an urgent incident?\",\n            \"criteria\": {\"true\": \"yes\", \"false\": \"no\"}\n        },\n        \"team\": {\n            \"type\": \"choice\",\n            \"instructions\": \"Which team should handle it?\",\n            \"criteria\": {\n                \"payments\": \"the payments team\",\n                \"search\": \"the search team\",\n                \"docs\": \"the documentation team\"\n            }\n        },\n        \"severity\": {\n            \"type\": \"score\",\n            \"instructions\": \"How severe is it?\",\n            \"criteria\": [\"minor\", \"moderate\", \"major\", \"critical\"]\n        }\n    }\n}'\n"
     },
     {
      "lang": "Python",
      "label": "Python jevbench mode",
      "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(base_url=\"https://api.h2olightning.com/v1\", api_key=os.environ[\"LIGHTNING_API_KEY\"])\n\n# not one of the SDK's typed methods: client.post sends this body as it is and returns the JSON answer\nanswer = client.post(\"/systemone\", cast_to=object, body={\n    \"model\": \"h2o-lightning-31b\",\n    \"mode\": \"jevbench\",\n    \"attention_mode\": \"causal\",\n    \"state\": \"Ticket 4411: checkout has been down for all customers for 20 minutes; payments fail with HTTP 500.\",\n    \"questions\": {\n        \"urgent\": {\n            \"type\": \"noul\",\n            \"instructions\": \"Is this an urgent incident?\",\n            \"criteria\": {\"true\": \"yes\", \"false\": \"no\"},\n        },\n    },\n    \"kwargs\": {\"floor\": {\"apply\": False}},\n})\nprint(answer[\"answers\"])\n"
     },
     {
      "lang": "Shell",
      "label": "curl jevbench mode",
      "source": "curl https://api.h2olightning.com/v1/systemone \\\n  -H \"Authorization: Bearer $LIGHTNING_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"h2o-lightning-31b\",\n    \"mode\": \"jevbench\",\n    \"attention_mode\": \"causal\",\n    \"state\": \"Ticket 4411: checkout has been down for all customers for 20 minutes; payments fail with HTTP 500.\",\n    \"questions\": {\n        \"urgent\": {\n            \"type\": \"noul\",\n            \"instructions\": \"Is this an urgent incident?\",\n            \"criteria\": {\"true\": \"yes\", \"false\": \"no\"}\n        }\n    },\n    \"kwargs\": {\"floor\": {\"apply\": false}}\n}'\n"
     },
     {
      "lang": "Python",
      "label": "Python image",
      "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(base_url=\"https://api.h2olightning.com/v1\", api_key=os.environ[\"LIGHTNING_API_KEY\"])\n\n# not one of the SDK's typed methods: client.post sends this body as it is and returns the JSON answer\nanswer = client.post(\"/systemone\", cast_to=object, body={\n    \"model\": \"h2o-lightning-4b\",\n    \"state\": \"Describe the colour of the attached image.\",\n    \"images\": [\n        \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAAT0lEQVR42u3PQQkAAAgEsEty/aMYywi+hcEKLNO+FgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQGBywLKp0DxvxLbjwAAAABJRU5ErkJggg==\",\n    ],\n    \"questions\": {\n        \"red\": {\n            \"type\": \"noul\",\n            \"instructions\": \"Is the image mostly red?\",\n            \"criteria\": {\"true\": \"yes\", \"false\": \"no\"},\n        },\n    },\n})\nprint(answer[\"answers\"])\n"
     },
     {
      "lang": "Shell",
      "label": "curl image",
      "source": "curl https://api.h2olightning.com/v1/systemone \\\n  -H \"Authorization: Bearer $LIGHTNING_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"h2o-lightning-4b\",\n    \"state\": \"Describe the colour of the attached image.\",\n    \"images\": [\n        \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAAT0lEQVR42u3PQQkAAAgEsEty/aMYywi+hcEKLNO+FgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQGBywLKp0DxvxLbjwAAAABJRU5ErkJggg==\"\n    ],\n    \"questions\": {\n        \"red\": {\n            \"type\": \"noul\",\n            \"instructions\": \"Is the image mostly red?\",\n            \"criteria\": {\"true\": \"yes\", \"false\": \"no\"}\n        }\n    }\n}'\n"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DecisionRequest"
       },
       "examples": {
        "systemone_text": {
         "summary": "Yes/no, choice and score questions about a text (default mode: aa)",
         "value": {
          "model": "h2o-lightning-4b",
          "state": "Ticket 4411: checkout has been down for all customers for 20 minutes; payments fail with HTTP 500.",
          "questions": {
           "urgent": {
            "type": "noul",
            "instructions": "Is this an urgent incident?",
            "criteria": {
             "true": "yes",
             "false": "no"
            }
           },
           "team": {
            "type": "choice",
            "instructions": "Which team should handle it?",
            "criteria": {
             "payments": "the payments team",
             "search": "the search team",
             "docs": "the documentation team"
            }
           },
           "severity": {
            "type": "score",
            "instructions": "How severe is it?",
            "criteria": [
             "minor",
             "moderate",
             "major",
             "critical"
            ]
           }
          }
         }
        },
        "systemone_jevbench": {
         "summary": "31B in jevbench mode, one-way reading, calibrated yes/no (floor off)",
         "value": {
          "model": "h2o-lightning-31b",
          "mode": "jevbench",
          "attention_mode": "causal",
          "state": "Ticket 4411: checkout has been down for all customers for 20 minutes; payments fail with HTTP 500.",
          "questions": {
           "urgent": {
            "type": "noul",
            "instructions": "Is this an urgent incident?",
            "criteria": {
             "true": "yes",
             "false": "no"
            }
           }
          },
          "kwargs": {
           "floor": {
            "apply": false
           }
          }
         }
        },
        "systemone_image": {
         "summary": "A question about an image (data URL in `images`)",
         "value": {
          "model": "h2o-lightning-4b",
          "state": "Describe the colour of the attached image.",
          "images": [
           "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAAT0lEQVR42u3PQQkAAAgEsEty/aMYywi+hcEKLNO+FgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQGBywLKp0DxvxLbjwAAAABJRU5ErkJggg=="
          ],
          "questions": {
           "red": {
            "type": "noul",
            "instructions": "Is the image mostly red?",
            "criteria": {
             "true": "yes",
             "false": "no"
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "systemone_text": {
          "summary": "Yes/no, choice and score questions about a text (default mode: aa)",
          "value": {
           "model": "h2o-lightning-4b",
           "answers": {
            "urgent": {
             "type": "noul",
             "noul": 0.9066414578639045
            },
            "team": {
             "type": "choice",
             "choice": "payments",
             "confidence": 0.9230620940795883,
             "probabilities": {
              "payments": 0.9487080627197256,
              "search": 0.026835871097157574,
              "docs": 0.02445606618311675
             }
            },
            "severity": {
             "type": "score",
             "score": 2.3984382188842748,
             "confidence": 0.49443401706658396,
             "legend": {
              "0": "minor",
              "1": "moderate",
              "2": "major",
              "3": "critical"
             },
             "probabilities": {
              "0": 0.006878851217107498,
              "1": 0.04324560519890929,
              "2": 0.49443401706658396,
              "3": 0.4554415265173992
             }
            }
           },
           "usage": {
            "input_tokens": 193,
            "output_tokens": 3,
            "reasoning_tokens": 0,
            "latency_ms": 413.8,
            "processed_input_tokens": 390
           },
           "probability_source": "native",
           "effort_used": {
            "tier": "fast",
            "passes_per_decision": 2,
            "staged": false,
            "reread": {
             "below": 0.8,
             "first_weight": 0.6667,
             "questions": 1,
             "input_tokens": 197
            },
            "idk": {
             "below": 0.8,
             "offered": 0,
             "questions": 0
            },
            "floor": {
             "value": 0.801,
             "moved": []
            },
            "mode": "aa",
            "mode_requested": "auto"
           },
           "attention_mode": "bidirectional"
          }
         },
         "systemone_jevbench": {
          "summary": "31B in jevbench mode, one-way reading, calibrated yes/no (floor off)",
          "value": {
           "model": "h2o-lightning-31b",
           "answers": {
            "urgent": {
             "type": "noul",
             "noul": 0.9998517418358653
            }
           },
           "usage": {
            "input_tokens": 104,
            "output_tokens": 1,
            "reasoning_tokens": 0,
            "latency_ms": 48.4
           },
           "probability_source": "native",
           "effort_used": {
            "tier": "fast",
            "passes_per_decision": 1,
            "staged": false,
            "floor": {
             "value": 0,
             "moved": []
            },
            "mode": "jevbench",
            "mode_requested": "jevbench"
           },
           "attention_mode": "causal"
          }
         },
         "systemone_image": {
          "summary": "A question about an image (data URL in `images`)",
          "value": {
           "model": "h2o-lightning-4b",
           "answers": {
            "red": {
             "type": "noul",
             "noul": 0.8985560810204162
            }
           },
           "usage": {
            "input_tokens": 147,
            "output_tokens": 1,
            "reasoning_tokens": 0,
            "latency_ms": 207.8,
            "images": 1
           },
           "probability_source": "native",
           "effort_used": {
            "tier": "fast",
            "passes_per_decision": 1,
            "staged": false,
            "reread": {
             "below": 0.8,
             "first_weight": 0.6667,
             "questions": 0,
             "input_tokens": 0
            },
            "idk": {
             "below": 0.8,
             "offered": 0,
             "questions": 0
            },
            "floor": {
             "value": 0.801,
             "moved": []
            },
            "mode": "aa",
            "mode_requested": "auto"
           },
           "attention_mode": "bidirectional"
          }
         }
        },
        "schema": {
         "$ref": "#/components/schemas/DecisionResponse"
        }
       }
      },
      "headers": {
       "x-lightning-region": {
        "$ref": "#/components/headers/x-lightning-region"
       },
       "x-lightning-backend": {
        "$ref": "#/components/headers/x-lightning-backend"
       },
       "x-lightning-region-state": {
        "$ref": "#/components/headers/x-lightning-region-state"
       },
       "x-ratelimit-api_key-remaining-requests": {
        "$ref": "#/components/headers/x-ratelimit-api_key-remaining-requests"
       },
       "x-ratelimit-api_key-remaining-tokens": {
        "$ref": "#/components/headers/x-ratelimit-api_key-remaining-tokens"
       },
       "x-litellm-response-cost": {
        "$ref": "#/components/headers/x-litellm-response-cost"
       }
      }
     },
     "400": {
      "description": "Invalid request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        },
        "examples": {
         "systemone_bad_mode": {
          "summary": "400: an unknown mode",
          "value": {
           "error": {
            "message": "litellm.BadRequestError: mode 'fast' is not one of ['auto', 'jevbench', 'decision_index', 'aa']",
            "type": "invalid_request_error",
            "param": null,
            "code": "400"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "No or wrong API key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        },
        "examples": {
         "systemone_no_key": {
          "summary": "401: no API key",
          "value": {
           "error": {
            "message": "Authentication Error, No api key passed in.",
            "type": "auth_error",
            "param": "None",
            "code": "401"
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Unknown model",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        },
        "examples": {
         "systemone_bad_model": {
          "summary": "404: an unknown model",
          "value": {
           "error": {
            "message": "The model `h2o-lightning-9b` does not exist",
            "type": "model_not_found",
            "param": "model",
            "code": "404"
           }
          }
         }
        }
       }
      }
     },
     "405": {
      "description": "Method not allowed (POST only)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        },
        "examples": {
         "systemone_get": {
          "summary": "405: a decision route takes POST only",
          "value": {
           "error": {
            "message": "This route takes POST only.",
            "type": "invalid_request_error",
            "code": "method_not_allowed"
           }
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Rate limited: see Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "Busy or down: retry after Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/decisions": {
   "post": {
    "operationId": "decisions",
    "tags": [
     "Decisions"
    ],
    "summary": "Decide (OpenAI-style wire)",
    "description": "The same models and answers with OpenAI-style shapes: `input` (a string or messages with `input_text` / `input_image` parts), a list of `predicate` / `choice` / `score` questions, answers as a list. Alias: `POST /decisions`.",
    "x-codeSamples": [
     {
      "lang": "Python",
      "label": "Python text",
      "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(base_url=\"https://api.h2olightning.com/v1\", api_key=os.environ[\"LIGHTNING_API_KEY\"])\n\n# not one of the SDK's typed methods: client.post sends this body as it is and returns the JSON answer\nanswer = client.post(\"/decisions\", cast_to=object, body={\n    \"model\": \"h2o-lightning-4b\",\n    \"input\": \"Ticket 4411: checkout has been down for all customers for 20 minutes; payments fail with HTTP 500.\",\n    \"questions\": [\n        {\"type\": \"predicate\", \"name\": \"urgent\", \"instructions\": \"Is this an urgent incident?\"},\n        {\n            \"type\": \"choice\",\n            \"name\": \"team\",\n            \"instructions\": \"Which team should handle it?\",\n            \"choices\": [\n                {\"value\": \"payments\", \"description\": \"the payments team\"},\n                {\"value\": \"search\", \"description\": \"the search team\"},\n                {\"value\": \"docs\", \"description\": \"the documentation team\"},\n            ],\n        },\n        {\n            \"type\": \"score\",\n            \"name\": \"severity\",\n            \"instructions\": \"How severe is it?\",\n            \"levels\": [{\"label\": \"minor\"}, {\"label\": \"moderate\"}, {\"label\": \"major\"}, {\"label\": \"critical\"}],\n        },\n    ],\n})\nprint(answer[\"answers\"])\n"
     },
     {
      "lang": "Shell",
      "label": "curl text",
      "source": "curl https://api.h2olightning.com/v1/decisions \\\n  -H \"Authorization: Bearer $LIGHTNING_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"h2o-lightning-4b\",\n    \"input\": \"Ticket 4411: checkout has been down for all customers for 20 minutes; payments fail with HTTP 500.\",\n    \"questions\": [\n        {\"type\": \"predicate\", \"name\": \"urgent\", \"instructions\": \"Is this an urgent incident?\"},\n        {\n            \"type\": \"choice\",\n            \"name\": \"team\",\n            \"instructions\": \"Which team should handle it?\",\n            \"choices\": [\n                {\"value\": \"payments\", \"description\": \"the payments team\"},\n                {\"value\": \"search\", \"description\": \"the search team\"},\n                {\"value\": \"docs\", \"description\": \"the documentation team\"}\n            ]\n        },\n        {\n            \"type\": \"score\",\n            \"name\": \"severity\",\n            \"instructions\": \"How severe is it?\",\n            \"levels\": [{\"label\": \"minor\"}, {\"label\": \"moderate\"}, {\"label\": \"major\"}, {\"label\": \"critical\"}]\n        }\n    ]\n}'\n"
     },
     {
      "lang": "Python",
      "label": "Python image",
      "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(base_url=\"https://api.h2olightning.com/v1\", api_key=os.environ[\"LIGHTNING_API_KEY\"])\n\n# not one of the SDK's typed methods: client.post sends this body as it is and returns the JSON answer\nanswer = client.post(\"/decisions\", cast_to=object, body={\n    \"model\": \"h2o-lightning-4b\",\n    \"input\": [\n        {\n            \"role\": \"user\",\n            \"type\": \"message\",\n            \"content\": [\n                {\"type\": \"input_text\", \"text\": \"Describe the colour of the attached image.\"},\n                {\n                    \"type\": \"input_image\",\n                    \"image_url\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAAT0lEQVR42u3PQQkAAAgEsEty/aMYywi+hcEKLNO+FgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQGBywLKp0DxvxLbjwAAAABJRU5ErkJggg==\",\n                },\n            ],\n        },\n    ],\n    \"questions\": [{\"type\": \"predicate\", \"name\": \"red\", \"instructions\": \"Is the image mostly red?\"}],\n})\nprint(answer[\"answers\"])\n"
     },
     {
      "lang": "Shell",
      "label": "curl image",
      "source": "curl https://api.h2olightning.com/v1/decisions \\\n  -H \"Authorization: Bearer $LIGHTNING_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"h2o-lightning-4b\",\n    \"input\": [\n        {\n            \"role\": \"user\",\n            \"type\": \"message\",\n            \"content\": [\n                {\"type\": \"input_text\", \"text\": \"Describe the colour of the attached image.\"},\n                {\n                    \"type\": \"input_image\",\n                    \"image_url\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAAT0lEQVR42u3PQQkAAAgEsEty/aMYywi+hcEKLNO+FgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQGBywLKp0DxvxLbjwAAAABJRU5ErkJggg==\"\n                }\n            ]\n        }\n    ],\n    \"questions\": [{\"type\": \"predicate\", \"name\": \"red\", \"instructions\": \"Is the image mostly red?\"}]\n}'\n"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/OpenAIDecisionRequest"
       },
       "examples": {
        "decisions_text": {
         "summary": "Predicate, choice and score questions (OpenAI-style shapes)",
         "value": {
          "model": "h2o-lightning-4b",
          "input": "Ticket 4411: checkout has been down for all customers for 20 minutes; payments fail with HTTP 500.",
          "questions": [
           {
            "type": "predicate",
            "name": "urgent",
            "instructions": "Is this an urgent incident?"
           },
           {
            "type": "choice",
            "name": "team",
            "instructions": "Which team should handle it?",
            "choices": [
             {
              "value": "payments",
              "description": "the payments team"
             },
             {
              "value": "search",
              "description": "the search team"
             },
             {
              "value": "docs",
              "description": "the documentation team"
             }
            ]
           },
           {
            "type": "score",
            "name": "severity",
            "instructions": "How severe is it?",
            "levels": [
             {
              "label": "minor"
             },
             {
              "label": "moderate"
             },
             {
              "label": "major"
             },
             {
              "label": "critical"
             }
            ]
           }
          ]
         }
        },
        "decisions_image": {
         "summary": "An image as an input_image part",
         "value": {
          "model": "h2o-lightning-4b",
          "input": [
           {
            "role": "user",
            "type": "message",
            "content": [
             {
              "type": "input_text",
              "text": "Describe the colour of the attached image."
             },
             {
              "type": "input_image",
              "image_url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAAT0lEQVR42u3PQQkAAAgEsEty/aMYywi+hcEKLNO+FgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQGBywLKp0DxvxLbjwAAAABJRU5ErkJggg=="
             }
            ]
           }
          ],
          "questions": [
           {
            "type": "predicate",
            "name": "red",
            "instructions": "Is the image mostly red?"
           }
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "decisions_text": {
          "summary": "Predicate, choice and score questions (OpenAI-style shapes)",
          "value": {
           "model": "h2o-lightning-4b",
           "answers": [
            {
             "type": "predicate",
             "name": "urgent",
             "probability": 0.9112839156896871
            },
            {
             "type": "choice",
             "name": "team",
             "choice": "payments",
             "probabilities": [
              {
               "value": "payments",
               "probability": 0.9487080627197256
              },
              {
               "value": "search",
               "probability": 0.026835871097157574
              },
              {
               "value": "docs",
               "probability": 0.02445606618311675
              }
             ],
             "confidence": 0.9230620940795883
            },
            {
             "type": "score",
             "name": "severity",
             "score": 2.3984382188842748,
             "probabilities": [
              {
               "value": 0,
               "label": "minor",
               "probability": 0.006878851217107498
              },
              {
               "value": 1,
               "label": "moderate",
               "probability": 0.04324560519890929
              },
              {
               "value": 2,
               "label": "major",
               "probability": 0.49443401706658396
              },
              {
               "value": 3,
               "label": "critical",
               "probability": 0.4554415265173992
              }
             ],
             "confidence": 0.49443401706658396
            }
           ],
           "usage": {
            "input_tokens": 197,
            "input_tokens_details": {
             "cached_tokens": 0,
             "cache_write_tokens": 0
            },
            "output_tokens": 3,
            "output_tokens_details": {
             "reasoning_tokens": 0
            },
            "total_tokens": 200
           },
           "effort_used": {
            "mode": "aa",
            "mode_requested": "auto",
            "floor": {
             "value": 0.801,
             "moved": []
            }
           }
          }
         },
         "decisions_image": {
          "summary": "An image as an input_image part",
          "value": {
           "model": "h2o-lightning-4b",
           "answers": [
            {
             "type": "predicate",
             "name": "red",
             "probability": 0.9055159335083867
            }
           ],
           "usage": {
            "input_tokens": 180,
            "input_tokens_details": {
             "cached_tokens": 0,
             "cache_write_tokens": 0
            },
            "output_tokens": 1,
            "output_tokens_details": {
             "reasoning_tokens": 0
            },
            "total_tokens": 181
           },
           "effort_used": {
            "mode": "aa",
            "mode_requested": "auto",
            "floor": {
             "value": 0.801,
             "moved": []
            }
           }
          }
         }
        },
        "schema": {
         "$ref": "#/components/schemas/OpenAIDecisionResponse"
        }
       }
      },
      "headers": {
       "x-lightning-region": {
        "$ref": "#/components/headers/x-lightning-region"
       },
       "x-lightning-backend": {
        "$ref": "#/components/headers/x-lightning-backend"
       },
       "x-lightning-region-state": {
        "$ref": "#/components/headers/x-lightning-region-state"
       },
       "x-ratelimit-api_key-remaining-requests": {
        "$ref": "#/components/headers/x-ratelimit-api_key-remaining-requests"
       },
       "x-ratelimit-api_key-remaining-tokens": {
        "$ref": "#/components/headers/x-ratelimit-api_key-remaining-tokens"
       },
       "x-litellm-response-cost": {
        "$ref": "#/components/headers/x-litellm-response-cost"
       }
      }
     },
     "400": {
      "description": "Invalid request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "No or wrong API key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limited: see Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "Busy or down: retry after Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/alpha/decisions": {
   "post": {
    "operationId": "alphaDecisions",
    "tags": [
     "Decisions"
    ],
    "summary": "Decide (OpenRouter wire)",
    "description": "OpenRouter's decisions wire: the native request; images are `image_url` parts inside `state`. The answer carries no `effort_used`.",
    "x-codeSamples": [
     {
      "lang": "Python",
      "label": "Python text",
      "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(base_url=\"https://api.h2olightning.com/v1\", api_key=os.environ[\"LIGHTNING_API_KEY\"])\n\n# not one of the SDK's typed methods: client.post sends this body as it is and returns the JSON answer\nanswer = client.post(\"https://api.h2olightning.com/api/alpha/decisions\", cast_to=object, body={\n    \"model\": \"h2o-lightning-31b\",\n    \"state\": \"Ticket 4411: checkout has been down for all customers for 20 minutes; payments fail with HTTP 500.\",\n    \"questions\": {\n        \"urgent\": {\n            \"type\": \"noul\",\n            \"instructions\": \"Is this an urgent incident?\",\n            \"criteria\": {\"true\": \"yes\", \"false\": \"no\"},\n        },\n    },\n})\nprint(answer[\"answers\"])\n"
     },
     {
      "lang": "Shell",
      "label": "curl text",
      "source": "curl https://api.h2olightning.com/api/alpha/decisions \\\n  -H \"Authorization: Bearer $LIGHTNING_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"h2o-lightning-31b\",\n    \"state\": \"Ticket 4411: checkout has been down for all customers for 20 minutes; payments fail with HTTP 500.\",\n    \"questions\": {\n        \"urgent\": {\n            \"type\": \"noul\",\n            \"instructions\": \"Is this an urgent incident?\",\n            \"criteria\": {\"true\": \"yes\", \"false\": \"no\"}\n        }\n    }\n}'\n"
     },
     {
      "lang": "Python",
      "label": "Python image",
      "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(base_url=\"https://api.h2olightning.com/v1\", api_key=os.environ[\"LIGHTNING_API_KEY\"])\n\n# not one of the SDK's typed methods: client.post sends this body as it is and returns the JSON answer\nanswer = client.post(\"https://api.h2olightning.com/api/alpha/decisions\", cast_to=object, body={\n    \"model\": \"h2o-lightning-4b\",\n    \"state\": [\n        \"Listing: a sticker.\",\n        {\n            \"type\": \"image_url\",\n            \"image_url\": {\n                \"url\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAAT0lEQVR42u3PQQkAAAgEsEty/aMYywi+hcEKLNO+FgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQGBywLKp0DxvxLbjwAAAABJRU5ErkJggg==\",\n            },\n        },\n    ],\n    \"questions\": {\n        \"red\": {\n            \"type\": \"noul\",\n            \"instructions\": \"Is the image mostly red?\",\n            \"criteria\": {\"true\": \"yes\", \"false\": \"no\"},\n        },\n    },\n})\nprint(answer[\"answers\"])\n"
     },
     {
      "lang": "Shell",
      "label": "curl image",
      "source": "curl https://api.h2olightning.com/api/alpha/decisions \\\n  -H \"Authorization: Bearer $LIGHTNING_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"h2o-lightning-4b\",\n    \"state\": [\n        \"Listing: a sticker.\",\n        {\n            \"type\": \"image_url\",\n            \"image_url\": {\n                \"url\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAAT0lEQVR42u3PQQkAAAgEsEty/aMYywi+hcEKLNO+FgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQGBywLKp0DxvxLbjwAAAABJRU5ErkJggg==\"\n            }\n        }\n    ],\n    \"questions\": {\n        \"red\": {\n            \"type\": \"noul\",\n            \"instructions\": \"Is the image mostly red?\",\n            \"criteria\": {\"true\": \"yes\", \"false\": \"no\"}\n        }\n    }\n}'\n"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DecisionRequest"
       },
       "examples": {
        "alpha_text": {
         "summary": "A yes/no question (OpenRouter wire)",
         "value": {
          "model": "h2o-lightning-31b",
          "state": "Ticket 4411: checkout has been down for all customers for 20 minutes; payments fail with HTTP 500.",
          "questions": {
           "urgent": {
            "type": "noul",
            "instructions": "Is this an urgent incident?",
            "criteria": {
             "true": "yes",
             "false": "no"
            }
           }
          }
         }
        },
        "alpha_image": {
         "summary": "An image as an image_url part inside `state`",
         "value": {
          "model": "h2o-lightning-4b",
          "state": [
           "Listing: a sticker.",
           {
            "type": "image_url",
            "image_url": {
             "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAAT0lEQVR42u3PQQkAAAgEsEty/aMYywi+hcEKLNO+FgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQGBywLKp0DxvxLbjwAAAABJRU5ErkJggg=="
            }
           }
          ],
          "questions": {
           "red": {
            "type": "noul",
            "instructions": "Is the image mostly red?",
            "criteria": {
             "true": "yes",
             "false": "no"
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "alpha_text": {
          "summary": "A yes/no question (OpenRouter wire)",
          "value": {
           "model": "h2o-lightning-31b",
           "answers": {
            "urgent": {
             "type": "noul",
             "noul": 0.9920079180494991
            }
           },
           "usage": {
            "input_tokens": 104,
            "output_tokens": 1
           },
           "id": "local-dec-ae1ea1d8e15d47349fb99cd51646586e",
           "provider": "H2O.ai"
          }
         },
         "alpha_image": {
          "summary": "An image as an image_url part inside `state`",
          "value": {
           "model": "h2o-lightning-4b",
           "answers": {
            "red": {
             "type": "noul",
             "noul": 0.9004069612319084
            }
           },
           "usage": {
            "input_tokens": 151,
            "output_tokens": 1
           },
           "id": "local-dec-a5a23aad19b84414b52b65e547ead15f",
           "provider": "H2O.ai"
          }
         }
        },
        "schema": {
         "$ref": "#/components/schemas/OpenRouterDecisionResponse"
        }
       }
      },
      "headers": {
       "x-lightning-region": {
        "$ref": "#/components/headers/x-lightning-region"
       },
       "x-lightning-backend": {
        "$ref": "#/components/headers/x-lightning-backend"
       },
       "x-lightning-region-state": {
        "$ref": "#/components/headers/x-lightning-region-state"
       },
       "x-ratelimit-api_key-remaining-requests": {
        "$ref": "#/components/headers/x-ratelimit-api_key-remaining-requests"
       },
       "x-ratelimit-api_key-remaining-tokens": {
        "$ref": "#/components/headers/x-ratelimit-api_key-remaining-tokens"
       },
       "x-litellm-response-cost": {
        "$ref": "#/components/headers/x-litellm-response-cost"
       }
      }
     },
     "400": {
      "description": "Invalid request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "No or wrong API key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limited: see Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "Busy or down: retry after Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/chat/completions": {
   "post": {
    "operationId": "chatCompletions",
    "tags": [
     "Foundation models"
    ],
    "summary": "Forecast or predict (OpenAI chat completions)",
    "description": "TimeH2O, TimeH2O-tiny and TabH2O through the standard chat-completions request. The data is the user message's text (JSON or CSV); the options are top-level fields (`extra_body`). For TimeH2O, rows at the end whose target is empty are the future (their count is the horizon); a column with values on those rows is a future covariate, otherwise a past covariate. For TabH2O, rows with an empty target are predicted and the rest are training rows.\n\nAccepted and ignored: `temperature`, `top_p`, `max_tokens`, `stop`, `response_format` (the content is always JSON), `user`, `metadata` and OpenRouter's routing fields. `n` must be 1.",
    "x-codeSamples": [
     {
      "lang": "Python",
      "label": "Python TimeH2O",
      "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(base_url=\"https://api.h2olightning.com/v1\", api_key=os.environ[\"LIGHTNING_API_KEY\"])\n\ncompletion = client.chat.completions.create(\n    model=\"h2oai/timeh2o-v1\",\n    messages=[{\"role\": \"user\", \"content\": \"[112,118,132,129,121,135,148,148,136,119,104,118,115,126,141,135,125,149,170,170,158,133,114,140]\"}],\n    extra_body={\"horizon\": 6, \"quantile_levels\": [0.1, 0.5, 0.9]},\n)\nprint(completion.choices[0].message.content)  # the result as JSON\nprint(completion.usage)\n"
     },
     {
      "lang": "Shell",
      "label": "curl TimeH2O",
      "source": "curl https://api.h2olightning.com/v1/chat/completions \\\n  -H \"Authorization: Bearer $LIGHTNING_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"h2oai/timeh2o-v1\",\n    \"messages\": [\n        {\n            \"role\": \"user\",\n            \"content\": \"[112,118,132,129,121,135,148,148,136,119,104,118,115,126,141,135,125,149,170,170,158,133,114,140]\"\n        }\n    ],\n    \"horizon\": 6,\n    \"quantile_levels\": [0.1, 0.5, 0.9]\n}'\n"
     },
     {
      "lang": "Python",
      "label": "Python TimeH2O-tiny CSV",
      "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(base_url=\"https://api.h2olightning.com/v1\", api_key=os.environ[\"LIGHTNING_API_KEY\"])\n\ncompletion = client.chat.completions.create(\n    model=\"h2oai/timeh2o-v1-tiny\",\n    messages=[{\"role\": \"user\", \"content\": \"month,sales\\n2026-01,10\\n2026-02,12\\n2026-03,11\\n2026-04,13\\n2026-05,12\\n2026-06,14\\n2026-07,\\n2026-08,\\n\"}],\n    extra_body={\"target\": \"sales\", \"timestamp_column\": \"month\"},\n)\nprint(completion.choices[0].message.content)  # the result as JSON\nprint(completion.usage)\n"
     },
     {
      "lang": "Shell",
      "label": "curl TimeH2O-tiny CSV",
      "source": "curl https://api.h2olightning.com/v1/chat/completions \\\n  -H \"Authorization: Bearer $LIGHTNING_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"h2oai/timeh2o-v1-tiny\",\n    \"messages\": [\n        {\n            \"role\": \"user\",\n            \"content\": \"month,sales\\n2026-01,10\\n2026-02,12\\n2026-03,11\\n2026-04,13\\n2026-05,12\\n2026-06,14\\n2026-07,\\n2026-08,\\n\"\n        }\n    ],\n    \"target\": \"sales\",\n    \"timestamp_column\": \"month\"\n}'\n"
     },
     {
      "lang": "Python",
      "label": "Python TabH2O classify",
      "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(base_url=\"https://api.h2olightning.com/v1\", api_key=os.environ[\"LIGHTNING_API_KEY\"])\n\ncompletion = client.chat.completions.create(\n    model=\"h2oai/tabh2o-v1.1\",\n    messages=[{\"role\": \"user\", \"content\": \"tenure,plan,churn\\n3,basic,yes\\n40,pro,no\\n2,basic,yes\\n36,pro,no\\n5,basic,yes\\n48,pro,no\\n4,pro,\\n44,basic,\\n\"}],\n    extra_body={\"task\": \"classify\", \"target\": \"churn\"},\n)\nprint(completion.choices[0].message.content)  # the result as JSON\nprint(completion.usage)\n"
     },
     {
      "lang": "Shell",
      "label": "curl TabH2O classify",
      "source": "curl https://api.h2olightning.com/v1/chat/completions \\\n  -H \"Authorization: Bearer $LIGHTNING_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"h2oai/tabh2o-v1.1\",\n    \"messages\": [\n        {\n            \"role\": \"user\",\n            \"content\": \"tenure,plan,churn\\n3,basic,yes\\n40,pro,no\\n2,basic,yes\\n36,pro,no\\n5,basic,yes\\n48,pro,no\\n4,pro,\\n44,basic,\\n\"\n        }\n    ],\n    \"task\": \"classify\",\n    \"target\": \"churn\"\n}'\n"
     },
     {
      "lang": "Python",
      "label": "Python TabH2O regress",
      "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(base_url=\"https://api.h2olightning.com/v1\", api_key=os.environ[\"LIGHTNING_API_KEY\"])\n\ncompletion = client.chat.completions.create(\n    model=\"h2oai/tabh2o-v1.1\",\n    messages=[{\"role\": \"user\", \"content\": \"[{\\\"x\\\":0,\\\"y\\\":1.0},{\\\"x\\\":1,\\\"y\\\":3.0},{\\\"x\\\":2,\\\"y\\\":5.0},{\\\"x\\\":3,\\\"y\\\":7.0},{\\\"x\\\":4,\\\"y\\\":9.0},{\\\"x\\\":5,\\\"y\\\":11.0},{\\\"x\\\":6,\\\"y\\\":13.0},{\\\"x\\\":7,\\\"y\\\":15.0},{\\\"x\\\":8,\\\"y\\\":17.0},{\\\"x\\\":9,\\\"y\\\":19.0},{\\\"x\\\":10,\\\"y\\\":21.0},{\\\"x\\\":11,\\\"y\\\":23.0},{\\\"x\\\":20,\\\"y\\\":null}]\"}],\n    extra_body={\"task\": \"regress\", \"target\": \"y\", \"quantile_levels\": [0.1, 0.9]},\n)\nprint(completion.choices[0].message.content)  # the result as JSON\nprint(completion.usage)\n"
     },
     {
      "lang": "Shell",
      "label": "curl TabH2O regress",
      "source": "curl https://api.h2olightning.com/v1/chat/completions \\\n  -H \"Authorization: Bearer $LIGHTNING_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"h2oai/tabh2o-v1.1\",\n    \"messages\": [\n        {\n            \"role\": \"user\",\n            \"content\": \"[{\\\"x\\\":0,\\\"y\\\":1.0},{\\\"x\\\":1,\\\"y\\\":3.0},{\\\"x\\\":2,\\\"y\\\":5.0},{\\\"x\\\":3,\\\"y\\\":7.0},{\\\"x\\\":4,\\\"y\\\":9.0},{\\\"x\\\":5,\\\"y\\\":11.0},{\\\"x\\\":6,\\\"y\\\":13.0},{\\\"x\\\":7,\\\"y\\\":15.0},{\\\"x\\\":8,\\\"y\\\":17.0},{\\\"x\\\":9,\\\"y\\\":19.0},{\\\"x\\\":10,\\\"y\\\":21.0},{\\\"x\\\":11,\\\"y\\\":23.0},{\\\"x\\\":20,\\\"y\\\":null}]\"\n        }\n    ],\n    \"task\": \"regress\",\n    \"target\": \"y\",\n    \"quantile_levels\": [0.1, 0.9]\n}'\n"
     },
     {
      "lang": "Python",
      "label": "Python stream",
      "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(base_url=\"https://api.h2olightning.com/v1\", api_key=os.environ[\"LIGHTNING_API_KEY\"])\n\nstream = client.chat.completions.create(\n    model=\"h2oai/timeh2o-v1\",\n    messages=[{\"role\": \"user\", \"content\": \"[112,118,132,129,121,135,148,148,136,119,104,118]\"}],\n    stream=True,\n    extra_body={\"horizon\": 2},\n)\nfor chunk in stream:\n    if chunk.choices and chunk.choices[0].delta.content:\n        print(chunk.choices[0].delta.content)\n"
     },
     {
      "lang": "Shell",
      "label": "curl stream",
      "source": "curl -N https://api.h2olightning.com/v1/chat/completions \\\n  -H \"Authorization: Bearer $LIGHTNING_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"h2oai/timeh2o-v1\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"[112,118,132,129,121,135,148,148,136,119,104,118]\"}],\n    \"stream\": true,\n    \"horizon\": 2\n}'\n"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/FMChatRequest"
       },
       "examples": {
        "chat_timeh2o": {
         "summary": "TimeH2O: a JSON array of numbers, horizon and quantiles as options",
         "value": {
          "model": "h2oai/timeh2o-v1",
          "messages": [
           {
            "role": "user",
            "content": "[112,118,132,129,121,135,148,148,136,119,104,118,115,126,141,135,125,149,170,170,158,133,114,140]"
           }
          ],
          "horizon": 6,
          "quantile_levels": [
           0.1,
           0.5,
           0.9
          ]
         }
        },
        "chat_timeh2o_tiny_csv": {
         "summary": "TimeH2O-tiny: CSV; the rows with an empty target are the future",
         "value": {
          "model": "h2oai/timeh2o-v1-tiny",
          "messages": [
           {
            "role": "user",
            "content": "month,sales\n2026-01,10\n2026-02,12\n2026-03,11\n2026-04,13\n2026-05,12\n2026-06,14\n2026-07,\n2026-08,\n"
           }
          ],
          "target": "sales",
          "timestamp_column": "month"
         }
        },
        "chat_tabh2o_classify": {
         "summary": "TabH2O classify: CSV; rows with an empty target are predicted",
         "value": {
          "model": "h2oai/tabh2o-v1.1",
          "messages": [
           {
            "role": "user",
            "content": "tenure,plan,churn\n3,basic,yes\n40,pro,no\n2,basic,yes\n36,pro,no\n5,basic,yes\n48,pro,no\n4,pro,\n44,basic,\n"
           }
          ],
          "task": "classify",
          "target": "churn"
         }
        },
        "chat_tabh2o_regress": {
         "summary": "TabH2O regress: JSON records",
         "value": {
          "model": "h2oai/tabh2o-v1.1",
          "messages": [
           {
            "role": "user",
            "content": "[{\"x\":0,\"y\":1.0},{\"x\":1,\"y\":3.0},{\"x\":2,\"y\":5.0},{\"x\":3,\"y\":7.0},{\"x\":4,\"y\":9.0},{\"x\":5,\"y\":11.0},{\"x\":6,\"y\":13.0},{\"x\":7,\"y\":15.0},{\"x\":8,\"y\":17.0},{\"x\":9,\"y\":19.0},{\"x\":10,\"y\":21.0},{\"x\":11,\"y\":23.0},{\"x\":20,\"y\":null}]"
           }
          ],
          "task": "regress",
          "target": "y",
          "quantile_levels": [
           0.1,
           0.9
          ]
         }
        },
        "chat_stream": {
         "summary": "Streaming (server-sent events)",
         "value": {
          "model": "h2oai/timeh2o-v1",
          "messages": [
           {
            "role": "user",
            "content": "[112,118,132,129,121,135,148,148,136,119,104,118]"
           }
          ],
          "stream": true,
          "horizon": 2
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "chat_timeh2o": {
          "summary": "TimeH2O: a JSON array of numbers, horizon and quantiles as options",
          "value": {
           "id": "chatcmpl-be30490f0d1343ef87efaddbce87525b",
           "created": 1795131165,
           "model": "h2oai/timeh2o-v1",
           "system_fingerprint": null,
           "object": "chat.completion",
           "choices": [
            {
             "index": 0,
             "message": {
              "role": "assistant",
              "content": "{\"object\":\"forecast\",\"quantile_levels\":[0.1,0.5,0.9],\"forecasts\":[{\"id\":null,\"median\":[137.80270385742188,148.8286590576172,163.7647705078125,157.91184997558594,144.71505737304688,168.00096130371094],\"mean\":[137.87783813476562,149.02517700195312,163.6710205078125,158.0780487060547,145.38739013671875,167.87962341308594],\"quantiles\":{\"0.1\":[126.54441833496094,133.69256591796875,143.35975646972656,137.59617614746094,125.62403869628906,141.94747924804688],\"0.5\":[137.80270385742188,148.8286590576172,163.7647705078125,157.91184997558594,144.71505737304688,168.00096130371094],\"0.9\":[149.67645263671875,164.96104431152344,183.92218017578125,179.13502502441406,167.33201599121094,193.7467498779297]}}]}",
              "refusal": null
             },
             "logprobs": null,
             "finish_reason": "stop"
            }
           ],
           "usage": {
            "prompt_tokens": 24,
            "completion_tokens": 30,
            "total_tokens": 54,
            "cost": 3.5999999999999994e-05
           }
          }
         },
         "chat_timeh2o_tiny_csv": {
          "summary": "TimeH2O-tiny: CSV; the rows with an empty target are the future",
          "value": {
           "id": "chatcmpl-fb886a4db51e4578a5b9b024773b1661",
           "created": 1795131166,
           "model": "h2oai/timeh2o-v1-tiny",
           "system_fingerprint": null,
           "object": "chat.completion",
           "choices": [
            {
             "index": 0,
             "message": {
              "role": "assistant",
              "content": "{\"object\":\"forecast\",\"quantile_levels\":[0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9],\"forecasts\":[{\"id\":null,\"median\":[13.146289825439453,13.240236282348633],\"mean\":[13.073140144348145,13.198846817016602],\"quantiles\":{\"0.1\":[9.913193702697754,9.485036849975586],\"0.2\":[11.401494026184082,11.193671226501465],\"0.3\":[12.096541404724121,12.008825302124023],\"0.4\":[12.643290519714355,12.64444637298584],\"0.5\":[13.146289825439453,13.240236282348633],\"0.6\":[13.650630950927734,13.843822479248047],\"0.7\":[14.164203643798828,14.483771324157715],\"0.8\":[14.794937133789062,15.256973266601562],\"0.9\":[15.976141929626465,16.726112365722656]}}]}",
              "refusal": null
             },
             "logprobs": null,
             "finish_reason": "stop"
            }
           ],
           "usage": {
            "prompt_tokens": 6,
            "completion_tokens": 22,
            "total_tokens": 28,
            "cost": 2.3200000000000002e-06
           }
          }
         },
         "chat_tabh2o_classify": {
          "summary": "TabH2O classify: CSV; rows with an empty target are predicted",
          "value": {
           "id": "chatcmpl-6f83737a4e8c4ead983bd3b491f32abe",
           "created": 1795131166,
           "model": "h2oai/tabh2o-v1.1",
           "system_fingerprint": null,
           "object": "chat.completion",
           "choices": [
            {
             "index": 0,
             "message": {
              "role": "assistant",
              "content": "{\"object\":\"tabular.classify\",\"classes\":[\"no\",\"yes\"],\"labels\":[\"no\",\"no\"],\"probabilities\":[[0.5264602303504944,0.473539799451828],[0.5087390542030334,0.49126094579696655]]}",
              "refusal": null
             },
             "logprobs": null,
             "finish_reason": "stop"
            }
           ],
           "usage": {
            "prompt_tokens": 22,
            "completion_tokens": 6,
            "total_tokens": 28,
            "cost": 4.6e-06
           }
          }
         },
         "chat_tabh2o_regress": {
          "summary": "TabH2O regress: JSON records",
          "value": {
           "id": "chatcmpl-b866bb8e146748bc92e4d312b967f4ce",
           "created": 1795131167,
           "model": "h2oai/tabh2o-v1.1",
           "system_fingerprint": null,
           "object": "chat.completion",
           "choices": [
            {
             "index": 0,
             "message": {
              "role": "assistant",
              "content": "{\"object\":\"tabular.regress\",\"mean\":[28.313365936279297],\"median\":[27.668684005737305],\"quantile_levels\":[0.1,0.9],\"quantiles\":{\"0.1\":[5.097002029418945],\"0.9\":[51.734161376953125]}}",
              "refusal": null
             },
             "logprobs": null,
             "finish_reason": "stop"
            }
           ],
           "usage": {
            "prompt_tokens": 25,
            "completion_tokens": 4,
            "total_tokens": 29,
            "cost": 4.1000000000000006e-06
           }
          }
         }
        },
        "schema": {
         "$ref": "#/components/schemas/ChatCompletion"
        }
       },
       "text/event-stream": {
        "schema": {
         "type": "string"
        },
        "examples": {
         "chat_stream": {
          "summary": "Streaming (server-sent events)",
          "value": "data: {\"id\":\"chatcmpl-f8f7f0b8811b48879942d8a1e77663b2\",\"created\":1795131168,\"model\":\"h2oai/timeh2o-v1\",\"system_fingerprint\":null,\"object\":\"chat.completion.chunk\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":\"{\\\"object\\\":\\\"forecast\\\",\\\"quantile_levels\\\":[0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9],\\\"forecasts\\\":[{\\\"id\\\":null,\\\"median\\\":[124.67298126220703,124.45977783203125],\\\"mean\\\":[124.45549774169922,124.57555389404297],\\\"quantiles\\\":{\\\"0.1\\\":[106.13786315917969,98.777099609375],\\\"0.2\\\":[113.3333511352539,108.48944091796875],\\\"0.3\\\":[117.73545837402344,114.61509704589844],\\\"0.4\\\":[121.39736938476562,119.75890350341797],\\\"0.5\\\":[124.67298126220703,124.45977783203125],\\\"0.6\\\":[127.88741302490234,129.16128540039062],\\\"0.7\\\":[131.41802978515625,134.47598266601562],\\\"0.8\\\":[135.57687377929688,140.839599609375],\\\"0.9\\\":[142.21780395507812,150.52647399902344]}}]}\"},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-f8f7f0b8811b48879942d8a1e77663b2\",\"created\":1795131168,\"model\":\"h2oai/timeh2o-v1\",\"system_fingerprint\":null,\"object\":\"chat.completion.chunk\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: {\"id\":\"chatcmpl-f8f7f0b8811b48879942d8a1e77663b2\",\"created\":1795131168,\"model\":\"h2oai/timeh2o-v1\",\"system_fingerprint\":null,\"object\":\"chat.completion.chunk\",\"choices\":[],\"usage\":{\"prompt_tokens\":12,\"completion_tokens\":22,\"total_tokens\":34,\"cost\":2.4999999999999998e-05}}\n\ndata: [DONE]\n\n"
         }
        }
       }
      },
      "headers": {
       "x-lightning-region": {
        "$ref": "#/components/headers/x-lightning-region"
       },
       "x-lightning-backend": {
        "$ref": "#/components/headers/x-lightning-backend"
       },
       "x-lightning-region-state": {
        "$ref": "#/components/headers/x-lightning-region-state"
       },
       "x-ratelimit-api_key-remaining-requests": {
        "$ref": "#/components/headers/x-ratelimit-api_key-remaining-requests"
       },
       "x-ratelimit-api_key-remaining-tokens": {
        "$ref": "#/components/headers/x-ratelimit-api_key-remaining-tokens"
       },
       "x-litellm-response-cost": {
        "$ref": "#/components/headers/x-litellm-response-cost"
       }
      }
     },
     "400": {
      "description": "Invalid request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        },
        "examples": {
         "chat_image_refused": {
          "summary": "400: image parts are not accepted (send the data as text)",
          "value": {
           "error": {
            "message": "litellm.BadRequestError: Invalid chat request: messages[0].content[1]: image parts are not accepted; these models take data: send it as JSON or CSV text",
            "type": "invalid_request_error",
            "param": null,
            "code": "400"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "No or wrong API key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limited: see Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "Busy or down: retry after Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/forecasts": {
   "post": {
    "operationId": "forecasts",
    "tags": [
     "Foundation models (native routes)"
    ],
    "summary": "Forecast",
    "description": "Up to 256 series, horizon up to 1,024, history up to 16,384 steps (older steps are dropped), 32 covariates, 4M points per request. TimeH2O-tiny takes no covariates.",
    "x-codeSamples": [
     {
      "lang": "Python",
      "label": "Python",
      "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(base_url=\"https://api.h2olightning.com/v1\", api_key=os.environ[\"LIGHTNING_API_KEY\"])\n\n# not one of the SDK's typed methods: client.post sends this body as it is and returns the JSON answer\nanswer = client.post(\"/forecasts\", cast_to=object, body={\n    \"model\": \"h2oai/timeh2o-v1\",\n    \"horizon\": 3,\n    \"quantile_levels\": [0.1, 0.5, 0.9],\n    \"series\": [{\"id\": \"store-1\", \"target\": [112, 118, 132, 129, 121, 135, 148, 148, 136, 119, 104, 118]}],\n})\nprint(answer)\n"
     },
     {
      "lang": "Shell",
      "label": "curl",
      "source": "curl https://api.h2olightning.com/v1/forecasts \\\n  -H \"Authorization: Bearer $LIGHTNING_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"h2oai/timeh2o-v1\",\n    \"horizon\": 3,\n    \"quantile_levels\": [0.1, 0.5, 0.9],\n    \"series\": [{\"id\": \"store-1\", \"target\": [112, 118, 132, 129, 121, 135, 148, 148, 136, 119, 104, 118]}]\n}'\n"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ForecastRequest"
       },
       "examples": {
        "forecasts": {
         "summary": "One series, 3 steps ahead",
         "value": {
          "model": "h2oai/timeh2o-v1",
          "horizon": 3,
          "quantile_levels": [
           0.1,
           0.5,
           0.9
          ],
          "series": [
           {
            "id": "store-1",
            "target": [
             112,
             118,
             132,
             129,
             121,
             135,
             148,
             148,
             136,
             119,
             104,
             118
            ]
           }
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "forecasts": {
          "summary": "One series, 3 steps ahead",
          "value": {
           "id": "fm-b6a67a64bf9a4b8992cda618056a0ec9",
           "created": 1795131168,
           "object": "forecast",
           "model": "h2oai/timeh2o-v1",
           "quantile_levels": [
            0.1,
            0.5,
            0.9
           ],
           "forecasts": [
            {
             "id": "store-1",
             "median": [
              124.67298126220703,
              124.45977783203125,
              123.88967895507812
             ],
             "mean": [
              124.45549774169922,
              124.57555389404297,
              124.16825866699219
             ],
             "quantiles": {
              "0.1": [
               106.13786315917969,
               98.77709197998047,
               95.34930419921875
              ],
              "0.5": [
               124.67298126220703,
               124.45977783203125,
               123.88967895507812
              ],
              "0.9": [
               142.21780395507812,
               150.52647399902344,
               153.36331176757812
              ]
             }
            }
           ],
           "usage": {
            "input_points": 12,
            "output_points": 15,
            "cost": 1.7999999999999997e-05
           }
          }
         }
        },
        "schema": {
         "$ref": "#/components/schemas/ForecastResponse"
        }
       }
      },
      "headers": {
       "x-lightning-region": {
        "$ref": "#/components/headers/x-lightning-region"
       },
       "x-lightning-backend": {
        "$ref": "#/components/headers/x-lightning-backend"
       },
       "x-lightning-region-state": {
        "$ref": "#/components/headers/x-lightning-region-state"
       },
       "x-ratelimit-api_key-remaining-requests": {
        "$ref": "#/components/headers/x-ratelimit-api_key-remaining-requests"
       },
       "x-ratelimit-api_key-remaining-tokens": {
        "$ref": "#/components/headers/x-ratelimit-api_key-remaining-tokens"
       },
       "x-litellm-response-cost": {
        "$ref": "#/components/headers/x-litellm-response-cost"
       }
      }
     },
     "400": {
      "description": "Invalid request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        },
        "examples": {
         "forecasts_bad_horizon": {
          "summary": "400: the refusal names the field",
          "value": {
           "error": {
            "message": "litellm.BadRequestError: Invalid forecast request: horizon: Input should be greater than or equal to 1",
            "type": "invalid_request_error",
            "param": null,
            "code": "400"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "No or wrong API key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limited: see Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "Busy or down: retry after Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/tabular/classify": {
   "post": {
    "operationId": "tabularClassify",
    "tags": [
     "Foundation models (native routes)"
    ],
    "summary": "Classify table rows",
    "description": "Up to 10,000 training and 10,000 test rows, 500 columns, 1M cells, 100 classes.",
    "x-codeSamples": [
     {
      "lang": "Python",
      "label": "Python",
      "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(base_url=\"https://api.h2olightning.com/v1\", api_key=os.environ[\"LIGHTNING_API_KEY\"])\n\n# not one of the SDK's typed methods: client.post sends this body as it is and returns the JSON answer\nanswer = client.post(\"/tabular/classify\", cast_to=object, body={\n    \"model\": \"h2oai/tabh2o-v1.1\",\n    \"columns\": [\"tenure\", \"plan\"],\n    \"train\": {\n        \"rows\": [[3, \"basic\"], [40, \"pro\"], [2, \"basic\"], [36, \"pro\"], [5, \"basic\"], [48, \"pro\"]],\n        \"target\": [\"yes\", \"no\", \"yes\", \"no\", \"yes\", \"no\"],\n    },\n    \"test\": {\"rows\": [[4, \"pro\"], [44, \"basic\"]]},\n})\nprint(answer)\n"
     },
     {
      "lang": "Shell",
      "label": "curl",
      "source": "curl https://api.h2olightning.com/v1/tabular/classify \\\n  -H \"Authorization: Bearer $LIGHTNING_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"h2oai/tabh2o-v1.1\",\n    \"columns\": [\"tenure\", \"plan\"],\n    \"train\": {\n        \"rows\": [[3, \"basic\"], [40, \"pro\"], [2, \"basic\"], [36, \"pro\"], [5, \"basic\"], [48, \"pro\"]],\n        \"target\": [\"yes\", \"no\", \"yes\", \"no\", \"yes\", \"no\"]\n    },\n    \"test\": {\"rows\": [[4, \"pro\"], [44, \"basic\"]]}\n}'\n"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TabularRequest"
       },
       "examples": {
        "classify": {
         "summary": "Classify two rows from six training rows",
         "value": {
          "model": "h2oai/tabh2o-v1.1",
          "columns": [
           "tenure",
           "plan"
          ],
          "train": {
           "rows": [
            [
             3,
             "basic"
            ],
            [
             40,
             "pro"
            ],
            [
             2,
             "basic"
            ],
            [
             36,
             "pro"
            ],
            [
             5,
             "basic"
            ],
            [
             48,
             "pro"
            ]
           ],
           "target": [
            "yes",
            "no",
            "yes",
            "no",
            "yes",
            "no"
           ]
          },
          "test": {
           "rows": [
            [
             4,
             "pro"
            ],
            [
             44,
             "basic"
            ]
           ]
          }
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "classify": {
          "summary": "Classify two rows from six training rows",
          "value": {
           "id": "fm-d4e7adb21e6a435e85128b4690127177",
           "created": 1795131169,
           "object": "tabular.classify",
           "model": "h2oai/tabh2o-v1.1",
           "classes": [
            "no",
            "yes"
           ],
           "labels": [
            "no",
            "no"
           ],
           "probabilities": [
            [
             0.5264602303504944,
             0.473539799451828
            ],
            [
             0.5087390542030334,
             0.49126094579696655
            ]
           ],
           "usage": {
            "input_cells": 22,
            "output_values": 6,
            "cost": 4.6e-06
           }
          }
         }
        },
        "schema": {
         "$ref": "#/components/schemas/TabularResponse"
        }
       }
      },
      "headers": {
       "x-lightning-region": {
        "$ref": "#/components/headers/x-lightning-region"
       },
       "x-lightning-backend": {
        "$ref": "#/components/headers/x-lightning-backend"
       },
       "x-lightning-region-state": {
        "$ref": "#/components/headers/x-lightning-region-state"
       },
       "x-ratelimit-api_key-remaining-requests": {
        "$ref": "#/components/headers/x-ratelimit-api_key-remaining-requests"
       },
       "x-ratelimit-api_key-remaining-tokens": {
        "$ref": "#/components/headers/x-ratelimit-api_key-remaining-tokens"
       },
       "x-litellm-response-cost": {
        "$ref": "#/components/headers/x-litellm-response-cost"
       }
      }
     },
     "400": {
      "description": "Invalid request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "No or wrong API key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limited: see Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "Busy or down: retry after Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/tabular/regress": {
   "post": {
    "operationId": "tabularRegress",
    "tags": [
     "Foundation models (native routes)"
    ],
    "summary": "Regress table rows",
    "description": "Same limits as classify; `quantile_levels` gives prediction intervals.",
    "x-codeSamples": [
     {
      "lang": "Python",
      "label": "Python",
      "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(base_url=\"https://api.h2olightning.com/v1\", api_key=os.environ[\"LIGHTNING_API_KEY\"])\n\n# not one of the SDK's typed methods: client.post sends this body as it is and returns the JSON answer\nanswer = client.post(\"/tabular/regress\", cast_to=object, body={\n    \"model\": \"h2oai/tabh2o-v1.1\",\n    \"columns\": [\"x\"],\n    \"train\": {\n        \"rows\": [[0], [1], [2], [3], [4], [5], [6], [7]],\n        \"target\": [1.0, 3.0, 5.0, 7.0, 9.0, 11.0, 13.0, 15.0],\n    },\n    \"test\": {\"rows\": [[10]]},\n    \"quantile_levels\": [0.1, 0.9],\n})\nprint(answer)\n"
     },
     {
      "lang": "Shell",
      "label": "curl",
      "source": "curl https://api.h2olightning.com/v1/tabular/regress \\\n  -H \"Authorization: Bearer $LIGHTNING_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"h2oai/tabh2o-v1.1\",\n    \"columns\": [\"x\"],\n    \"train\": {\n        \"rows\": [[0], [1], [2], [3], [4], [5], [6], [7]],\n        \"target\": [1.0, 3.0, 5.0, 7.0, 9.0, 11.0, 13.0, 15.0]\n    },\n    \"test\": {\"rows\": [[10]]},\n    \"quantile_levels\": [0.1, 0.9]\n}'\n"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TabularRequest"
       },
       "examples": {
        "regress": {
         "summary": "Regress one row with 10% / 90% quantiles",
         "value": {
          "model": "h2oai/tabh2o-v1.1",
          "columns": [
           "x"
          ],
          "train": {
           "rows": [
            [
             0
            ],
            [
             1
            ],
            [
             2
            ],
            [
             3
            ],
            [
             4
            ],
            [
             5
            ],
            [
             6
            ],
            [
             7
            ]
           ],
           "target": [
            1.0,
            3.0,
            5.0,
            7.0,
            9.0,
            11.0,
            13.0,
            15.0
           ]
          },
          "test": {
           "rows": [
            [
             10
            ]
           ]
          },
          "quantile_levels": [
           0.1,
           0.9
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "regress": {
          "summary": "Regress one row with 10% / 90% quantiles",
          "value": {
           "id": "fm-3def3c19882941e48b9888777f6bd616",
           "created": 1795131170,
           "object": "tabular.regress",
           "model": "h2oai/tabh2o-v1.1",
           "mean": [
            14.020218849182129
           ],
           "median": [
            14.712656021118164
           ],
           "quantile_levels": [
            0.1,
            0.9
           ],
           "quantiles": {
            "0.1": [
             4.27066707611084
            ],
            "0.9": [
             22.54140853881836
            ]
           },
           "usage": {
            "input_cells": 17,
            "output_values": 4,
            "cost": 3.3000000000000006e-06
           }
          }
         }
        },
        "schema": {
         "$ref": "#/components/schemas/TabularResponse"
        }
       }
      },
      "headers": {
       "x-lightning-region": {
        "$ref": "#/components/headers/x-lightning-region"
       },
       "x-lightning-backend": {
        "$ref": "#/components/headers/x-lightning-backend"
       },
       "x-lightning-region-state": {
        "$ref": "#/components/headers/x-lightning-region-state"
       },
       "x-ratelimit-api_key-remaining-requests": {
        "$ref": "#/components/headers/x-ratelimit-api_key-remaining-requests"
       },
       "x-ratelimit-api_key-remaining-tokens": {
        "$ref": "#/components/headers/x-ratelimit-api_key-remaining-tokens"
       },
       "x-litellm-response-cost": {
        "$ref": "#/components/headers/x-litellm-response-cost"
       }
      }
     },
     "400": {
      "description": "Invalid request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "No or wrong API key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limited: see Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "Busy or down: retry after Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/alpha/forecasts": {
   "post": {
    "operationId": "alphaForecasts",
    "tags": [
     "Foundation models (native routes)"
    ],
    "summary": "Forecast (OpenRouter wire)",
    "description": "The `/v1/forecasts` body; usage also as prompt/completion tokens.",
    "x-codeSamples": [
     {
      "lang": "Python",
      "label": "Python",
      "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(base_url=\"https://api.h2olightning.com/v1\", api_key=os.environ[\"LIGHTNING_API_KEY\"])\n\n# not one of the SDK's typed methods: client.post sends this body as it is and returns the JSON answer\nanswer = client.post(\"https://api.h2olightning.com/api/alpha/forecasts\", cast_to=object, body={\n    \"model\": \"h2oai/timeh2o-v1\",\n    \"horizon\": 3,\n    \"quantile_levels\": [0.1, 0.5, 0.9],\n    \"series\": [{\"id\": \"store-1\", \"target\": [112, 118, 132, 129, 121, 135, 148, 148, 136, 119, 104, 118]}],\n})\nprint(answer)\n"
     },
     {
      "lang": "Shell",
      "label": "curl",
      "source": "curl https://api.h2olightning.com/api/alpha/forecasts \\\n  -H \"Authorization: Bearer $LIGHTNING_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"h2oai/timeh2o-v1\",\n    \"horizon\": 3,\n    \"quantile_levels\": [0.1, 0.5, 0.9],\n    \"series\": [{\"id\": \"store-1\", \"target\": [112, 118, 132, 129, 121, 135, 148, 148, 136, 119, 104, 118]}]\n}'\n"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ForecastRequest"
       },
       "examples": {
        "alpha_forecasts": {
         "summary": "One series (OpenRouter wire: usage also as tokens)",
         "value": {
          "model": "h2oai/timeh2o-v1",
          "horizon": 3,
          "quantile_levels": [
           0.1,
           0.5,
           0.9
          ],
          "series": [
           {
            "id": "store-1",
            "target": [
             112,
             118,
             132,
             129,
             121,
             135,
             148,
             148,
             136,
             119,
             104,
             118
            ]
           }
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "alpha_forecasts": {
          "summary": "One series (OpenRouter wire: usage also as tokens)",
          "value": {
           "id": "fm-a3ceead015cd4b57b0297992ffdcf26a",
           "created": 1795131170,
           "object": "forecast",
           "model": "h2oai/timeh2o-v1",
           "quantile_levels": [
            0.1,
            0.5,
            0.9
           ],
           "forecasts": [
            {
             "id": "store-1",
             "median": [
              124.67298126220703,
              124.45977783203125,
              123.88967895507812
             ],
             "mean": [
              124.45549774169922,
              124.57555389404297,
              124.16825866699219
             ],
             "quantiles": {
              "0.1": [
               106.13786315917969,
               98.77709197998047,
               95.34930419921875
              ],
              "0.5": [
               124.67298126220703,
               124.45977783203125,
               123.88967895507812
              ],
              "0.9": [
               142.21780395507812,
               150.52647399902344,
               153.36331176757812
              ]
             }
            }
           ],
           "usage": {
            "prompt_tokens": 12,
            "completion_tokens": 15,
            "total_tokens": 27,
            "input_points": 12,
            "output_points": 15,
            "cost": 1.7999999999999997e-05
           }
          }
         }
        },
        "schema": {
         "$ref": "#/components/schemas/ForecastResponse"
        }
       }
      },
      "headers": {
       "x-lightning-region": {
        "$ref": "#/components/headers/x-lightning-region"
       },
       "x-lightning-backend": {
        "$ref": "#/components/headers/x-lightning-backend"
       },
       "x-lightning-region-state": {
        "$ref": "#/components/headers/x-lightning-region-state"
       },
       "x-ratelimit-api_key-remaining-requests": {
        "$ref": "#/components/headers/x-ratelimit-api_key-remaining-requests"
       },
       "x-ratelimit-api_key-remaining-tokens": {
        "$ref": "#/components/headers/x-ratelimit-api_key-remaining-tokens"
       },
       "x-litellm-response-cost": {
        "$ref": "#/components/headers/x-litellm-response-cost"
       }
      }
     },
     "400": {
      "description": "Invalid request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "No or wrong API key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limited: see Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "Busy or down: retry after Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/alpha/tabular": {
   "post": {
    "operationId": "alphaTabular",
    "tags": [
     "Foundation models (native routes)"
    ],
    "summary": "Classify or regress (OpenRouter wire)",
    "description": "The `/v1/tabular/*` body with `task` (`classify` or `regress`).",
    "x-codeSamples": [
     {
      "lang": "Python",
      "label": "Python",
      "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(base_url=\"https://api.h2olightning.com/v1\", api_key=os.environ[\"LIGHTNING_API_KEY\"])\n\n# not one of the SDK's typed methods: client.post sends this body as it is and returns the JSON answer\nanswer = client.post(\"https://api.h2olightning.com/api/alpha/tabular\", cast_to=object, body={\n    \"model\": \"h2oai/tabh2o-v1.1\",\n    \"columns\": [\"tenure\", \"plan\"],\n    \"train\": {\n        \"rows\": [[3, \"basic\"], [40, \"pro\"], [2, \"basic\"], [36, \"pro\"], [5, \"basic\"], [48, \"pro\"]],\n        \"target\": [\"yes\", \"no\", \"yes\", \"no\", \"yes\", \"no\"],\n    },\n    \"test\": {\"rows\": [[4, \"pro\"], [44, \"basic\"]]},\n    \"task\": \"classify\",\n})\nprint(answer)\n"
     },
     {
      "lang": "Shell",
      "label": "curl",
      "source": "curl https://api.h2olightning.com/api/alpha/tabular \\\n  -H \"Authorization: Bearer $LIGHTNING_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"h2oai/tabh2o-v1.1\",\n    \"columns\": [\"tenure\", \"plan\"],\n    \"train\": {\n        \"rows\": [[3, \"basic\"], [40, \"pro\"], [2, \"basic\"], [36, \"pro\"], [5, \"basic\"], [48, \"pro\"]],\n        \"target\": [\"yes\", \"no\", \"yes\", \"no\", \"yes\", \"no\"]\n    },\n    \"test\": {\"rows\": [[4, \"pro\"], [44, \"basic\"]]},\n    \"task\": \"classify\"\n}'\n"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AlphaTabularRequest"
       },
       "examples": {
        "alpha_tabular": {
         "summary": "Classify (OpenRouter wire: `task` in the body)",
         "value": {
          "model": "h2oai/tabh2o-v1.1",
          "columns": [
           "tenure",
           "plan"
          ],
          "train": {
           "rows": [
            [
             3,
             "basic"
            ],
            [
             40,
             "pro"
            ],
            [
             2,
             "basic"
            ],
            [
             36,
             "pro"
            ],
            [
             5,
             "basic"
            ],
            [
             48,
             "pro"
            ]
           ],
           "target": [
            "yes",
            "no",
            "yes",
            "no",
            "yes",
            "no"
           ]
          },
          "test": {
           "rows": [
            [
             4,
             "pro"
            ],
            [
             44,
             "basic"
            ]
           ]
          },
          "task": "classify"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "alpha_tabular": {
          "summary": "Classify (OpenRouter wire: `task` in the body)",
          "value": {
           "id": "fm-290cedf6e07949c68d2f02ea6d223311",
           "created": 1795131171,
           "object": "tabular.classify",
           "model": "h2oai/tabh2o-v1.1",
           "classes": [
            "no",
            "yes"
           ],
           "labels": [
            "no",
            "no"
           ],
           "probabilities": [
            [
             0.5264602303504944,
             0.473539799451828
            ],
            [
             0.5087390542030334,
             0.49126094579696655
            ]
           ],
           "usage": {
            "prompt_tokens": 22,
            "completion_tokens": 6,
            "total_tokens": 28,
            "input_cells": 22,
            "output_values": 6,
            "cost": 4.6e-06
           }
          }
         }
        },
        "schema": {
         "$ref": "#/components/schemas/TabularResponse"
        }
       }
      },
      "headers": {
       "x-lightning-region": {
        "$ref": "#/components/headers/x-lightning-region"
       },
       "x-lightning-backend": {
        "$ref": "#/components/headers/x-lightning-backend"
       },
       "x-lightning-region-state": {
        "$ref": "#/components/headers/x-lightning-region-state"
       },
       "x-ratelimit-api_key-remaining-requests": {
        "$ref": "#/components/headers/x-ratelimit-api_key-remaining-requests"
       },
       "x-ratelimit-api_key-remaining-tokens": {
        "$ref": "#/components/headers/x-ratelimit-api_key-remaining-tokens"
       },
       "x-litellm-response-cost": {
        "$ref": "#/components/headers/x-litellm-response-cost"
       }
      }
     },
     "400": {
      "description": "Invalid request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "No or wrong API key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limited: see Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "Busy or down: retry after Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "bearerAuth": {
    "type": "http",
    "scheme": "bearer",
    "description": "Your H2O-Lightning API key: `Authorization: Bearer $LIGHTNING_API_KEY`."
   }
  },
  "schemas": {
   "Error": {
    "type": "object",
    "required": [
     "error"
    ],
    "properties": {
     "error": {
      "type": "object",
      "required": [
       "message"
      ],
      "properties": {
       "message": {
        "type": "string"
       },
       "type": {
        "type": "string",
        "examples": [
         "invalid_request_error",
         "auth_error",
         "model_not_found"
        ]
       },
       "param": {
        "type": [
         "string",
         "null"
        ]
       },
       "code": {
        "type": "string",
        "description": "The HTTP status, or a reason such as `method_not_allowed`."
       }
      }
     }
    }
   },
   "Kwargs": {
    "type": "object",
    "description": "Optional controls applied on top of the mode. An explicit control wins over the mode's setting.",
    "additionalProperties": true,
    "properties": {
     "mode": {
      "type": "string",
      "enum": [
       "auto",
       "aa",
       "decision_index",
       "jevbench"
      ],
      "default": "auto",
      "description": "The decision mode; `auto` (or leaving it out) serves `aa`. Also accepted as `kwargs.mode` (the two must agree)."
     },
     "attention_mode": {
      "type": "string",
      "enum": [
       "bidirectional",
       "causal",
       "two-way",
       "one-way"
      ],
      "description": "Reading direction: `bidirectional` (two-way) or `causal` (one-way). Default: the mode's own setting."
     },
     "floor": {
      "type": "object",
      "description": "The yes/no floor. `{\"apply\": false}` returns the calibrated P(yes).",
      "properties": {
       "apply": {
        "type": "boolean"
       }
      }
     },
     "state": {
      "type": "object",
      "description": "How a long record is fitted to the model's context.",
      "properties": {
       "budget": {
        "type": "integer",
        "minimum": 0,
        "description": "Token budget for the record."
       },
       "cutoff": {
        "type": "string",
        "enum": [
         "headtail",
         "head",
         "tail",
         "reject"
        ],
        "description": "What to keep when the record is over the budget; `reject` refuses (422) instead."
       },
       "bm25": {
        "type": "boolean",
        "description": "Select the passages most relevant to the questions (BM25) when over the budget."
       }
      }
     },
     "failures": {
      "type": "object",
      "properties": {
       "scope": {
        "type": "string",
        "enum": [
         "request",
         "question"
        ],
        "description": "`question`: a question the model cannot ask is answered `{\"type\": \"unsupported\"}` and the rest are answered (native wire)."
       }
      }
     },
     "readout": {
      "type": "object",
      "description": "Read choice questions again in reverse option order and average.",
      "properties": {
       "orders": {
        "oneOf": [
         {
          "type": "integer",
          "enum": [
           1,
           2
          ]
         },
         {
          "type": "string",
          "enum": [
           "auto"
          ]
         }
        ]
       },
       "cutoff": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
       }
      }
     },
     "idk": {
      "type": "object",
      "description": "The \"I don't know\" rule (on in `aa`).",
      "properties": {
       "cutoff": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
       }
      }
     },
     "reread": {
      "type": "object",
      "description": "The second read of unsure questions (on in `decision_index` and `aa`); `below` 0 = off.",
      "properties": {
       "below": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
       }
      }
     },
     "temperature": {
      "type": "object",
      "description": "Per question type answer temperature.",
      "properties": {
       "choice": {
        "type": "number",
        "minimum": 0
       },
       "noul": {
        "type": "number",
        "minimum": 0
       },
       "score": {
        "type": "number",
        "minimum": 0
       }
      }
     }
    }
   },
   "NoulQuestion": {
    "type": "object",
    "required": [
     "type"
    ],
    "description": "A yes/no question; the answer is P(yes).",
    "properties": {
     "type": {
      "const": "noul"
     },
     "instructions": {
      "type": "string"
     },
     "criteria": {
      "type": "object",
      "description": "What yes and no mean.",
      "properties": {
       "true": {
        "type": "string"
       },
       "false": {
        "type": "string"
       }
      }
     }
    }
   },
   "ChoiceQuestion": {
    "type": "object",
    "required": [
     "type",
     "criteria"
    ],
    "description": "Pick one option.",
    "properties": {
     "type": {
      "const": "choice"
     },
     "instructions": {
      "type": "string"
     },
     "criteria": {
      "type": "object",
      "minProperties": 1,
      "maxProperties": 255,
      "description": "Option name -> its description (may be empty).",
      "additionalProperties": {
       "type": "string"
      }
     }
    }
   },
   "ScoreQuestion": {
    "type": "object",
    "required": [
     "type",
     "criteria"
    ],
    "description": "An ordered scale; levels are numbered from 0.",
    "properties": {
     "type": {
      "const": "score"
     },
     "instructions": {
      "type": "string"
     },
     "criteria": {
      "type": "array",
      "minItems": 1,
      "maxItems": 10,
      "items": {
       "type": "string"
      },
      "description": "The level labels, lowest first."
     }
    }
   },
   "Question": {
    "oneOf": [
     {
      "$ref": "#/components/schemas/NoulQuestion"
     },
     {
      "$ref": "#/components/schemas/ChoiceQuestion"
     },
     {
      "$ref": "#/components/schemas/ScoreQuestion"
     }
    ],
    "discriminator": {
     "propertyName": "type",
     "mapping": {
      "noul": "#/components/schemas/NoulQuestion",
      "choice": "#/components/schemas/ChoiceQuestion",
      "score": "#/components/schemas/ScoreQuestion"
     }
    }
   },
   "DecisionRequest": {
    "type": "object",
    "required": [
     "model",
     "state",
     "questions"
    ],
    "properties": {
     "model": {
      "type": "string",
      "description": "A decision model id: `h2o-lightning-4b` or `h2o-lightning-31b` (or an alias).",
      "examples": [
       "h2o-lightning-4b",
       "h2o-lightning-31b"
      ]
     },
     "state": {
      "description": "The record: a string, a JSON object, or a list of strings and image parts (`{\"type\": \"image_url\", \"image_url\": {\"url\": \"data:image/png;base64,...\"}}`).",
      "oneOf": [
       {
        "type": "string"
       },
       {
        "type": "object"
       },
       {
        "type": "array"
       }
      ]
     },
     "questions": {
      "type": "object",
      "minProperties": 1,
      "maxProperties": 128,
      "description": "Question name -> question. Answers come back under the same names.",
      "additionalProperties": {
       "$ref": "#/components/schemas/Question"
      }
     },
     "images": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Images as data URLs (`data:image/png;base64,...`)."
     },
     "mode": {
      "type": "string",
      "enum": [
       "auto",
       "aa",
       "decision_index",
       "jevbench"
      ],
      "default": "auto",
      "description": "The decision mode; `auto` (or leaving it out) serves `aa`. Also accepted as `kwargs.mode` (the two must agree)."
     },
     "attention_mode": {
      "type": "string",
      "enum": [
       "bidirectional",
       "causal",
       "two-way",
       "one-way"
      ],
      "description": "Reading direction: `bidirectional` (two-way) or `causal` (one-way). Default: the mode's own setting."
     },
     "kwargs": {
      "$ref": "#/components/schemas/Kwargs"
     },
     "timeout": {
      "type": "number",
      "exclusiveMinimum": 0,
      "maximum": 120,
      "description": "The request's own deadline in seconds (at most 120)."
     }
    }
   },
   "NoulAnswer": {
    "type": "object",
    "required": [
     "type",
     "noul"
    ],
    "properties": {
     "type": {
      "const": "noul"
     },
     "noul": {
      "type": "number",
      "minimum": 0,
      "maximum": 1,
      "description": "P(yes)."
     }
    }
   },
   "ChoiceAnswer": {
    "type": "object",
    "required": [
     "type",
     "choice",
     "confidence",
     "probabilities"
    ],
    "properties": {
     "type": {
      "const": "choice"
     },
     "choice": {
      "type": "string"
     },
     "confidence": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
     },
     "probabilities": {
      "type": "object",
      "additionalProperties": {
       "type": "number",
       "minimum": 0,
       "maximum": 1
      }
     },
     "idk": {
      "type": "object",
      "description": "With the \"I don't know\" rule: the real options' renormalised probabilities."
     }
    }
   },
   "ScoreAnswer": {
    "type": "object",
    "required": [
     "type",
     "score",
     "confidence",
     "legend",
     "probabilities"
    ],
    "properties": {
     "type": {
      "const": "score"
     },
     "score": {
      "type": "number",
      "description": "The expected level (0-based)."
     },
     "confidence": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
     },
     "legend": {
      "type": "object",
      "additionalProperties": {
       "type": "string"
      },
      "description": "Level number -> label."
     },
     "probabilities": {
      "type": "object",
      "additionalProperties": {
       "type": "number",
       "minimum": 0,
       "maximum": 1
      }
     }
    }
   },
   "UnsupportedAnswer": {
    "type": "object",
    "required": [
     "type"
    ],
    "description": "Only with `kwargs.failures.scope` `question`.",
    "properties": {
     "type": {
      "const": "unsupported"
     },
     "question_type": {
      "type": "string"
     },
     "reason": {
      "type": "string"
     }
    }
   },
   "EffortUsed": {
    "type": "object",
    "additionalProperties": true,
    "description": "What was served for this request.",
    "properties": {
     "mode": {
      "type": "string",
      "description": "The mode served."
     },
     "mode_requested": {
      "type": "string"
     },
     "mode_note": {
      "type": "string",
      "description": "Present when a model fell back from the mode asked."
     },
     "floor": {
      "type": "object",
      "properties": {
       "value": {
        "type": "number",
        "description": "The floor in force (0 = off)."
       },
       "moved": {
        "type": "array",
        "items": {
         "type": "string"
        },
        "description": "The yes/no questions the floor moved."
       }
      }
     },
     "reread": {
      "type": "object",
      "description": "The second read: the cutoff, how many questions were read again and their input tokens."
     },
     "idk": {
      "type": "object",
      "description": "The \"I don't know\" rule: its cutoff, and the questions that offered and took the option."
     },
     "lane_fallback": {
      "type": "object",
      "description": "A long request answered with a shorter context because the long-context engine was busy or down."
     }
    }
   },
   "DecisionResponse": {
    "type": "object",
    "required": [
     "model",
     "answers"
    ],
    "properties": {
     "model": {
      "type": "string"
     },
     "answers": {
      "type": "object",
      "additionalProperties": {
       "oneOf": [
        {
         "$ref": "#/components/schemas/NoulAnswer"
        },
        {
         "$ref": "#/components/schemas/ChoiceAnswer"
        },
        {
         "$ref": "#/components/schemas/ScoreAnswer"
        },
        {
         "$ref": "#/components/schemas/UnsupportedAnswer"
        }
       ]
      }
     },
     "usage": {
      "type": "object",
      "properties": {
       "input_tokens": {
        "type": "integer",
        "description": "Billed: the input as sent."
       },
       "output_tokens": {
        "type": "integer"
       },
       "reasoning_tokens": {
        "type": "integer"
       },
       "processed_input_tokens": {
        "type": "integer",
        "description": "Input plus a mode's second reads (not billed); present when one ran."
       },
       "latency_ms": {
        "type": "number"
       }
      }
     },
     "effort_used": {
      "$ref": "#/components/schemas/EffortUsed"
     },
     "attention_mode": {
      "type": "string",
      "description": "The reading direction that ran."
     },
     "probability_source": {
      "type": "string"
     }
    }
   },
   "OpenRouterDecisionResponse": {
    "type": "object",
    "required": [
     "model",
     "answers"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "provider": {
      "type": "string"
     },
     "model": {
      "type": "string"
     },
     "answers": {
      "type": "object",
      "additionalProperties": {
       "oneOf": [
        {
         "$ref": "#/components/schemas/NoulAnswer"
        },
        {
         "$ref": "#/components/schemas/ChoiceAnswer"
        },
        {
         "$ref": "#/components/schemas/ScoreAnswer"
        }
       ]
      }
     },
     "usage": {
      "type": "object",
      "properties": {
       "input_tokens": {
        "type": "integer"
       },
       "output_tokens": {
        "type": "integer"
       }
      }
     }
    }
   },
   "OpenAIInputMessage": {
    "type": "object",
    "required": [
     "content"
    ],
    "properties": {
     "role": {
      "const": "user"
     },
     "type": {
      "const": "message"
     },
     "content": {
      "oneOf": [
       {
        "type": "string"
       },
       {
        "type": "array",
        "items": {
         "oneOf": [
          {
           "type": "object",
           "required": [
            "type",
            "text"
           ],
           "properties": {
            "type": {
             "const": "input_text"
            },
            "text": {
             "type": "string"
            }
           }
          },
          {
           "type": "object",
           "required": [
            "type",
            "image_url"
           ],
           "properties": {
            "type": {
             "const": "input_image"
            },
            "image_url": {
             "type": "string",
             "description": "A data URL."
            },
            "detail": {
             "type": "string"
            }
           }
          }
         ]
        }
       }
      ]
     }
    }
   },
   "OpenAIQuestion": {
    "type": "object",
    "required": [
     "type",
     "instructions"
    ],
    "description": "`predicate` (yes/no), `choice` (2-255 `choices`) or `score` (2-10 `levels`, lowest first).",
    "properties": {
     "type": {
      "type": "string",
      "enum": [
       "predicate",
       "choice",
       "score"
      ]
     },
     "name": {
      "type": "string"
     },
     "instructions": {
      "type": "string"
     },
     "choices": {
      "type": "array",
      "minItems": 2,
      "maxItems": 255,
      "items": {
       "type": "object",
       "required": [
        "value"
       ],
       "properties": {
        "value": {
         "type": [
          "string",
          "boolean"
         ]
        },
        "description": {
         "type": "string"
        }
       }
      }
     },
     "levels": {
      "type": "array",
      "minItems": 2,
      "maxItems": 10,
      "items": {
       "type": "object",
       "required": [
        "label"
       ],
       "properties": {
        "label": {
         "type": "string"
        },
        "description": {
         "type": "string"
        }
       }
      }
     }
    }
   },
   "OpenAIDecisionRequest": {
    "type": "object",
    "required": [
     "model",
     "input",
     "questions"
    ],
    "properties": {
     "model": {
      "type": "string",
      "description": "A decision model id: `h2o-lightning-4b` or `h2o-lightning-31b` (or an alias).",
      "examples": [
       "h2o-lightning-4b",
       "h2o-lightning-31b"
      ]
     },
     "input": {
      "oneOf": [
       {
        "type": "string"
       },
       {
        "type": "array",
        "items": {
         "$ref": "#/components/schemas/OpenAIInputMessage"
        }
       }
      ]
     },
     "questions": {
      "type": "array",
      "minItems": 1,
      "maxItems": 128,
      "items": {
       "$ref": "#/components/schemas/OpenAIQuestion"
      }
     },
     "mode": {
      "type": "string",
      "enum": [
       "auto",
       "aa",
       "decision_index",
       "jevbench"
      ],
      "default": "auto",
      "description": "The decision mode; `auto` (or leaving it out) serves `aa`. Also accepted as `kwargs.mode` (the two must agree)."
     },
     "attention_mode": {
      "type": "string",
      "enum": [
       "bidirectional",
       "causal",
       "two-way",
       "one-way"
      ],
      "description": "Reading direction: `bidirectional` (two-way) or `causal` (one-way). Default: the mode's own setting."
     },
     "kwargs": {
      "$ref": "#/components/schemas/Kwargs"
     },
     "timeout": {
      "type": "number",
      "exclusiveMinimum": 0,
      "maximum": 120,
      "description": "The request's own deadline in seconds (at most 120)."
     },
     "safety_identifier": {
      "type": "string"
     }
    }
   },
   "OpenAIDecisionResponse": {
    "type": "object",
    "required": [
     "model",
     "answers",
     "usage"
    ],
    "properties": {
     "model": {
      "type": "string"
     },
     "answers": {
      "type": "array",
      "items": {
       "type": "object",
       "required": [
        "type",
        "name"
       ],
       "properties": {
        "type": {
         "type": "string",
         "enum": [
          "predicate",
          "choice",
          "score",
          "refusal"
         ]
        },
        "name": {
         "type": [
          "string",
          "null"
         ]
        },
        "probability": {
         "type": "number",
         "minimum": 0,
         "maximum": 1,
         "description": "predicate: P(yes)."
        },
        "choice": {
         "type": [
          "string",
          "boolean"
         ]
        },
        "score": {
         "type": "number"
        },
        "confidence": {
         "type": "number",
         "minimum": 0,
         "maximum": 1
        },
        "probabilities": {
         "type": "array",
         "items": {
          "type": "object",
          "properties": {
           "value": {
            "type": [
             "string",
             "boolean",
             "integer"
            ]
           },
           "label": {
            "type": "string"
           },
           "probability": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
           }
          }
         }
        }
       }
      }
     },
     "usage": {
      "type": "object",
      "properties": {
       "input_tokens": {
        "type": "integer"
       },
       "output_tokens": {
        "type": "integer"
       },
       "total_tokens": {
        "type": "integer"
       },
       "input_tokens_details": {
        "type": "object"
       },
       "output_tokens_details": {
        "type": "object"
       }
      }
     },
     "effort_used": {
      "$ref": "#/components/schemas/EffortUsed"
     }
    }
   },
   "FMChatRequest": {
    "type": "object",
    "required": [
     "model",
     "messages"
    ],
    "description": "The standard chat-completions body plus the model's options as top-level fields (`extra_body` in the SDK). Options may also ride inside the message as `{\"data\": ..., <option>: ...}` or as `options: {...}`. An unknown top-level field is a 400 naming it.",
    "properties": {
     "model": {
      "type": "string",
      "enum": [
       "h2oai/timeh2o-v1",
       "h2oai/timeh2o-v1-tiny",
       "h2oai/tabh2o-v1.1"
      ]
     },
     "messages": {
      "type": "array",
      "description": "The data is the last user message, as text: a JSON array of numbers, JSON records, a JSON object, or CSV (header row; comma or tab). Image parts are a 400.",
      "items": {
       "type": "object",
       "properties": {
        "role": {
         "type": "string"
        },
        "content": {
         "oneOf": [
          {
           "type": "string"
          },
          {
           "type": "array"
          }
         ]
        }
       }
      }
     },
     "stream": {
      "type": "boolean",
      "description": "One server-sent-events answer: a content chunk, a finish chunk, a usage chunk, `[DONE]`."
     },
     "tools": {
      "type": "array",
      "description": "With a tool, the result comes back as that tool's call (`finish_reason` `tool_calls`)."
     },
     "tool_choice": {},
     "n": {
      "type": "integer",
      "const": 1
     },
     "seed": {
      "type": "integer",
      "description": "TabH2O: the random state when `random_state` is not given."
     },
     "horizon": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1024,
      "description": "TimeH2O: steps to forecast; required unless the data ends with rows whose target is empty."
     },
     "quantile_levels": {
      "type": "array",
      "items": {
       "type": "number",
       "exclusiveMinimum": 0,
       "exclusiveMaximum": 1
      },
      "description": "Default 0.1 ... 0.9."
     },
     "target": {
      "type": "string",
      "description": "The target column (records / CSV)."
     },
     "id_column": {
      "type": "string",
      "description": "TimeH2O: the column that splits several series."
     },
     "timestamp_column": {
      "type": "string",
      "description": "TimeH2O: a time column (dropped)."
     },
     "clip_nonnegative": {
      "type": "boolean",
      "default": false
     },
     "snap_integer": {
      "type": "boolean",
      "default": false
     },
     "flip_equivariant": {
      "type": "boolean",
      "default": true
     },
     "task": {
      "type": "string",
      "enum": [
       "classify",
       "regress"
      ],
      "description": "TabH2O, required."
     },
     "n_estimators": {
      "type": "integer",
      "default": 8
     },
     "random_state": {
      "type": "integer",
      "default": 42
     },
     "softmax_temperature": {
      "type": "number",
      "description": "TabH2O classify."
     }
    }
   },
   "ChatCompletion": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "object": {
      "const": "chat.completion"
     },
     "created": {
      "type": "integer"
     },
     "model": {
      "type": "string"
     },
     "choices": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "index": {
         "type": "integer"
        },
        "finish_reason": {
         "type": "string"
        },
        "message": {
         "type": "object",
         "properties": {
          "role": {
           "type": "string"
          },
          "content": {
           "type": "string",
           "description": "The result as JSON: the native route's answer without `usage` and `model`."
          }
         }
        }
       }
      }
     },
     "usage": {
      "type": "object",
      "properties": {
       "prompt_tokens": {
        "type": "integer",
        "description": "Input data points."
       },
       "completion_tokens": {
        "type": "integer",
        "description": "Returned values."
       },
       "total_tokens": {
        "type": "integer"
       },
       "cost": {
        "type": "number",
        "description": "USD."
       }
      }
     }
    }
   },
   "Series": {
    "type": "object",
    "required": [
     "target"
    ],
    "properties": {
     "id": {
      "type": [
       "string",
       "null"
      ]
     },
     "target": {
      "type": "array",
      "items": {
       "type": "number"
      },
      "description": "The history, oldest first."
     },
     "future_covariates": {
      "type": "object",
      "additionalProperties": {
       "type": "array"
      },
      "description": "Name -> values over the history and the horizon (TimeH2O only)."
     },
     "past_covariates": {
      "type": "object",
      "additionalProperties": {
       "type": "array"
      },
      "description": "Name -> values over the history (TimeH2O only)."
     }
    }
   },
   "ForecastRequest": {
    "type": "object",
    "required": [
     "model",
     "horizon",
     "series"
    ],
    "properties": {
     "model": {
      "type": "string",
      "enum": [
       "h2oai/timeh2o-v1",
       "h2oai/timeh2o-v1-tiny"
      ]
     },
     "horizon": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1024
     },
     "series": {
      "type": "array",
      "minItems": 1,
      "maxItems": 256,
      "items": {
       "$ref": "#/components/schemas/Series"
      }
     },
     "quantile_levels": {
      "type": "array",
      "items": {
       "type": "number"
      }
     },
     "options": {
      "type": "object",
      "description": "`clip_nonnegative`, `snap_integer`, `flip_equivariant`."
     }
    }
   },
   "ForecastResponse": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "created": {
      "type": "integer"
     },
     "object": {
      "const": "forecast"
     },
     "model": {
      "type": "string"
     },
     "quantile_levels": {
      "type": "array",
      "items": {
       "type": "number"
      }
     },
     "forecasts": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "id": {
         "type": [
          "string",
          "null"
         ]
        },
        "median": {
         "type": "array",
         "items": {
          "type": "number"
         }
        },
        "mean": {
         "type": "array",
         "items": {
          "type": "number"
         }
        },
        "quantiles": {
         "type": "object",
         "additionalProperties": {
          "type": "array",
          "items": {
           "type": "number"
          }
         }
        }
       }
      }
     },
     "usage": {
      "type": "object",
      "properties": {
       "input_points": {
        "type": "integer"
       },
       "output_points": {
        "type": "integer"
       },
       "cost": {
        "type": "number"
       },
       "prompt_tokens": {
        "type": "integer",
        "description": "/api/alpha only"
       },
       "completion_tokens": {
        "type": "integer"
       },
       "total_tokens": {
        "type": "integer"
       }
      }
     }
    }
   },
   "TabularRequest": {
    "type": "object",
    "required": [
     "model",
     "columns",
     "train",
     "test"
    ],
    "properties": {
     "model": {
      "const": "h2oai/tabh2o-v1.1"
     },
     "columns": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "train": {
      "type": "object",
      "required": [
       "rows",
       "target"
      ],
      "properties": {
       "rows": {
        "type": "array",
        "items": {
         "type": "array"
        },
        "maxItems": 10000
       },
       "target": {
        "type": "array"
       }
      }
     },
     "test": {
      "type": "object",
      "required": [
       "rows"
      ],
      "properties": {
       "rows": {
        "type": "array",
        "items": {
         "type": "array"
        },
        "maxItems": 10000
       }
      }
     },
     "quantile_levels": {
      "type": "array",
      "items": {
       "type": "number"
      },
      "description": "regress"
     },
     "options": {
      "type": "object",
      "description": "`n_estimators`, `random_state`, `softmax_temperature`."
     }
    }
   },
   "AlphaTabularRequest": {
    "allOf": [
     {
      "$ref": "#/components/schemas/TabularRequest"
     },
     {
      "type": "object",
      "required": [
       "task"
      ],
      "properties": {
       "task": {
        "type": "string",
        "enum": [
         "classify",
         "regress"
        ]
       }
      }
     }
    ]
   },
   "TabularResponse": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "created": {
      "type": "integer"
     },
     "object": {
      "type": "string",
      "enum": [
       "tabular.classify",
       "tabular.regress"
      ]
     },
     "model": {
      "type": "string"
     },
     "classes": {
      "type": "array",
      "description": "classify"
     },
     "labels": {
      "type": "array",
      "description": "classify"
     },
     "probabilities": {
      "type": "array",
      "items": {
       "type": "array",
       "items": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
       }
      },
      "description": "classify: per test row, per class"
     },
     "mean": {
      "type": "array",
      "items": {
       "type": "number"
      },
      "description": "regress"
     },
     "median": {
      "type": "array",
      "items": {
       "type": "number"
      },
      "description": "regress"
     },
     "quantile_levels": {
      "type": "array",
      "items": {
       "type": "number"
      }
     },
     "quantiles": {
      "type": "object",
      "additionalProperties": {
       "type": "array",
       "items": {
        "type": "number"
       }
      }
     },
     "usage": {
      "type": "object",
      "properties": {
       "input_cells": {
        "type": "integer"
       },
       "output_values": {
        "type": "integer"
       },
       "cost": {
        "type": "number"
       },
       "prompt_tokens": {
        "type": "integer",
        "description": "/api/alpha only"
       },
       "completion_tokens": {
        "type": "integer"
       },
       "total_tokens": {
        "type": "integer"
       }
      }
     }
    }
   },
   "ModelList": {
    "type": "object",
    "properties": {
     "object": {
      "const": "list"
     },
     "data": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "id": {
         "type": "string"
        },
        "object": {
         "const": "model"
        },
        "created": {
         "type": "integer"
        },
        "owned_by": {
         "type": "string"
        },
        "lightning": {
         "type": "object",
         "description": "Foundation models: task, routes, limits, prices, readiness."
        }
       }
      }
     }
    }
   },
   "Catalogue": {
    "type": "object",
    "description": "Every hosted model in OpenRouter's provider model-document shape, with prices, regions (`datacenters`) and the decision modes (`x_h2o.modes`).",
    "properties": {
     "data": {
      "type": "array",
      "items": {
       "type": "object"
      }
     }
    }
   }
  },
  "headers": {
   "x-lightning-region": {
    "description": "The region that answered.",
    "schema": {
     "type": "string",
     "enum": [
      "us-east-1",
      "eu-central-1"
     ]
    }
   },
   "x-lightning-backend": {
    "description": "The region of the model that answered.",
    "schema": {
     "type": "string"
    }
   },
   "x-lightning-region-state": {
    "description": "`serving` or `degraded-remote`.",
    "schema": {
     "type": "string"
    }
   },
   "x-ratelimit-api_key-remaining-requests": {
    "description": "Requests left in this minute for the key.",
    "schema": {
     "type": "integer"
    }
   },
   "x-ratelimit-api_key-remaining-tokens": {
    "description": "Tokens left in this minute for the key.",
    "schema": {
     "type": "integer"
    }
   },
   "x-litellm-response-cost": {
    "description": "The cost of this answer in USD.",
    "schema": {
     "type": "number"
    }
   },
   "Retry-After": {
    "description": "Seconds to wait (429, 503).",
    "schema": {
     "type": "integer"
    }
   }
  }
 }
}
