> For the complete documentation index, see [llms.txt](https://docs.lightningrod.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lightningrod.ai/api-reference/models.md).

# Models

## The AnswerTypeEnum object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"AnswerTypeEnum":{"type":"string","enum":["BINARY","MULTIPLE_CHOICE","CONTINUOUS","CONTINUOUS_VALUE_ONLY","FREE_RESPONSE"],"title":"AnswerTypeEnum"}}}}
```

## The BalanceResponse object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"BalanceResponse":{"properties":{"balance_dollars":{"type":"number","title":"Balance Dollars"}},"type":"object","required":["balance_dollars"],"title":"BalanceResponse"}}}}
```

## The BatchCreateRequest object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"BatchCreateRequest":{"properties":{"input_file_id":{"type":"string","minLength":1,"title":"Input File Id"},"endpoint":{"type":"string","const":"/v1/chat/completions","title":"Endpoint"},"completion_window":{"type":"string","const":"24h","title":"Completion Window"},"metadata":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Metadata"},"output_expires_after":{"anyOf":[{"$ref":"#/components/schemas/ExpirationPolicy"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["input_file_id","endpoint","completion_window"],"title":"BatchCreateRequest"},"ExpirationPolicy":{"properties":{"anchor":{"type":"string","const":"created_at","title":"Anchor"},"seconds":{"type":"integer","maximum":2592000,"minimum":3600,"title":"Seconds"}},"additionalProperties":false,"type":"object","required":["anchor","seconds"],"title":"ExpirationPolicy"}}}}
```

## The BatchError object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"BatchError":{"properties":{"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"line":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Line"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"param":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Param"}},"type":"object","title":"BatchError"}}}}
```

## The BatchErrors object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"BatchErrors":{"properties":{"object":{"type":"string","const":"list","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/BatchError"},"type":"array","title":"Data"}},"type":"object","title":"BatchErrors"},"BatchError":{"properties":{"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"line":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Line"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"param":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Param"}},"type":"object","title":"BatchError"}}}}
```

## The BatchInputTokensDetails object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"BatchInputTokensDetails":{"properties":{"cached_tokens":{"type":"integer","minimum":0,"title":"Cached Tokens","default":0}},"type":"object","title":"BatchInputTokensDetails"}}}}
```

## The BatchListResponse object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"BatchListResponse":{"properties":{"object":{"type":"string","const":"list","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/BatchObject"},"type":"array","title":"Data"},"first_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Id"},"last_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Id"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["data","has_more"],"title":"BatchListResponse"},"BatchObject":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","const":"batch","title":"Object","default":"batch"},"endpoint":{"type":"string","const":"/v1/chat/completions","title":"Endpoint"},"errors":{"anyOf":[{"$ref":"#/components/schemas/BatchErrors"},{"type":"null"}]},"input_file_id":{"type":"string","title":"Input File Id"},"completion_window":{"type":"string","const":"24h","title":"Completion Window","default":"24h"},"status":{"type":"string","enum":["validating","failed","in_progress","finalizing","completed","expired","cancelling","cancelled"],"title":"Status"},"output_file_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output File Id"},"error_file_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error File Id"},"created_at":{"type":"integer","title":"Created At"},"in_progress_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"In Progress At"},"expires_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires At"},"finalizing_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Finalizing At"},"completed_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Completed At"},"failed_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Failed At"},"expired_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expired At"},"cancelling_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cancelling At"},"cancelled_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cancelled At"},"request_counts":{"$ref":"#/components/schemas/BatchRequestCounts"},"metadata":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Metadata"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"usage":{"anyOf":[{"$ref":"#/components/schemas/BatchUsage"},{"type":"null"}]}},"type":"object","required":["id","endpoint","input_file_id","status","created_at"],"title":"BatchObject"},"BatchErrors":{"properties":{"object":{"type":"string","const":"list","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/BatchError"},"type":"array","title":"Data"}},"type":"object","title":"BatchErrors"},"BatchError":{"properties":{"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"line":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Line"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"param":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Param"}},"type":"object","title":"BatchError"},"BatchRequestCounts":{"properties":{"total":{"type":"integer","minimum":0,"title":"Total","default":0},"completed":{"type":"integer","minimum":0,"title":"Completed","default":0},"failed":{"type":"integer","minimum":0,"title":"Failed","default":0}},"type":"object","title":"BatchRequestCounts"},"BatchUsage":{"properties":{"input_tokens":{"type":"integer","minimum":0,"title":"Input Tokens"},"input_tokens_details":{"$ref":"#/components/schemas/BatchInputTokensDetails"},"output_tokens":{"type":"integer","minimum":0,"title":"Output Tokens"},"output_tokens_details":{"$ref":"#/components/schemas/BatchOutputTokensDetails"},"total_tokens":{"type":"integer","minimum":0,"title":"Total Tokens"}},"type":"object","required":["input_tokens","output_tokens","total_tokens"],"title":"BatchUsage"},"BatchInputTokensDetails":{"properties":{"cached_tokens":{"type":"integer","minimum":0,"title":"Cached Tokens","default":0}},"type":"object","title":"BatchInputTokensDetails"},"BatchOutputTokensDetails":{"properties":{"reasoning_tokens":{"type":"integer","minimum":0,"title":"Reasoning Tokens","default":0}},"type":"object","title":"BatchOutputTokensDetails"}}}}
```

## The BatchObject object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"BatchObject":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","const":"batch","title":"Object","default":"batch"},"endpoint":{"type":"string","const":"/v1/chat/completions","title":"Endpoint"},"errors":{"anyOf":[{"$ref":"#/components/schemas/BatchErrors"},{"type":"null"}]},"input_file_id":{"type":"string","title":"Input File Id"},"completion_window":{"type":"string","const":"24h","title":"Completion Window","default":"24h"},"status":{"type":"string","enum":["validating","failed","in_progress","finalizing","completed","expired","cancelling","cancelled"],"title":"Status"},"output_file_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output File Id"},"error_file_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error File Id"},"created_at":{"type":"integer","title":"Created At"},"in_progress_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"In Progress At"},"expires_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires At"},"finalizing_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Finalizing At"},"completed_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Completed At"},"failed_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Failed At"},"expired_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expired At"},"cancelling_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cancelling At"},"cancelled_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cancelled At"},"request_counts":{"$ref":"#/components/schemas/BatchRequestCounts"},"metadata":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Metadata"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"usage":{"anyOf":[{"$ref":"#/components/schemas/BatchUsage"},{"type":"null"}]}},"type":"object","required":["id","endpoint","input_file_id","status","created_at"],"title":"BatchObject"},"BatchErrors":{"properties":{"object":{"type":"string","const":"list","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/BatchError"},"type":"array","title":"Data"}},"type":"object","title":"BatchErrors"},"BatchError":{"properties":{"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"line":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Line"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"param":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Param"}},"type":"object","title":"BatchError"},"BatchRequestCounts":{"properties":{"total":{"type":"integer","minimum":0,"title":"Total","default":0},"completed":{"type":"integer","minimum":0,"title":"Completed","default":0},"failed":{"type":"integer","minimum":0,"title":"Failed","default":0}},"type":"object","title":"BatchRequestCounts"},"BatchUsage":{"properties":{"input_tokens":{"type":"integer","minimum":0,"title":"Input Tokens"},"input_tokens_details":{"$ref":"#/components/schemas/BatchInputTokensDetails"},"output_tokens":{"type":"integer","minimum":0,"title":"Output Tokens"},"output_tokens_details":{"$ref":"#/components/schemas/BatchOutputTokensDetails"},"total_tokens":{"type":"integer","minimum":0,"title":"Total Tokens"}},"type":"object","required":["input_tokens","output_tokens","total_tokens"],"title":"BatchUsage"},"BatchInputTokensDetails":{"properties":{"cached_tokens":{"type":"integer","minimum":0,"title":"Cached Tokens","default":0}},"type":"object","title":"BatchInputTokensDetails"},"BatchOutputTokensDetails":{"properties":{"reasoning_tokens":{"type":"integer","minimum":0,"title":"Reasoning Tokens","default":0}},"type":"object","title":"BatchOutputTokensDetails"}}}}
```

## The BatchOutputTokensDetails object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"BatchOutputTokensDetails":{"properties":{"reasoning_tokens":{"type":"integer","minimum":0,"title":"Reasoning Tokens","default":0}},"type":"object","title":"BatchOutputTokensDetails"}}}}
```

## The BatchRequestCounts object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"BatchRequestCounts":{"properties":{"total":{"type":"integer","minimum":0,"title":"Total","default":0},"completed":{"type":"integer","minimum":0,"title":"Completed","default":0},"failed":{"type":"integer","minimum":0,"title":"Failed","default":0}},"type":"object","title":"BatchRequestCounts"}}}}
```

## The BatchUsage object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"BatchUsage":{"properties":{"input_tokens":{"type":"integer","minimum":0,"title":"Input Tokens"},"input_tokens_details":{"$ref":"#/components/schemas/BatchInputTokensDetails"},"output_tokens":{"type":"integer","minimum":0,"title":"Output Tokens"},"output_tokens_details":{"$ref":"#/components/schemas/BatchOutputTokensDetails"},"total_tokens":{"type":"integer","minimum":0,"title":"Total Tokens"}},"type":"object","required":["input_tokens","output_tokens","total_tokens"],"title":"BatchUsage"},"BatchInputTokensDetails":{"properties":{"cached_tokens":{"type":"integer","minimum":0,"title":"Cached Tokens","default":0}},"type":"object","title":"BatchInputTokensDetails"},"BatchOutputTokensDetails":{"properties":{"reasoning_tokens":{"type":"integer","minimum":0,"title":"Reasoning Tokens","default":0}},"type":"object","title":"BatchOutputTokensDetails"}}}}
```

## The Body\_upload\_file\_files\_post object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"Body_upload_file_files_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"purpose":{"type":"string","title":"Purpose"},"expires_after[anchor]":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires After[Anchor]"},"expires_after[seconds]":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires After[Seconds]"}},"type":"object","required":["file","purpose"],"title":"Body_upload_file_files_post"}}}}
```

## The ChatCompletionRequest object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"ChatCompletionRequest":{"properties":{"model":{"type":"string","title":"Model","description":"ID of the model to use"},"messages":{"items":{"$ref":"#/components/schemas/ChatMessage"},"type":"array","title":"Messages","description":"A list of messages comprising the conversation so far"},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature","description":"Sampling temperature between 0 and 2","default":0.6},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens","description":"Maximum number of tokens to generate"},"top_p":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Top P","description":"Nucleus sampling parameter"},"top_k":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Top K","description":"Number of top tokens to consider"},"min_p":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min P","description":"Minimum probability for a token to be considered"},"reasoning_effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasoning Effort","description":"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`."},"stream":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stream","description":"Whether to stream back partial progress","default":false},"n":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"N","description":"Number of chat completion choices to generate","default":1},"stop":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Stop","description":"Up to 4 sequences where the API will stop generating"},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed","description":"Deterministic sampling seed"},"research":{"anyOf":[{"type":"boolean"},{"$ref":"#/components/schemas/ResearchOptions"},{"type":"null"}],"title":"Research","description":"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`."},"answer_type":{"anyOf":[{"$ref":"#/components/schemas/AnswerTypeEnum"},{"type":"string","const":"auto"},{"type":"null"}],"title":"Answer Type","description":"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`."},"prediction_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Prediction Date","description":"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`."}},"type":"object","required":["model","messages"],"title":"ChatCompletionRequest"},"ChatMessage":{"properties":{"role":{"type":"string","title":"Role","description":"The role of the message author (system, user, or assistant)"},"content":{"type":"string","title":"Content","description":"The content of the message"}},"type":"object","required":["role","content"],"title":"ChatMessage"},"ResearchOptions":{"properties":{"sources":{"items":{"type":"string","enum":["perplexity","google_news"]},"type":"array","title":"Sources","description":"Which research source providers to use. Each provider is billed separately."}},"type":"object","title":"ResearchOptions","description":"Opt-in research enrichment for forecasting requests.\n\nWhen set, the API fetches web-grounded context from the requested sources\nand injects it into the prompt before calling the model. Each successful\nsource produces a billable RESEARCH event."},"AnswerTypeEnum":{"type":"string","enum":["BINARY","MULTIPLE_CHOICE","CONTINUOUS","CONTINUOUS_VALUE_ONLY","FREE_RESPONSE"],"title":"AnswerTypeEnum"}}}}
```

## The ChatCompletionResponse object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"ChatCompletionResponse":{"properties":{"id":{"type":"string","title":"Id","description":"A unique identifier for the chat completion"},"object":{"type":"string","const":"chat.completion","title":"Object","description":"The object type","default":"chat.completion"},"created":{"type":"integer","title":"Created","description":"Unix timestamp of when the completion was created"},"model":{"type":"string","title":"Model","description":"The model used for the chat completion"},"choices":{"items":{"$ref":"#/components/schemas/Choice"},"type":"array","title":"Choices","description":"A list of chat completion choices"},"usage":{"anyOf":[{"$ref":"#/components/schemas/Usage"},{"type":"null"}],"description":"Usage statistics for the completion request"}},"type":"object","required":["id","created","model","choices"],"title":"ChatCompletionResponse"},"Choice":{"properties":{"index":{"type":"integer","title":"Index","description":"The index of this choice"},"message":{"$ref":"#/components/schemas/ResponseMessage","description":"The message generated by the model"},"finish_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finish Reason","description":"The reason the model stopped generating tokens"}},"type":"object","required":["index","message"],"title":"Choice"},"ResponseMessage":{"properties":{"role":{"type":"string","title":"Role","description":"The role of the message author"},"content":{"type":"string","title":"Content","description":"The model's full response. When `answer_type` was set on the request, a machine-readable answer is embedded between `<answer></answer>` tags at the end (e.g. `<answer>0.62</answer>` for a binary probability). See the request's `answer_type` field for the per-type shapes."},"thinking":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thinking","description":"The model's reasoning/thinking chain, when returned by the model."},"annotations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/UrlCitationAnnotation"}},{"type":"null"}],"title":"Annotations","description":"Source citations from web research, present only when `research` ran. Each entry is a `url_citation` referencing a source the model used."}},"type":"object","required":["role","content"],"title":"ResponseMessage"},"UrlCitationAnnotation":{"properties":{"type":{"type":"string","const":"url_citation","title":"Type","description":"The annotation type. Always `url_citation`.","default":"url_citation"},"url_citation":{"$ref":"#/components/schemas/UrlCitation","description":"The cited source."}},"type":"object","required":["type","url_citation"],"title":"UrlCitationAnnotation"},"UrlCitation":{"properties":{"url":{"type":"string","title":"Url","description":"URL of the cited source."},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Title of the cited source, when available."}},"type":"object","required":["url"],"title":"UrlCitation"},"Usage":{"properties":{"prompt_tokens":{"type":"integer","title":"Prompt Tokens","description":"Number of tokens in the prompt"},"completion_tokens":{"type":"integer","title":"Completion Tokens","description":"Number of tokens in the completion"},"total_tokens":{"type":"integer","title":"Total Tokens","description":"Total number of tokens used"},"cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Usd","description":"Lightning Rod total cost of the call in USD, summing inference and any research/classification costs."},"inference_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Inference Cost Usd","description":"Lightning Rod cost in USD attributable to model inference."},"research_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Research Cost Usd","description":"Lightning Rod cost in USD for web research, when `research` was enabled. Each source is billed as a separate RESEARCH event."},"classification_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Classification Cost Usd","description":"Lightning Rod cost in USD for question classification, when `answer_type` was `auto`."}},"type":"object","required":["prompt_tokens","completion_tokens","total_tokens"],"title":"Usage","description":"Token counts plus Lightning Rod cost fields. The `*_cost_usd` fields are present when applicable (research and classification costs only appear when those steps ran)."}}}}
```

## The ChatMessage object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"ChatMessage":{"properties":{"role":{"type":"string","title":"Role","description":"The role of the message author (system, user, or assistant)"},"content":{"type":"string","title":"Content","description":"The content of the message"}},"type":"object","required":["role","content"],"title":"ChatMessage"}}}}
```

## The Choice object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"Choice":{"properties":{"index":{"type":"integer","title":"Index","description":"The index of this choice"},"message":{"$ref":"#/components/schemas/ResponseMessage","description":"The message generated by the model"},"finish_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finish Reason","description":"The reason the model stopped generating tokens"}},"type":"object","required":["index","message"],"title":"Choice"},"ResponseMessage":{"properties":{"role":{"type":"string","title":"Role","description":"The role of the message author"},"content":{"type":"string","title":"Content","description":"The model's full response. When `answer_type` was set on the request, a machine-readable answer is embedded between `<answer></answer>` tags at the end (e.g. `<answer>0.62</answer>` for a binary probability). See the request's `answer_type` field for the per-type shapes."},"thinking":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thinking","description":"The model's reasoning/thinking chain, when returned by the model."},"annotations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/UrlCitationAnnotation"}},{"type":"null"}],"title":"Annotations","description":"Source citations from web research, present only when `research` ran. Each entry is a `url_citation` referencing a source the model used."}},"type":"object","required":["role","content"],"title":"ResponseMessage"},"UrlCitationAnnotation":{"properties":{"type":{"type":"string","const":"url_citation","title":"Type","description":"The annotation type. Always `url_citation`.","default":"url_citation"},"url_citation":{"$ref":"#/components/schemas/UrlCitation","description":"The cited source."}},"type":"object","required":["type","url_citation"],"title":"UrlCitationAnnotation"},"UrlCitation":{"properties":{"url":{"type":"string","title":"Url","description":"URL of the cited source."},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Title of the cited source, when available."}},"type":"object","required":["url"],"title":"UrlCitation"}}}}
```

## The CompletionChoice object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"CompletionChoice":{"properties":{"index":{"type":"integer","title":"Index","description":"The index of this choice"},"text":{"type":"string","title":"Text","description":"The generated text"},"finish_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finish Reason","description":"The reason the model stopped generating tokens"}},"type":"object","required":["index","text"],"title":"CompletionChoice"}}}}
```

## The CompletionRequest object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"CompletionRequest":{"properties":{"model":{"type":"string","title":"Model","description":"ID of the model to use"},"prompt":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}],"title":"Prompt","description":"The prompt(s) to generate completions for"},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature","description":"Sampling temperature between 0 and 2","default":0.6},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens","description":"Maximum number of tokens to generate"},"top_p":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Top P","description":"Nucleus sampling parameter"},"top_k":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Top K","description":"Number of top tokens to consider"},"min_p":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min P","description":"Minimum probability for a token to be considered"},"reasoning_effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasoning Effort","description":"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`."},"stream":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stream","description":"Whether to stream back partial progress","default":false},"n":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"N","description":"Number of completions to generate","default":1},"stop":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Stop","description":"Up to 4 sequences where the API will stop generating"},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed","description":"Deterministic sampling seed"},"research":{"anyOf":[{"type":"boolean"},{"$ref":"#/components/schemas/ResearchOptions"},{"type":"null"}],"title":"Research","description":"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`."},"answer_type":{"anyOf":[{"$ref":"#/components/schemas/AnswerTypeEnum"},{"type":"string","const":"auto"},{"type":"null"}],"title":"Answer Type","description":"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`."}},"type":"object","required":["model","prompt"],"title":"CompletionRequest"},"ResearchOptions":{"properties":{"sources":{"items":{"type":"string","enum":["perplexity","google_news"]},"type":"array","title":"Sources","description":"Which research source providers to use. Each provider is billed separately."}},"type":"object","title":"ResearchOptions","description":"Opt-in research enrichment for forecasting requests.\n\nWhen set, the API fetches web-grounded context from the requested sources\nand injects it into the prompt before calling the model. Each successful\nsource produces a billable RESEARCH event."},"AnswerTypeEnum":{"type":"string","enum":["BINARY","MULTIPLE_CHOICE","CONTINUOUS","CONTINUOUS_VALUE_ONLY","FREE_RESPONSE"],"title":"AnswerTypeEnum"}}}}
```

## The CompletionResponse object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"CompletionResponse":{"properties":{"id":{"type":"string","title":"Id","description":"A unique identifier for the completion"},"object":{"type":"string","const":"text_completion","title":"Object","description":"The object type","default":"text_completion"},"created":{"type":"integer","title":"Created","description":"Unix timestamp of when the completion was created"},"model":{"type":"string","title":"Model","description":"The model used for the completion"},"choices":{"items":{"$ref":"#/components/schemas/CompletionChoice"},"type":"array","title":"Choices","description":"A list of completion choices"},"usage":{"anyOf":[{"$ref":"#/components/schemas/Usage"},{"type":"null"}],"description":"Usage statistics for the completion request"}},"type":"object","required":["id","created","model","choices"],"title":"CompletionResponse"},"CompletionChoice":{"properties":{"index":{"type":"integer","title":"Index","description":"The index of this choice"},"text":{"type":"string","title":"Text","description":"The generated text"},"finish_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finish Reason","description":"The reason the model stopped generating tokens"}},"type":"object","required":["index","text"],"title":"CompletionChoice"},"Usage":{"properties":{"prompt_tokens":{"type":"integer","title":"Prompt Tokens","description":"Number of tokens in the prompt"},"completion_tokens":{"type":"integer","title":"Completion Tokens","description":"Number of tokens in the completion"},"total_tokens":{"type":"integer","title":"Total Tokens","description":"Total number of tokens used"},"cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Usd","description":"Lightning Rod total cost of the call in USD, summing inference and any research/classification costs."},"inference_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Inference Cost Usd","description":"Lightning Rod cost in USD attributable to model inference."},"research_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Research Cost Usd","description":"Lightning Rod cost in USD for web research, when `research` was enabled. Each source is billed as a separate RESEARCH event."},"classification_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Classification Cost Usd","description":"Lightning Rod cost in USD for question classification, when `answer_type` was `auto`."}},"type":"object","required":["prompt_tokens","completion_tokens","total_tokens"],"title":"Usage","description":"Token counts plus Lightning Rod cost fields. The `*_cost_usd` fields are present when applicable (research and classification costs only appear when those steps ran)."}}}}
```

