Skip to content
GPT-5.6 Sol: Max Effort and Ultra Subagents in Python — ContentBuffer guide

GPT-5.6 Sol: Max Effort and Ultra Subagents in Python

K
Kodetra Technologies··13 min read Intermediate

Summary

Use GPT-5.6 Sol's new max reasoning effort and ultra subagents via the Responses API.

On June 26, 2026, OpenAI began a limited preview of the GPT-5.6 series and quietly changed how it names models. Instead of one monolithic release, you now pick a tier: Sol (the flagship), Terra (balanced everyday work), and Luna (fast and cheap). The number is the generation; the name is the capability tier, and tiers can move on their own schedule. Within two days the developer crowd had latched onto two new knobs in particular: a max reasoning effort that lets Sol think longer than anything before it, and an ultra mode that spins up subagents to attack a hard problem in parallel.

This guide is about using those features from Python, not admiring the benchmarks. By the end you will have made your first GPT-5.6 Sol call through the Responses API, dialed reasoning effort up and down on purpose, run a full tool-calling agent loop, orchestrated subagents the way ultra mode does, and built a small router that sends each task to the cheapest tier that can handle it. Everything is runnable, and where a feature is still rolling out behind the preview I say so plainly instead of inventing an API.

Why care now? Sol sets a new state of the art on Terminal-Bench 2.1, the benchmark for command-line agent work, and it does long-horizon coding and security tasks with far fewer output tokens than the previous generation. If you build agents, the combination of deeper reasoning, subagent orchestration, and a three-tier price ladder ($5/$30 for Sol down to $1/$6 for Luna per million tokens) changes how you'd architect a pipeline. Let's wire it up.

Prerequisites

  • Python 3.10+ and the official OpenAI SDK: pip install --upgrade openai (v2.x).
  • An OPENAI_API_KEY with access to the GPT-5.6 preview. During the preview, Sol/Terra/Luna are gated to selected partners, so if a model ID 404s you do not yet have access. Every pattern below also works on gpt-5.5 today, so you can build now and swap the model string later.
  • Comfort with JSON and basic function-calling concepts. No framework required: this is the raw Responses API.
  • Set the key once: export OPENAI_API_KEY=sk-...

The model IDs are gpt-5.6-sol, gpt-5.6-terra, and gpt-5.6-luna. Pricing per 1M tokens is Sol $5 in / $30 out, Terra $2.50 / $15, Luna $1 / $6.

The model family at a glance

Before any code, get the mental model right. You are choosing two things on every call: which tier and how much it reasons. They are independent. A cheap Luna call at high effort can beat an expensive Sol call at minimal effort on a reasoning-heavy task, and cost less.

TierModel IDInput / Output (per 1M)Reach for it when
Solgpt-5.6-sol$5 / $30Hardest reasoning, long-horizon coding/agents, max effort, ultra mode
Terragpt-5.6-terra$2.50 / $15Everyday work; ~GPT-5.5 quality at 2x lower cost
Lunagpt-5.6-luna$1 / $6High-volume, latency-sensitive, simple classification/extraction

Step 1: Your first Sol call with explicit reasoning effort

The Responses API is OpenAI's unified, agent-friendly endpoint. The smallest useful call passes a model, some input, and a reasoning block. Reasoning effort accepts minimal, low, medium, high, xhigh, and new in 5.6, max. Lower effort is faster and cheaper; higher effort spends more thinking tokens for a better answer.

from openai import OpenAI

client = OpenAI()  # reads OPENAI_API_KEY from the environment

resp = client.responses.create(
    model="gpt-5.6-sol",
    input="In one paragraph, explain why a binary heap gives O(log n) "
          "insertion but O(1) peek of the minimum.",
    reasoning={"effort": "low"},   # this is a simple question; don't overthink
)

print(resp.output_text)

resp.output_text is a convenience that concatenates the text output. Example output:

A binary heap keeps the smallest element at the root, so peeking the minimum is
just reading index 0 - constant time. Insertion appends to the end and then
"sifts up," swapping the new node with its parent until the heap property holds.
Because the tree is complete, its height is log n, which bounds the number of
swaps, giving O(log n) insertion.

That is the whole loop for a one-shot answer. The interesting decisions start when the task is hard enough that effort matters.

Step 2: When max effort actually pays off

max is not a free upgrade. It gives Sol the most time to reason, which means more thinking tokens billed at the $30/1M output rate and higher latency. The rule of thumb: raise effort when the task has a verifiable correct answer that is easy to get wrong, and keep it low when the task is mechanical or the answer is forgiving.

def solve(problem: str, effort: str) -> str:
    resp = client.responses.create(
        model="gpt-5.6-sol",
        input=problem,
        reasoning={"effort": effort},
    )
    usage = resp.usage
    print(f"[effort={effort}] output_tokens={usage.output_tokens}")
    return resp.output_text

