For the complete documentation index, see llms.txt. This page is also available as Markdown.

Open AI API

Chat Completions

post

OpenAI-compatible chat/completions endpoint for Lightning Rod's Foresight forecasting models.

The default limit is 120 requests per minute per organization (sliding window). Exceeded requests receive a 429; check Retry-After and X-RateLimit-* headers to pace retries. Contact support@lightningrod.ai for higher limits.

Authorizations
AuthorizationstringRequired

Lightning Rod API key (sk_…) sent as a Bearer token. Obtain one via POST /v1/mpp/topup (agents) or the dashboard (humans).

Body
modelstringRequired

ID of the model to use

temperaturenumber · nullableOptional

Sampling temperature between 0 and 2

Default: 0.6
max_tokensinteger · nullableOptional

Maximum number of tokens to generate

top_pnumber · nullableOptional

Nucleus sampling parameter

top_kinteger · nullableOptional

Number of top tokens to consider

min_pnumber · nullableOptional

Minimum probability for a token to be considered

reasoning_effortstring · nullableOptional

Lightning Rod extension. Reasoning budget the model spends before answering: low, medium, or high. Higher effort improves accuracy on harder questions at additional token cost. With raw OpenAI clients pass via extra_body.

streamboolean · nullableOptional

Whether to stream back partial progress

Default: false
ninteger · nullableOptional

Number of chat completion choices to generate

Default: 1
stopany of · nullableOptional

Up to 4 sequences where the API will stop generating

stringOptional
or
string[]Optional
seedinteger · nullableOptional

Deterministic sampling seed

researchany of · nullableOptional

Lightning Rod extension. Opt-in web research before forecasting. Pass true to query all default sources, or a ResearchOptions object to select sources. Each source is billed as a separate research event; when research runs, its cost is reported in usage. With raw OpenAI clients pass via extra_body.

booleanOptional
or
answer_typeany of · nullableOptional

Lightning Rod extension that injects output-format guidance and appends a structured answer between <answer></answer> tags in the response content. One of binary, multiple_choice, continuous, free_response, or auto. Raw response shapes: binary -> <answer>0.62</answer> (probability between 0 and 1); continuous -> <answer>{"mean": 42.5, "standard_deviation": 5.2}</answer>; multiple_choice -> <answer>{"A": 0.55, "B": 0.45}</answer>; free_response -> <answer>...</answer>. auto classifies the user question server-side first, then returns one of the above. Omit for prose only. With raw OpenAI clients pass via extra_body.

string · enumOptionalPossible values:
or
const: autoOptional
prediction_datestring · date-time · nullableOptional

Lightning Rod extension. ISO-8601 date-time for a historical/as-of forecast. It is both the temporal anchor the model treats as today and the cutoff for research results; when omitted, the current UTC date is used. Automatic research retains only providers that can honor the cutoff (currently Google News). Explicitly requesting Perplexity together with prediction_date returns a client error. With raw OpenAI clients pass via extra_body.

Responses
200

Successful Response

application/json
post/v1/chat/completions
POST /v1/chat/completions HTTP/1.1
Host: api.lightningrod.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 128

{
  "messages": [
    {
      "content": "Will Bitcoin increase by more than 10% over the next 3 months?",
      "role": "user"
    }
  ],
  "model": "foresight-v4"
}
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1718712345,
  "model": "LightningRodLabs/foresight-v4",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "thinking": "Recent FOMC guidance and CPI prints point to a likely 25bp cut...",
        "content": "Considering recent inflation data and Fed signaling, a 25bp cut in March is more likely than not. <answer>0.62</answer>"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 320,
    "completion_tokens": 540,
    "total_tokens": 860,
    "cost_usd": 0.0091,
    "inference_cost_usd": 0.0091,
    "research_cost_usd": null,
    "classification_cost_usd": null
  }
}

List Models

get

List available models.

Authorizations
AuthorizationstringRequired

Lightning Rod API key (sk_…) sent as a Bearer token. Obtain one via POST /v1/mpp/topup (agents) or the dashboard (humans).

Responses
200

Successful Response

application/json
objectconst: listOptional

The object type