## The ExpirationPolicy object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"ExpirationPolicy":{"properties":{"anchor":{"type":"string","const":"created_at","title":"Anchor"},"seconds":{"type":"integer","maximum":2592000,"minimum":3600,"title":"Seconds"}},"additionalProperties":false,"type":"object","required":["anchor","seconds"],"title":"ExpirationPolicy"}}}}
```

## The FileDeleted object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"FileDeleted":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","const":"file","title":"Object","default":"file"},"deleted":{"type":"boolean","const":true,"title":"Deleted","default":true}},"type":"object","required":["id"],"title":"FileDeleted"}}}}
```

## The FileObject object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"FileObject":{"properties":{"id":{"type":"string","title":"Id"},"bytes":{"type":"integer","minimum":0,"title":"Bytes"},"created_at":{"type":"integer","title":"Created At"},"filename":{"type":"string","title":"Filename"},"object":{"type":"string","const":"file","title":"Object","default":"file"},"purpose":{"type":"string","enum":["batch","batch_output"],"title":"Purpose"},"status":{"type":"string","enum":["uploaded","processed","error"],"title":"Status","default":"processed"},"expires_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires At"},"status_details":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Details"}},"type":"object","required":["id","bytes","created_at","filename","purpose"],"title":"FileObject"}}}}
```

## The HTTPValidationError object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## The ModelListResponse object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"ModelListResponse":{"properties":{"object":{"type":"string","const":"list","title":"Object","description":"The object type","default":"list"},"data":{"items":{"$ref":"#/components/schemas/ModelObject"},"type":"array","title":"Data","description":"A list of model objects"}},"type":"object","required":["data"],"title":"ModelListResponse"},"ModelObject":{"properties":{"id":{"type":"string","title":"Id","description":"The model identifier"},"object":{"type":"string","const":"model","title":"Object","description":"The object type","default":"model"},"created":{"type":"integer","title":"Created","description":"Unix timestamp of when the model was created","default":0},"owned_by":{"type":"string","title":"Owned By","description":"The organization that owns the model","default":"lightningrodlabs"},"name":{"type":"string","title":"Name","description":"Display name of the model","default":""},"description":{"type":"string","title":"Description","description":"Description of the model","default":""},"context_length":{"type":"integer","title":"Context Length","description":"Maximum context length in tokens","default":0},"max_completion_tokens":{"type":"integer","title":"Max Completion Tokens","description":"Maximum number of tokens to generate","default":0},"pricing":{"additionalProperties":true,"type":"object","title":"Pricing","description":"Per-token pricing"}},"type":"object","required":["id"],"title":"ModelObject"}}}}
```

