HomeDocsAdapters › OpenAI Agents SDK

OpenAI Agents SDK Adapter

agent402-openai-agents

Tool adapters for OpenAI's Agents SDK. JS adapter around the Python-style agent loop with automatic tool execution.

Install

npm install agent402-openai-agents

Quick start

import { agent402Tools } from "agent402-openai-agents";
import { Agent, Runner } from "openai-agents";

const tools = await agent402Tools();

const agent = new Agent({
  name: "my-agent",
  instructions: "You are a helpful assistant.",
  tools,
});

const result = await Runner.run(agent, "Hash 'hello world' with SHA-256");
console.log(result.finalOutput);

Configuration

OptionTypeDescription
categories string[] Filter tools by category.
slugs string[] Load only specific tools by slug.
baseUrl string Point to a self-hosted Agent402 instance.
agentKey string Private key for wallet-only (paid) tools.
// Filter tools by category.
agent402Tools({ categories: ["search"] })

// Load only specific tools by slug.
agent402Tools({ slugs: ["search", "extract"] })

// Point to a self-hosted Agent402 instance.
agent402Tools({ baseUrl: "https://my-agent402.example.com" })

// Private key for wallet-only (paid) tools.
agent402Tools({ agentKey: process.env.AGENT_KEY })

Works with

OpenAI Agents SDK GPT-4o GPT-4o-mini Agent Runner