Claude Opus 5.5 vs GPT-6 Astra: How Coding Agents Wire JSON, Tool Calling, and Structured Output
Both flagships target long-running coding agents, but the JSON contracts live on different APIs. Opus 5.5 uses Anthropic Messages: tools[].input_schema, reply blocks tool_use / write-back tool_result, structured objects via output_config.format. GPT-6 Astra uses OpenAI Responses: text.format, flat tools[], output items function_call, continuations via previous_response_id. This post is a field map and host checklist—not a model leaderboard.
Before you read
| Dimension | Claude Opus 5.5 | GPT-6 Astra |
|---|---|---|
| API surface | POST /v1/messages; continue with messages[] | POST /v1/responses; continue with previous_response_id |
| Structured output | output_config.format type json_schema strict | text.format type json_schema strict |
| Tool calling | tools[].input_schema; tool_use / tool_result | flat tools[]; function_call / function_call_output |
| tool_choice | forced tool name errors; narrow with Schema | auto / none on Responses; tools belong here post-DevDay |
| Session | host-built messages[] (plus optional session_id state) | previous_response_id chain; Decisions routing is separate |
Facts through 2026-11-02: Anthropic Opus 5.5 docs, OpenAI Astra / Responses migration and Structured Outputs docs. A-1042 and resp_8k1a are fictional.
Different API shapes—not the same “JSON mode”
A coding-agent host usually juggles three jobs: a structured object for the UI, tool arguments the model requests, and the next hop after write-back. Opus 5.5 and Astra can both do it, but field names and continuations differ:
- Opus 5.5 declares
input_schemaon Messages tools; the model returnstool_use(inputis already an object). Extraction usesoutput_config.format, not a schema pasted into user text. - GPT-6 Astra with tools should use Responses: flat
type/name/parameters,argumentsoften a string; write back withfunction_call_outputoncall_id. Objects usetext.format. - Host duties stay: Schema validation, permissions, side effects, persisted state. Swapping models does not remove the JSON gate—it changes parsers and id fields.
Deep dives: Opus 5.5 deep dive and GPT-6 Astra deep dive. OpenAI post-DevDay split: DevDay Structured Output. Generic coding loop: Coding agent loop.
Opus tools / format vs Astra text.format / flat tools
1. Opus 5.5: Messages + input_schema tool table. Same fictional order A-1042 as in coding-agent walkthroughs:
{
"model": "claude-opus-5-5",
"max_tokens": 16000,
"effort": "medium",
"tools": [{
"name": "lookup_order",
"description": "Look up an order by ID. Confirm before any refund.",
"input_schema": {
"type": "object",
"properties": {
"order_id": { "type": "string", "pattern": "^[A-Z]-\\d{4}$" }
},
"required": ["order_id"],
"additionalProperties": false
}
}],
"messages": [{
"role": "user",
"content": "Look up order A-1042 and say if it is paid."
}]
}
2. Opus 5.5: UI objects via output_config.format. Keep that separate from tool calls; do not force a tool and a giant routing schema in one request.
{
"model": "claude-opus-5-5",
"max_tokens": 8192,
"effort": "medium",
"messages": [{
"role": "user",
"content": "Extract order A-1042 as JSON for the UI."
}],
"output_config": {
"format": {
"type": "json_schema",
"strict": true,
"schema": {
"type": "object",
"properties": {
"order_id": { "type": "string", "pattern": "^[A-Z]-\\d{4}$" },
"status": { "type": "string", "enum": ["paid", "open"] }
},
"required": ["order_id", "status"],
"additionalProperties": false
}
}
}
}
3. Astra: Responses + text.format for fields. Official Structured Outputs hook is text.format, not Chat Completions response_format.
{
"model": "gpt-6-astra",
"input": "Jane paid order A-1042.",
"text": {
"format": {
"type": "json_schema",
"name": "order_extract",
"strict": true,
"schema": {
"type": "object",
"properties": {
"order_id": { "type": "string", "pattern": "^[A-Z]-\\d{4}$" },
"status": { "type": "string", "enum": ["paid", "open"] }
},
"required": ["order_id", "status"],
"additionalProperties": false
}
}
}
}
4. Astra: side effects via flat strict tools + previous_response_id. Do not stringify whole function_call history by hand; chain with response ids.
{
"model": "gpt-6-astra",
"previous_response_id": "resp_8k1a",
"tools": [{
"type": "function",
"name": "lookup_order",
"strict": true,
"parameters": {
"type": "object",
"properties": {
"order_id": { "type": "string", "pattern": "^[A-Z]-\\d{4}$" }
},
"required": ["order_id"],
"additionalProperties": false
}
}],
"input": [{
"role": "user",
"content": [{ "type": "input_text", "text": "Look up A-1042 if needed." }]
}]
}
One coding agent—which API for which job?
Choose by return contract, not by “smarter model.” Assume your host already has a vendor adapter:
| You need | Opus 5.5 | GPT-6 Astra |
|---|---|---|
| Structured object for UI / downstream | Messages output_config.format json_schema | Responses text.format json_schema |
| DB lookup, file edit, shell | tools + tool_use; tool_result write-back | Responses flat tools + function_call_output |
| Long multi-turn job (dozens of turns) | messages[] + host JSON state | previous_response_id chain + host state |
| Force “must call lookup_order” | avoid forced tool_choice; use Schema + prompt | tool_choice auto/none; do not assume forced is stable |
| Bounded OpenAI routing (queue / escalate?) | host rules or Decisions if on OpenAI stack | Decisions answers; see DevDay split post |
Programmatic Tool Calling and hosted Agents loops are OpenAI-side capabilities; Opus hosts still speak Messages. Your abstraction should store raw output items plus normalized business JSON—not one vendor string only.
Five steps to wire both stacks
Run the same fictional ticket on Opus and Astra in staging before production:
- Split three contracts. UI object schema, each tool’s parameters/input_schema, write-back result schema.
- Opus Messages adapter. Parse tool_use.id → execute → tool_result.tool_use_id.
- Astra Responses adapter. Parse function_call.call_id → function_call_output.
- Keep structured paths separate. Opus: output_config.format; Astra: text.format; do not mix into tool requests.
- Persist vendor-neutral facts in state. order_id, route, pending_tool in JSON state; raw call ids only for write-back alignment.
Five-segment loop fields (Request → Call → Result → State → Next) live in the Agent JSON State post; here we only ensure Call/Result shapes swap with vendor.
Spread arguments, input, and format output
Dual-stack bugs are usually “Astra call_id written into Opus tool_result” or “parse tool_use.input as a string twice.”
- Use format on tool_use.input, function_call.arguments, and format results; Schema validation on both sides’ schemas.
- Use JSON Diff on the same turn’s Opus messages vs Astra input items; confirm no leftover response_format.
- Use JSONPath on host state for last_order_id; match tool args.
- Loop field checklist: Agent JSON state.
- JSONSort runs locally—do not upload real repo paths or keys.
Migration is done when each vendor’s JSON passes Schema—not when “both parse.”
Common mistakes
- Assuming both vendors share Chat Completions function wrappers. Astra with tools should use flat Responses tools.
- Using forced tool_choice as an Opus stabilizer. The supported path errors; narrow with Schema and descriptions.
- Stuffing output_config.format and tools into one Messages “god schema.” Split objects and side effects across requests or turns.
- Ignoring string arguments. Astra function_call needs parse + Schema; Opus tool_use.input is an object but still must validate.
- Chaining previous_response_id while silently changing tools[] version. Log tools version with response ids for replay.
- Writing a “who wins” pick. Facts are API and id differences; choose on compliance, latency, existing stack, and hosted features.
FAQ
Can Opus use OpenAI Responses?
Do not mix APIs. Your service can unify business JSON, but HTTP shapes must follow each vendor’s docs.
Can Astra stay on Chat Completions?
Requests without tools can; tool calling on Astra should move to Responses. See post-DevDay migration notes.
Does Structured Output replace Tool Calling?
No. format/json_schema constrains model text; side effects still need the tool channel and host execution.
Where does MCP fit?
MCP is how the host talks to external tools; the model still emits tool_use or function_call. MCP does not replace Schema gates.
Default Opus with Astra fallback?
Possible, but you need two parsers, two write-back id rules, and separate replay logs. Do not assume output items match.
Conclusion
Claude Opus 5.5 and GPT-6 Astra both push long-horizon tool JSON for coding agents, but contracts sit on different APIs: Messages + output_config + tool_use versus Responses + text.format + function_call.
Draw three schemas and write-back id rules, then pick models. The model only fills JSON; execute, permissions, and next hop stay host decisions.
Further reading
- Claude Opus 5.5 and tool JSON Messages, effort, tool_use write-back
- GPT-6 Astra and the JSON API Responses, text.format, async tools
- Post-DevDay Structured Output changes text.format, flat tools, Decisions split
- AI coding agents and JSON Generic loop, host execution
- All posts More on JSON and AI development
Changelog: First published