## The ModelObject object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"ModelObject":{"properties":{"id":{"type":"string","title":"Id","description":"The model identifier"},"object":{"type":"string","const":"model","title":"Object","description":"The object type","default":"model"},"created":{"type":"integer","title":"Created","description":"Unix timestamp of when the model was created","default":0},"owned_by":{"type":"string","title":"Owned By","description":"The organization that owns the model","default":"lightningrodlabs"},"name":{"type":"string","title":"Name","description":"Display name of the model","default":""},"description":{"type":"string","title":"Description","description":"Description of the model","default":""},"context_length":{"type":"integer","title":"Context Length","description":"Maximum context length in tokens","default":0},"max_completion_tokens":{"type":"integer","title":"Max Completion Tokens","description":"Maximum number of tokens to generate","default":0},"pricing":{"additionalProperties":true,"type":"object","title":"Pricing","description":"Per-token pricing"}},"type":"object","required":["id"],"title":"ModelObject"}}}}
```

## The MppTopupRequest object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"MppTopupRequest":{"properties":{"amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount Cents","description":"Top-up size in cents. Defaults to 500 ($5.00). Must be identical on the challenge call and the paid retry."}},"type":"object","title":"MppTopupRequest"}}}}
```

## The MppTopupResponse object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"MppTopupResponse":{"properties":{"organization_id":{"type":"string","title":"Organization Id"},"credited_cents":{"type":"integer","title":"Credited Cents"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"api_key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key Id"}},"type":"object","required":["organization_id","credited_cents"],"title":"MppTopupResponse"}}}}
```

## The ResearchOptions object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"ResearchOptions":{"properties":{"sources":{"items":{"type":"string","enum":["perplexity","google_news"]},"type":"array","title":"Sources","description":"Which research source providers to use. Each provider is billed separately."}},"type":"object","title":"ResearchOptions","description":"Opt-in research enrichment for forecasting requests.\n\nWhen set, the API fetches web-grounded context from the requested sources\nand injects it into the prompt before calling the model. Each successful\nsource produces a billable RESEARCH event."}}}}
```