Default: list
get/v1/models
GET /v1/models HTTP/1.1
Host: api.lightningrod.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

Successful Response

{
  "object": "list",
  "data": [
    {
      "id": "text",
      "object": "model",
      "created": 0,
      "owned_by": "lightningrodlabs",
      "name": "",
      "description": "",
      "context_length": 0,
      "max_completion_tokens": 0,
      "pricing": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      }
    }
  ]
}

Completions

post

OpenAI-compatible text completion endpoint for Lightning Rod's Foresight forecasting models.

Prefer the chat/completions endpoint for multi-turn conversations and framework compatibility.

The default limit is 120 requests per minute per organization (sliding window). Exceeded requests receive a 429; check Retry-After and X-RateLimit-* headers to pace retries. Contact support@lightningrod.ai for higher limits.

Authorizations
AuthorizationstringRequired

Lightning Rod API key (sk_…) sent as a Bearer token. Obtain one via POST /v1/mpp/topup (agents) or the dashboard (humans).

Body
modelstringRequired

ID of the model to use

promptany ofRequired

The prompt(s) to generate completions for

stringOptional
or
string[]Optional
temperaturenumber · nullableOptional

Sampling temperature between 0 and 2

Default: 0.6
max_tokensinteger · nullableOptional

Maximum number of tokens to generate

top_pnumber · nullableOptional

Nucleus sampling parameter

top_kinteger · nullableOptional

Number of top tokens to consider

min_pnumber · nullableOptional

Minimum probability for a token to be considered

reasoning_effortstring · nullableOptional

Lightning Rod extension. Reasoning budget the model spends before answering: low, medium, or high. Higher effort improves accuracy on harder questions at additional token cost. With raw OpenAI clients pass via extra_body.

streamboolean · nullableOptional

Whether to stream back partial progress

Default: false
ninteger · nullableOptional

Number of completions to generate

Default: 1
stopany of · nullableOptional

Up to 4 sequences where the API will stop generating

stringOptional
or
string[]Optional
seedinteger · nullableOptional

Deterministic sampling seed

researchany of · nullableOptional

Lightning Rod extension. Opt-in web research before forecasting. Pass true to query all default sources, or a ResearchOptions object to select sources. Available sources: perplexity (Perplexity web search), google_news (recent Google News articles). Each source runs as its own query and is billed as a separate RESEARCH event; when research runs, its cost is reported in usage. With raw OpenAI clients pass via extra_body.

booleanOptional
or
answer_typeany of · nullableOptional

Lightning Rod extension that injects output-format guidance and appends a structured answer between <answer></answer> tags in the response text. One of binary, multiple_choice, continuous, free_response, or auto. Raw response shapes: binary -> <answer>0.62</answer> (probability between 0 and 1); continuous -> <answer>{"mean": 42.5, "standard_deviation": 5.2}</answer>; multiple_choice -> <options>{"A": "...", "B": "..."}</options> followed by <answer>{"A": 0.55, "B": 0.45}</answer>; free_response -> <answer>...</answer>. auto classifies the prompt server-side first, then returns one of the above. Omit for prose only. With raw OpenAI clients pass via extra_body.

string · enumOptionalPossible values:
or
const: autoOptional
Responses
200

Successful Response

application/json
post/v1/completions
POST /v1/completions HTTP/1.1
Host: api.lightningrod.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 204

{
  "model": "text",
  "prompt": "text",
  "temperature": 0.6,
  "max_tokens": 1,
  "top_p": 1,
  "top_k": 1,
  "min_p": 1,
  "reasoning_effort": "text",
  "stream": false,
  "n": 1,
  "stop": "text",
  "seed": 1,
  "research": true,
  "answer_type": "BINARY"
}
{
  "id": "text",
  "object": "text_completion",
  "created": 1,
  "model": "text",
  "choices": [
    {
      "index": 1,
      "text": "text",
      "finish_reason": "text"
    }
  ],
  "usage": {
    "prompt_tokens": 1,
    "completion_tokens": 1,
    "total_tokens": 1,
    "cost_usd": 1,
    "inference_cost_usd": 1,
    "research_cost_usd": 1,
    "classification_cost_usd": 1
  }
}

Last updated

Was this helpful?