Python SDK
Structured predictions with lr.predict()
Last updated
Was this helpful?
Was this helpful?
import lightningrod as lr
client = lr.LightningRod(api_key="your-api-key")
result = client.predict(
"Will the Fed cut interest rates in 2026?",
answer_type="binary",
)
print(result.binary.probability)
print(result.content)result = client.predict(
"Will the Fed cut interest rates in 2026?",
research=["perplexity", "google_news"],
)
for source in result.sources:
print(source.title, source.url)
print(result.usage.research_cost_usd)result = client.predict(
"Will the Fed cut interest rates in 2026?",
reasoning_effort="low",
)
print(result.content)
print(result.usage.total_tokens)