Open AI API
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.
Lightning Rod API key (sk_…) sent as a Bearer token. Obtain one via POST /v1/mpp/topup (agents) or the dashboard (humans).
ID of the model to use
Sampling temperature between 0 and 2
0.6Maximum number of tokens to generate
Nucleus sampling parameter
Number of top tokens to consider
Minimum probability for a token to be considered
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.
Whether to stream back partial progress
falseNumber of chat completion choices to generate
1Up to 4 sequences where the API will stop generating
Deterministic sampling seed
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.
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.
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.
Successful Response
Validation Error
Rate limit exceeded. Retry after the number of seconds in Retry-After.
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 available models.
Lightning Rod API key (sk_…) sent as a Bearer token. Obtain one via POST /v1/mpp/topup (agents) or the dashboard (humans).
Successful Response
The object type
listGET /v1/models HTTP/1.1
Host: api.lightningrod.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
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"
}
}
]
}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.
Lightning Rod API key (sk_…) sent as a Bearer token. Obtain one via POST /v1/mpp/topup (agents) or the dashboard (humans).
ID of the model to use
The prompt(s) to generate completions for
Sampling temperature between 0 and 2
0.6Maximum number of tokens to generate
Nucleus sampling parameter
Number of top tokens to consider
Minimum probability for a token to be considered
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.
Whether to stream back partial progress
falseNumber of completions to generate
1Up to 4 sequences where the API will stop generating
Deterministic sampling seed
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.
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.
Successful Response
Validation Error
Rate limit exceeded. Retry after the number of seconds in Retry-After.
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?
