## 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

1. - Cap the loop (for example 8 iterations) and surface a partial answer at the cap.
- `parallel_tool_calls: false` when functions depend on each other's results.
- Whitelist `call.name` against your tool registry before dispatch; never index
 into an object with a model-supplied name without a hasOwnProperty-style check.

2. - 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 function_call_output'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.
