◆ LANGCHAIN~3 minPYTHON

Use FundedAPI as a Langchain tool

Expose every FundedAPI endpoint as a function-callable tool for your agent. One wrapper, full OpenAPI schema.

◆ STEPS
  1. 01Grab a free API key at /dashboard.
  2. 02Set FUNDED_API_KEY in your env.
  3. 03Run the snippet — agent discovers every endpoint automatically from our OpenAPI spec.
◆ CODE · PYTHON
# pip install langchain-openai langchain-community requests

from langchain_community.agent_toolkits.openapi import planner
from langchain_community.tools import OpenAPISpec
from langchain_openai import ChatOpenAI
import requests, os

spec = OpenAPISpec.from_url("https://fundedapi.com/api/openapi")

llm = ChatOpenAI(model="gpt-4o-mini", temperature=0)
agent = planner.create_openapi_agent(
    spec,
    requests.Session(),
    llm,
    allow_dangerous_requests=False,  # FundedAPI is read-only
    headers={"Authorization": f"Bearer {os.environ['FUNDED_API_KEY']}"},
)

print(agent.invoke(
    "What AI startups raised Seed in the US last month? Return top 5."
))
◆ PREREQUISITES
  • A FundedAPI key (free). Grab one.
  • Set FUNDED_API_KEY in your environment.
  • Read the API reference if you need other endpoints.
▶ RELATED RECIPES