◆ STEPS
- 01Grab a free API key at /dashboard.
- 02Set FUNDED_API_KEY in your env.
- 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_KEYin your environment. - ▸Read the API reference if you need other endpoints.
▶ RELATED RECIPES