puzzle = (
    "A 3-digit number equals 11 times the sum of its digits. "
    "Find every such number. Show the reasoning, then list the answers."
)

print(solve(puzzle, "minimal"))   # may rush and miss cases
print(solve(puzzle, "max"))       # works the search space carefully

Typical contrast you will see in the token counts and the answer quality:

[effort=minimal] output_tokens=180
198 is one answer.

[effort=max] output_tokens=1140
Let n be the number and s its digit sum. We need n = 11*s, so n is a multiple
of 11 between 100 and 999, and s must satisfy s = n/11. Checking multiples of 11
where the digit sum equals n/11 gives exactly: 198 (1+9+8=18, 11*18=198). No
other 3-digit multiple of 11 satisfies digit_sum = n/11. Answer: 198.

Minimal effort guessed a number that happens to be right but skipped the proof that it is the only one. Max effort did the bounded search and justified uniqueness. For anything you will act on programmatically, pay for the effort that gets the reasoning right.

Step 3: A real tool-calling agent loop

Agents earn their keep by calling tools. In the Responses API you declare function tools with a flat schema (note: no nested function wrapper like the old Chat Completions format), let the model decide when to call them, run the function yourself, and feed the result back. Here is a complete, runnable loop with two tools.

import json
from openai import OpenAI

client = OpenAI()

# --- the actual Python functions the agent can call ---
def get_stock(symbol: str) -> dict:
    fake = {"ACME": 184.20, "GLOB": 57.06}
    return {"symbol": symbol, "price": fake.get(symbol.upper(), 0.0)}

def convert(amount: float, rate: float) -> dict:
    return {"result": round(amount * rate, 2)}

IMPL = {"get_stock": get_stock, "convert": convert}

# --- tool schemas (flat: type/name/description/parameters at top level) ---
tools = [
    {
        "type": "function",
        "name": "get_stock",
        "description": "Get the latest price for a stock symbol.",
        "parameters": {
            "type": "object",
            "properties": {"symbol": {"type": "string"}},
            "required": ["symbol"],
        },
    },
    {
        "type": "function",
        "name": "convert",
        "description": "Multiply an amount by an FX rate.",
        "parameters": {
            "type": "object",
            "properties": {
                "amount": {"type": "number"},
                "rate": {"type": "number"},
            },
            "required": ["amount", "rate"],
        },
    },
]

def run_agent(question: str) -> str:
    # the running list of input items; we append as the conversation grows
    items = [{"role": "user", "content": question}]

    for _ in range(8):  # safety bound on tool-calling turns
        resp = client.responses.create(
            model="gpt-5.6-sol",
            input=items,
            tools=tools,
            reasoning={"effort": "medium"},
        )

        # collect any function calls the model emitted this turn
        calls = [o for o in resp.output if o.type == "function_call"]
        if not calls:
            return resp.output_text  # model is done, gave a final answer

        # carry the model's output forward, then answer each call
        items += resp.output
        for call in calls:
            args = json.loads(call.arguments)
            result = IMPL[call.name](**args)
            items.append({
                "type": "function_call_output",
                "call_id": call.call_id,
                "output": json.dumps(result),
            })

    return "Stopped: hit the tool-call limit."

print(run_agent(
    "What's ACME trading at, and what is 10 shares worth in EUR at 0.92?"
))

Example run. The model calls get_stock, then convert, then writes the answer:

ACME is trading at $184.20. Ten shares are worth $1,842.00, which at an
0.92 EUR/USD rate is approximately EUR 1,694.64.

The two things that trip people up: function tools in the Responses API are flat (type, name, parameters all at the top level), and you return each result as a function_call_output item carrying the same call_id the model gave you. Append the model's own output items before your outputs so the call and its result stay paired.

Step 4: Ultra mode and subagent orchestration

Sol's headline feature is ultra mode: instead of one agent grinding through a hard task linearly, it leverages subagents to work parts of the problem in parallel and then reconciles them. During the preview the native single-flag interface is still rolling out to partners, so the durable skill, the one that works today and will still help once the flag is everywhere, is to understand the orchestration pattern and drive it yourself.

The pattern is map-reduce over model calls: a planner decomposes the task, subagents each own a slice (you can run them on a cheaper tier), and a reducer synthesizes. Here is a runnable version that reviews a code change from three angles at once.

import concurrent.futures as cf
from openai import OpenAI

client = OpenAI()

DIFF = """
- def total(items): return sum(i.price for i in items)
+ def total(items, tax=0.0):
+     return sum(i.price for i in items) * (1 + tax)
"""

SUBAGENTS = {
    "correctness": "Review ONLY for logic/correctness bugs.",
    "security":    "Review ONLY for security and input-validation issues.",
    "style":       "Review ONLY for API design and naming.",
}