## The ResponseMessage object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"ResponseMessage":{"properties":{"role":{"type":"string","title":"Role","description":"The role of the message author"},"content":{"type":"string","title":"Content","description":"The model's full response. When `answer_type` was set on the request, a machine-readable answer is embedded between `<answer></answer>` tags at the end (e.g. `<answer>0.62</answer>` for a binary probability). See the request's `answer_type` field for the per-type shapes."},"thinking":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thinking","description":"The model's reasoning/thinking chain, when returned by the model."},"annotations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/UrlCitationAnnotation"}},{"type":"null"}],"title":"Annotations","description":"Source citations from web research, present only when `research` ran. Each entry is a `url_citation` referencing a source the model used."}},"type":"object","required":["role","content"],"title":"ResponseMessage"},"UrlCitationAnnotation":{"properties":{"type":{"type":"string","const":"url_citation","title":"Type","description":"The annotation type. Always `url_citation`.","default":"url_citation"},"url_citation":{"$ref":"#/components/schemas/UrlCitation","description":"The cited source."}},"type":"object","required":["type","url_citation"],"title":"UrlCitationAnnotation"},"UrlCitation":{"properties":{"url":{"type":"string","title":"Url","description":"URL of the cited source."},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Title of the cited source, when available."}},"type":"object","required":["url"],"title":"UrlCitation"}}}}
```

## The Usage object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"Usage":{"properties":{"prompt_tokens":{"type":"integer","title":"Prompt Tokens","description":"Number of tokens in the prompt"},"completion_tokens":{"type":"integer","title":"Completion Tokens","description":"Number of tokens in the completion"},"total_tokens":{"type":"integer","title":"Total Tokens","description":"Total number of tokens used"},"cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Usd","description":"Lightning Rod total cost of the call in USD, summing inference and any research/classification costs."},"inference_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Inference Cost Usd","description":"Lightning Rod cost in USD attributable to model inference."},"research_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Research Cost Usd","description":"Lightning Rod cost in USD for web research, when `research` was enabled. Each source is billed as a separate RESEARCH event."},"classification_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Classification Cost Usd","description":"Lightning Rod cost in USD for question classification, when `answer_type` was `auto`."}},"type":"object","required":["prompt_tokens","completion_tokens","total_tokens"],"title":"Usage","description":"Token counts plus Lightning Rod cost fields. The `*_cost_usd` fields are present when applicable (research and classification costs only appear when those steps ran)."}}}}
```

## The ValidationError object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## The UrlCitationAnnotation object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"UrlCitationAnnotation":{"properties":{"type":{"type":"string","const":"url_citation","title":"Type","description":"The annotation type. Always `url_citation`.","default":"url_citation"},"url_citation":{"$ref":"#/components/schemas/UrlCitation","description":"The cited source."}},"type":"object","required":["type","url_citation"],"title":"UrlCitationAnnotation"},"UrlCitation":{"properties":{"url":{"type":"string","title":"Url","description":"URL of the cited source."},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Title of the cited source, when available."}},"type":"object","required":["url"],"title":"UrlCitation"}}}}
```

## The UrlCitation object

```json
{"openapi":"3.1.0","info":{"title":"LightningRod API","version":"1.0.0"},"components":{"schemas":{"UrlCitation":{"properties":{"url":{"type":"string","title":"Url","description":"URL of the cited source."},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Title of the cited source, when available."}},"type":"object","required":["url"],"title":"UrlCitation"}}}}
```
