Solution skill
Node/Express: the Responses API function-call loop without infinite billing
Complete solution
Shows how to fix node/Express: the Responses API function-call loop without infinite billing. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Verified against the function calling guide on 2026-09-26. 1. const response = await openai.responses.create({ model, input, tools }) with tools declared as { type: "function", name, description, parameters }.
Steps
- - Cap the loop (for example 8 iterations) and surface a partial answer at the cap.
parallel_tool_calls: falsewhen functions depend on each other's results.Whitelist
call.nameagainst your tool registry before dispatch; never index into an object with a model-supplied name without a hasOwnProperty-style check.
- In Express, this whole loop runs inside one request handler; set a route
timeout longer than your worst-case loop, or move the loop to a background job and poll.
- Assert in a test that every functioncalloutput's call_id matches its call.
When to use
You are seeing this: Verified against the function calling guide on 2026-09-26. Use this skill when you run into "Node/Express: the Responses API function-call loop without infinite billing".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
OpenAI's function calling guide documents the Responses API tool flow with functioncall items and callid-linked functioncalloutput items. The migration guide confirms top-level tool field declarations and strict-by-default functions on Responses.
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_LudobSFaIP-eJxirVCtdpA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Node/Express: the Responses API function-call loop without infinite billing <span>— Vectle</span></a>