agents/apiTHE ENCYCLOPEDIA
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

23 matching topics

What is the OpenAI Agents API?FoundationsAgents API vs Agents SDK vs Responses APIComparisonsAgents API quickstartGetting startedSessions, turns & durable stateCore conceptsHosted vs self-hosted sandboxesInfrastructureConnect MCP servers to Agents APITools & integrationsFunction calling & application toolsTools & integrationsMulti-agent orchestrationCore conceptsStreaming, webhooks & event handlingIntegration guidesFiles, outputs & published artifactsCore conceptsVaults & MCP authenticationTools & integrationsAgent security & credential boundariesProductionTracing, usage & debuggingProductionAgents API pricing & cost planningProductionOpenAI Agents API with PythonGetting startedAgents API with TypeScript & Next.jsIntegration guidesWhat is the OpenAI Agents SDK?FoundationsResponses API in the agent stackFoundationsAgent Skills & SKILL.mdTools & integrationsProgrammatic Tool CallingTools & integrationsRAG, file search & vector storesTools & integrationsWeb search & source citationsTools & integrationsChatKit & Agent BuilderIntegration guides
K to open Esc to close