agents/api
Tools & integrations

Programmatic Tool Calling

Use JavaScript to coordinate tool calls, filter intermediate data, and return compact results.

Generated JavaScript
Enabled tools
Filter & combine
Return relevant output

Coordinate tools with code

Programmatic Tool Calling lets a model run JavaScript that calls tools, uses conditions and loops, and combines results. It can help when predictable data processing avoids passing large intermediate outputs back through the model. The Agents API enables this capability by default.

The runtime is not Node.js

Each program runs in a fresh isolated V8 runtime. It does not provide direct networking, a general filesystem, subprocesses, package installation, or persistent JavaScript state between programs. External access goes through enabled tools. Use text or image output helpers instead of assuming a console.

Choose the right call pattern

Independent lookups can be parallelized; predictable dependent calls can run in order. Use direct calls when one lookup is sufficient or when each result needs new model judgment. Preserve citations and native outputs when their attribution matters.

Keep capability boundaries intact

Programmatic orchestration does not bypass the permissions of the underlying tools. Your application continues to execute application-owned function calls. A V8 program runtime and a session sandbox are different execution resources.

Read the official reference

Check the source for current API fields, account requirements, and service limits.

OpenAI: tools-programmatic-tool-calling