Skip to main content
This agent can make requests to external APIs. Use with caution, especially when granting access to users.Be aware that this agent could theoretically send requests with provided credentials or other sensitive data to unverified or potentially malicious URLs —although it should never in theory.Consider adding limitations to what actions can be performed via the agent, what APIs it can access, what headers can be passed, and more.In addition, consider implementing measures to validate URLs before sending requests, and to securely handle and protect sensitive data such as credentials.
This will help you getting started with OpenApiToolkit OpenAPI toolkit. OpenApiToolkit now lives in @langchain/classic. For migration details, see the LangChain v1 migration guide. The OpenAPIToolkit has access to the following tools:

Setup

This toolkit requires an OpenAPI spec file. The LangChain.js repository has a sample OpenAPI spec file in the examples directory. You can use this file to test the toolkit. If you want to get automated tracing from runs of individual tools, you can also set your LangSmith API key by uncommenting below:

Installation

This toolkit lives in the langchain package:

Instantiation

Now we can instantiate our toolkit. First, we need to define the LLM we would like to use in the toolkit.

Tools

View available tools:

Use within an agent

First, ensure you have LangGraph installed:

API reference

There is currently no dedicated API reference page for OpenApiToolkit in @langchain/classic. For implementation details, see OpenApiToolkit source in langchainjs.