Skip to content

OpenAI Agents SDK connector: targeted version and verified APIs

Package: openai-agents (published by OpenAI). Targeted: 0.25.0 (extra credencestack[openai-agents], pinned >=0.25,<0.26). Checked against the installed source on 2026-11-22.

APIs used, as found in 0.25.0

Need API in 0.25.0 Where
Native tools agents.FunctionTool(name, description, params_json_schema, on_invoke_tool, strict_json_schema=False); on_invoke_tool(ctx, args_json) -> str agents/tool.py
Events agents.RunHooks subclass: on_agent_start, on_llm_start, on_llm_end(response: ModelResponse), on_handoff(context, from_agent, to_agent) agents/lifecycle.py
Human approval FunctionTool.needs_approval (bool or async (ctx, params, call_id) -> bool); interrupted runs return result.interruptions (ToolApprovalItem); resume with state = result.to_state(), state.approve(item) / state.reject(item, rejection_message=...), Runner.run(agent, state) agents/tool.py, agents/result.py, agents/run_state.py
Run Runner.run(agent, input, max_turns=..., hooks=..., run_config=RunConfig(tracing_disabled=True)) agents/run.py, agents/run_config.py
Offline model agents.testing.ScriptedModel([ModelStep.respond(fn)]), function_call(...), assistant_message(...): the SDK's own deterministic test model agents/testing/model.py
Non-OpenAI models model names prefixed litellm/ (e.g. litellm/anthropic/<model>) go to LitellmProvider; needs openai-agents[litellm] agents/models/multi_provider.py

Differences from the plan's hints

  • Guardrails: the SDK's input and output guardrails act on whole agent inputs and outputs, and tool guardrails on tool calls. The connector does not use them for approvals; it uses needs_approval, the SDK's human-in-the-loop interruption, which maps directly onto approval_request / approval_decision.
  • Events: recorded through RunHooks, not a tracing processor; the SDK's tracing is turned off for runs (tracing_disabled=True) so nothing is exported.
  • Suspension: the SDK has no cancel for a non-streamed run. The connector refuses every tool call in its tool wrapper once suspended, and on_llm_start raises a private exception that ends the run with halted (the SDK propagates hook exceptions).
  • Handoffs: recorded as a new trace event kind, handoff, with meta.handoff_from and meta.handoff_to; tool calls carry meta.actor (the acting agent's name).
  • LiteLLM: confirmed in source; not exercised offline (it needs the extra and a key).