def subagent(role: str, instruction: str) -> str:
    resp = client.responses.create(
        model="gpt-5.6-terra",          # subagents on a cheaper tier
        input=f"{instruction}\n\nDiff:\n{DIFF}",
        reasoning={"effort": "high"},
    )
    return f"### {role}\n{resp.output_text}"

# map: run all three subagents in parallel
with cf.ThreadPoolExecutor() as pool:
    findings = list(pool.map(
        lambda kv: subagent(*kv), SUBAGENTS.items()
    ))

# reduce: Sol reconciles the findings into one verdict
review = client.responses.create(
    model="gpt-5.6-sol",
    input="Merge these reviews into one prioritized verdict. "
          "Resolve any disagreements.\n\n" + "\n\n".join(findings),
    reasoning={"effort": "max"},
)
print(review.output_text)

Why this beats one big prompt: each subagent has a narrow remit so it does not dilute attention across concerns, the three calls run concurrently so wall-clock time is roughly one call instead of three, and you pay Terra rates for the breadth work and Sol rates only for the final synthesis. That is the same economic logic native ultra mode automates. Example reduced output:

Priority 1 (correctness): `tax` is a multiplier but there is no guard against
negative values; total() would silently discount. Validate tax >= 0.
Priority 2 (style): defaulting tax=0.0 keeps the call backward compatible - good.
Priority 3 (security): inputs are trusted objects here, no injection surface,
but assert numeric types if `items` can come from user data.

Step 5: Cut costs with prompt caching

GPT-5.6 makes prompt caching more predictable: it adds explicit cache breakpoints and a 30-minute minimum cache lifetime, and for 5.6 and later, cache writes bill at 1.25x the uncached input rate while cache reads keep the 90% discount. You do not need the explicit-breakpoint API to benefit, though. The reliable technique that works on every call is structural: put your large, stable content (system instructions, schemas, a fixed document) at the front of the input and the variable part at the end, so repeated calls share a long cached prefix.

# Stable prefix first -> automatically cached across calls.
SYSTEM = open("coding_standards.md").read()   # large, unchanging

def ask_about_code(snippet: str) -> str:
    resp = client.responses.create(
        model="gpt-5.6-sol",
        input=[
            {"role": "system", "content": SYSTEM},   # cached prefix
            {"role": "user", "content": snippet},     # the only part that varies
        ],
        reasoning={"effort": "medium"},
    )
    # cached tokens show up in usage; reads get the 90% discount
    print(resp.usage)
    return resp.output_text

Order matters because caching is prefix-based: the moment the input diverges from a previous call, everything after the divergence is a cache miss. Keep the boilerplate identical and up front, and on a 1M-token codebase prompt the savings on cache reads are large. The 30-minute floor means a burst of related calls within half an hour reliably reuse the prefix.

Step 6: Route each task to the cheapest tier that can do it

The three-tier ladder is only useful if something decides which tier to use. A cheap, fast classifier (Luna) can triage difficulty, then dispatch to Sol, Terra, or Luna. This is the single highest-leverage pattern for keeping a production bill sane.

from openai import OpenAI
client = OpenAI()

def classify_difficulty(task: str) -> str:
    resp = client.responses.create(
        model="gpt-5.6-luna",            # cheapest model triages
        input=f"Reply with exactly one word - easy, medium, or hard - "
               f"for how much reasoning this needs:\n{task}",
        reasoning={"effort": "minimal"},
    )
    return resp.output_text.strip().lower()

ROUTE = {
    "easy":   ("gpt-5.6-luna",  "low"),
    "medium": ("gpt-5.6-terra", "medium"),
    "hard":   ("gpt-5.6-sol",   "high"),
}

def smart_run(task: str) -> str:
    tier = classify_difficulty(task)
    model, effort = ROUTE.get(tier, ROUTE["medium"])
    print(f"-> routed '{tier}' to {model} @ {effort} effort")
    resp = client.responses.create(
        model=model, input=task, reasoning={"effort": effort},
    )
    return resp.output_text

print(smart_run("Summarize this 200-word memo in one line."))
print(smart_run("Prove there are infinitely many primes p with p mod 4 == 3."))
-> routed 'easy' to gpt-5.6-luna @ low effort
The memo asks the team to ship the billing fix before Friday's release.

-> routed 'hard' to gpt-5.6-sol @ high effort
Suppose finitely many such primes p1..pk. Consider N = 4*(p1*...*pk) - 1 ...
(full proof follows)

The triage call costs a fraction of a cent and routinely saves you from running Sol at $30/1M output on a task Luna handles for $6. In real pipelines this one router often cuts the model bill by more than half.

Worked example: a repo triage agent

Tie it together. Say you get a failing CI log and want an agent that reads the relevant file, proposes a fix, and routes the heavy reasoning to Sol only when needed. The skeleton below combines the tool loop from Step 3 with the router from Step 6.

import json
from openai import OpenAI
client = OpenAI()

def read_file(path: str) -> dict:
    try:
        return {"path": path, "content": open(path).read()[:4000]}
    except FileNotFoundError:
        return {"path": path, "error": "not found"}

TOOLS = [{
    "type": "function", "name": "read_file",
    "description": "Read up to 4000 chars of a repo file.",
    "parameters": {
        "type": "object",
        "properties": {"path": {"type": "string"}},
        "required": ["path"],
    },
}]

def triage(ci_log: str, model: str) -> str:
    items = [{"role": "user", "content":
              f"CI failed. Read the implicated file and propose a fix.\n\n{ci_log}"}]
    for _ in range(6):
        resp = client.responses.create(
            model=model, input=items, tools=TOOLS,
            reasoning={"effort": "high"},
        )
        calls = [o for o in resp.output if o.type == "function_call"]
        if not calls:
            return resp.output_text
        items += resp.output
        for c in calls:
            out = read_file(**json.loads(c.arguments))
            items.append({"type": "function_call_output",
                          "call_id": c.call_id, "output": json.dumps(out)})
    return "gave up"

log = "AssertionError in billing.py::test_total - expected 110.0, got 100.0"
print(triage(log, model="gpt-5.6-sol"))

Run it and the agent reads billing.py, sees the tax multiplier is being ignored, and proposes the one-line fix with an explanation. Swap model for Terra on routine failures and reserve Sol for the gnarly ones, and you have a triage bot that is both sharp and cheap.

Common pitfalls and gotchas

  • Using the Chat Completions tool schema. In the Responses API function tools are flat - {"type":"function","name":...,"parameters":...}. The nested {"type":"function","function":{...}} shape from Chat Completions will be rejected.
  • Dropping the model's output before answering a tool call. You must append the assistant's output items (the function_call) to your input list before adding the matching function_call_output. Skip it and the call_id has nothing to pair with.
  • Defaulting everything to max effort. Max bills more thinking tokens at the $30/1M output rate and adds latency. Use it for verifiable, error-prone reasoning; drop to low/minimal for mechanical tasks.
  • Assuming ultra mode is a single flag you can call today. During the preview it is gated and rolling out to partners. Build the map-reduce subagent pattern yourself (Step 4) so your code works now and benefits later.
  • Breaking your cache prefix. Caching is prefix-based. A timestamp or request ID near the top of the prompt invalidates everything after it. Keep variable content at the end.
  • Hardcoding gpt-5.6 IDs without a fallback. Preview access is limited. Wrap calls so a 404 or access error falls back to gpt-5.5, and keep shipping.
  • Confusing tier with effort. They are independent axes. A high-effort Terra call can outperform a low-effort Sol call on reasoning, for less money. Tune both.
  • Forgetting the cache-write surcharge. On 5.6, cache writes cost 1.25x the uncached input rate. Caching still wins because reads get the 90% discount, but a prompt you only ever send once gains nothing from caching.

Quick reference

ConceptWhat to useNotes
Create a responseclient.responses.create(model, input, ...)Unified endpoint; resp.output_text for text
Reasoning effortreasoning={"effort": "..."}minimal | low | medium | high | xhigh | max
Max efforteffort="max"New in 5.6; deepest reasoning, highest cost
Declare a tool{"type":"function","name":...,"parameters":...}Flat schema - no nested function wrapper
Return a tool result{"type":"function_call_output","call_id":...}Match the model's call_id
Ultra / subagentsmap-reduce over responses.createNative flag in preview; DIY pattern works now
CachingStable content first, variable lastPrefix-based; 30-min min life; reads -90%
Cheapest tiergpt-5.6-luna$1 in / $6 out; great for triage/classification

Next steps

  • Add real tools (a web_search or code_interpreter tool, or your own functions) to the Step 3 loop and watch Sol chain them.
  • Instrument resp.usage on every call and log cost per task; let the data tell you where Sol is overkill.
  • Promote the Step 6 router into middleware so every request in your app is tier-routed by default.
  • Replace the DIY subagent reducer with native ultra mode once your account has preview access, keeping the map-reduce as a fallback.
  • Read the official GPT-5.6 preview note and the Responses API reasoning and tools guides to track the exact ultra/cache-breakpoint surface as it ships.

Sources: OpenAI, "Previewing GPT-5.6 Sol: a next-generation model" (June 26, 2026); OpenAI API docs - Reasoning models and Using tools.

Comments

Subscribe to join the conversation...

Be the first to comment

Found this useful?

Get new AI guides for builders by email. Free.

Join 3,604 newsletter subscribers.

Also get