OpenAI Build Week Codex API Workflow Guide (2026): Hosted Shell, Costs, and Fallbacks
OpenAI opened Build Week on July 13, 2026, and the signal is obvious: Codex-style workflows are no longer just an IDE trick. The practical developer stack is moving toward API-driven agents that can plan, call tools, run code, inspect files, and hand back artifacts.
That’s exciting. It’s also where teams start burning money and creating security holes if they wire everything to one expensive model with unrestricted shell access. This guide shows a saner pattern: use GPT-5.6 or GPT-5.3-Codex where they fit, put shell and code interpreter behind clear boundaries, track container cost, and keep a fallback route ready before demo day turns into incident day.
TL;DR / Key Takeaways
- OpenAI Build Week opened on July 13, 2026, and project submissions are due on July 21, 2026.
- GPT-5.6 Sol costs $5.00 per million input tokens and $30.00 per million output tokens with a 1,050,000-token context window.
- GPT-5.3-Codex costs $1.75 per million input tokens and $14.00 per million output tokens with a 400,000-token context window.
- OpenAI hosted shell and code interpreter containers cost $0.03 for 1 GB, $0.12 for 4 GB, $0.48 for 16 GB, and $1.92 for 64 GB per 20-minute session.
- Hosted shell is available through the Responses API and is not available through the Chat Completions API.
Pricing Table: Models and Container Costs
| Item | Input price | Output price | Context window |
|---|---|---|---|
| GPT-5.6 Sol | $5.00 per 1M tokens | $30.00 per 1M tokens | 1,050,000 tokens |
| GPT-5.6 Terra | $2.50 per 1M tokens | $15.00 per 1M tokens | 1,050,000 tokens |
| GPT-5.6 Luna | $1.00 per 1M tokens | $6.00 per 1M tokens | 1,050,000 tokens |
| GPT-5.3-Codex | $1.75 per 1M tokens | $14.00 per 1M tokens | 400,000 tokens |
| Hosted shell / code interpreter, 1 GB container | $0.03 per 20-minute session | Not token-priced | Container expires after inactivity |
| Hosted shell / code interpreter, 4 GB container | $0.12 per 20-minute session | Not token-priced | Container expires after inactivity |
Model and Option Comparison
| Option | Best for | Concrete strength | Key limitation |
|---|---|---|---|
| GPT-5.6 Sol | Complex multi-step product builds | 1,050,000-token context and tool support through Responses API | Costs $30.00 per 1M output tokens before long-context uplift |
| GPT-5.6 Luna | Cheap planning, summaries, test generation, and routing | Costs $1.00 per 1M input tokens and $6.00 per 1M output tokens | Less suitable than Sol for hard architecture decisions |
| GPT-5.3-Codex | Agentic coding tasks and Codex-style environments | Costs $1.75 per 1M input tokens and supports 400,000-token contexts | Smaller context window than GPT-5.6 Sol |
| Hosted shell | Running deterministic terminal commands and producing files | Debian 12 environment with Python 3.11 and Node.js 22.16 preinstalled | No interactive TTY, no sudo, and network access is restricted by allowlists |
The Build Week Architecture I’d Use
A good Codex workflow has three layers. Don’t skip this split. It’s the difference between an agent that feels useful and an agent that becomes an expensive bash loop.
- Planner: reads the user goal, scopes the task, picks the model and tools.
- Executor: runs bounded actions: code edits, tests, file transforms, data analysis.
- Verifier: checks outputs, summarizes changes, and decides whether another pass is justified.
Use GPT-5.6 Sol when the planner needs broad context or hard judgment. Use GPT-5.6 Luna or GPT-5.3-Codex for cheaper focused passes. If you route everything to Sol, your prototype may work, but your cost curve will be ugly.
Minimal Responses API Pattern with Hosted Shell
Hosted shell is for deterministic work: list files, run tests, transform data, generate artifacts. Keep the command surface narrow. Ask the model to explain the command it wants to run, then execute only inside a sandboxed container.
curl -L 'https://api.openai.com/v1/responses' \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-5.6-sol",
"tools": [
{
"type": "shell",
"environment": { "type": "container_auto" }
}
],
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "Inspect /mnt/data, run the unit tests, and write a short findings file to /mnt/data/report.md."
}
]
}
],
"tool_choice": "auto"
}'
Two details matter. First, hosted shell runs through the Responses API, not Chat Completions. Second, OpenAI’s docs say hosted shell does not support interactive TTY sessions and does not run with sudo. That’s good. Your agent should not need root to win a hackathon challenge.
Python: A Small Router for Cost Control
The simplest cost win is routing by task class. Use a cheaper model for summaries and test plans. Escalate to Sol only when the task needs deep context or high-risk judgment.
from openai import OpenAI
client = OpenAI()
MODEL_BY_TASK = {
"plan": "gpt-5.6-luna",
"code": "gpt-5.3-codex",
"review": "gpt-5.6-sol",
}
def run_agent_step(task_type: str, prompt: str):
model = MODEL_BY_TASK.get(task_type, "gpt-5.6-luna")
return client.responses.create(
model=model,
input=prompt,
max_output_tokens=1200,
)
plan = run_agent_step(
"plan",
"Create a short implementation plan for a changelog summarizer."
)
print(plan.output_text)
If your production app already speaks OpenAI-compatible APIs, you can also keep KissAPI as a secondary route for model availability and fallback testing. The point isn’t to replace official APIs in every path. It’s to avoid having one provider, one key, and one failure mode.
Node.js: Add a Budget Guard Before Tool Calls
Tool calls are easy to forget in estimates because container pricing sits next to token pricing. Add a rough budget check before the agent spins up a 16 GB container for a task that only needed text.
import OpenAI from "openai";
const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
function chooseMemoryLimit(inputBytes) {
if (inputBytes < 5_000_000) return "1g";
if (inputBytes < 80_000_000) return "4g";
return "16g";
}
export async function analyzeCsv(csvText) {
const memoryLimit = chooseMemoryLimit(Buffer.byteLength(csvText));
return client.responses.create({
model: "gpt-5.6-terra",
tools: [{
type: "code_interpreter",
container: { type: "auto", memory_limit: memoryLimit }
}],
input: `Use the python tool to summarize this CSV:\n\n${csvText}`
});
}
For many workflows, 1 GB is enough. Jumping to larger containers by default is lazy engineering. Pay for memory when the file size or workload demands it, not because the dropdown made it easy.
Security Rules for Codex-Style Workflows
- Never give shell unrestricted network access. If you enable network access, use a tight allowlist.
- Store artifacts outside the container. Containers are ephemeral; download outputs you need before expiry.
- Log tool calls. Debugging agent behavior without tool logs is miserable.
- Separate user text from commands. Treat user-provided files and prompts as untrusted input.
- Cap retries. A failing test loop can become a quiet token and container bill.
This is also where an API gateway earns its keep. With KissAPI, teams can test OpenAI-compatible fallback routes, compare model costs, and keep one client-side integration while routing different steps to different models.
FAQ
What is OpenAI Build Week in July 2026?
OpenAI Build Week is a Codex-focused developer challenge that opened on July 13, 2026. The submission deadline is July 21, judging runs from July 22 to August 7, and winners are scheduled for August 12.
Should I use GPT-5.6 Sol or GPT-5.3-Codex for coding agents?
Use GPT-5.6 Sol when you need broad reasoning, large context, or high-stakes architectural judgment. Use GPT-5.3-Codex for focused agentic coding tasks where a 400,000-token context window is enough and lower output cost matters.
Does hosted shell work through Chat Completions?
No. OpenAI’s hosted shell tool is available through the Responses API. It is not available through the Chat Completions API.
Build With a Backup Route
Keep your Codex-style app running when one model is slow, expensive, or unavailable. Create a free KissAPI account and test an OpenAI-compatible fallback before launch.
Start Free