Skip to main content
You don’t need a new SDK. Add one line to what you already have.
from openai import OpenAI

client = 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.

Installation

pip install openai
You already have this. Nothing new to install.

Making Calls

Chat Completions

response = client.chat.completions.create(
    model="stratus-x1ac-base-gpt-4o",
    messages=[
        {"role": "system", "content": "Current state: checkout page, 3 items in cart"},
        {"role": "user",   "content": "Proceed to checkout"}
    ]
)

print(response.choices[0].message.content)
# → "Click the Proceed to Checkout button"

# Stratus-specific planning metadata
print(response.stratus.action_sequence)  # ['click', 'wait', 'verify']
print(response.stratus.overall_confidence)       # 0.94

Messages (Anthropic-style)

Works with Anthropic’s client too:
import anthropic

client = anthropic.Anthropic(
    api_key=os.environ["STRATUS_API_KEY"],
    base_url="https://api.stratus.run"
)

message = client.messages.create(
    model="stratus-x1ac-base-claude-sonnet-4-5",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Plan the next steps."}]
)

Streaming

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="")

Models

stratus-x1ac-small-gpt-4o-mini

Lowest cost. Simple classification, routing, and action selection.

stratus-x1ac-base-gpt-4o

Balanced. Most use cases — web navigation, form completion, task planning.

stratus-x1ac-large-gpt-4o

Complex reasoning. Multi-step workflows, cascade prediction, concurrent coordination.

stratus-x1ac-base-claude-sonnet-4-5

Claude backbone. Best for long-context planning and nuanced state reasoning.
See Models for the full list and credit costs per model.

The stratus Response Field

Every response includes planning metadata from the X1 world model:
response = client.chat.completions.create(...)

response.stratus.action_sequence   # list[str] — predicted action chain
response.stratus.overall_confidence        # float    — 0–1 prediction confidence
response.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")

Optional: stratus-sdk-py

For vector compression and trajectory simulation, install the Stratus Python SDK:
pip install stratus-sdk-py

Rollout (Pre-Execution Simulation)

Simulate a full action plan before anything executes:
from stratus_sdk import StratusClient

stratus = 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:
import requests

plan = requests.post(
    "https://api.stratus.run/v1/rollout",
    headers={
        "Authorization": f"Bearer {os.environ['STRATUS_API_KEY']}",
        "Content-Type": "application/json"
    },
    json={
        "goal": "Complete the checkout flow",
        "initial_state": "Cart page, 3 items, coupon field visible",
        "max_steps": 8
    }
).json()

Vector Compression

Compress embedding vectors 10–20× with 99%+ quality:
from stratus_sdk import compress, decompress, compress_batch, analyze_quality

# Single vector: 6144 bytes → ~600 bytes
compressed = compress(embedding)
restored = decompress(compressed)

# Batch
compressed = compress_batch(embeddings)

# Verify quality before deploying
report = analyze_quality(embeddings, decompress_batch(compressed))
print(report.summary)  # "GOOD (97.2%). Cosine: 99.23%, Recall@10: 95.8%"

Next Steps

Authentication

Set up your Stratus key. Optionally add provider keys to remove the Formation pool markup.

Tutorials

Real-world agents — navigation, cascades, concurrency.

API Reference

Full endpoint docs, parameters, and error codes.