Use this file to discover all available pages before exploring further.
You don’t need a new SDK. Add one line to what you already have.
from openai import OpenAIclient = OpenAI( api_key=os.environ["OPENAI_API_KEY"])
That’s it. Works with GPT-4o, Claude, Gemini, DeepSeek, Llama, Grok, Mistral, Qwen, and 2,050+ model combinations via OpenRouter.
The base_url is required — Stratus does not auto-detect it. Set STRATUS_API_KEY to your Stratus key (stratus_sk_live_...). No LLM provider key needed to get started — Formation’s pool handles requests automatically. See Authentication for details and BYOK options.
with client.chat.completions.stream( model="stratus-x1ac-base-gpt-4o", messages=[{"role": "user", "content": "Plan the deployment steps."}]) as stream: for chunk in stream: content = chunk.choices[0].delta.content or "" print(content, end="")
Every response includes planning metadata from the X1 world model:
response = client.chat.completions.create(...)response.stratus.action_sequence # list[str] — predicted action chainresponse.stratus.overall_confidence # float — 0–1 prediction confidenceresponse.stratus.planning_time_ms # int — world model inference time
Use confidence as a gate before executing:
result = client.chat.completions.create(...)if result.stratus.overall_confidence < 0.8: # Re-describe state with more detail before proceeding print("Low confidence — refine state description")
Simulate a full action plan before anything executes:
from stratus_sdk import StratusClientstratus = StratusClient(api_key=os.environ["STRATUS_API_KEY"])plan = stratus.rollout( goal="Complete the checkout flow", initial_state="Cart page, 3 items, coupon field visible", max_steps=8)if plan.summary.outcome == "success": for pred in plan.predictions: print(f"Step {pred.step}: {pred.action.action_name}")
Or call the endpoint directly — no extra package needed: