Deep Agents Integration with The Grid | LangChain Setup
Use Deep Agents with The Grid through ChatOpenAI. Point to the OpenAI-compatible endpoint and set use_responses_api=False.
Prerequisites
Setup
1. Set the key as an environment variable
export GRID_API_KEY="your-consumption-api-key-here"2. Build a ChatOpenAI instance pointed at The Grid
ChatOpenAI instance pointed at The Gridimport os
from langchain_openai import ChatOpenAI
from deepagents import create_deep_agent
model = ChatOpenAI(
model="agent-prime",
api_key=os.environ["GRID_API_KEY"],
base_url="https://api.thegrid.ai/v1",
use_responses_api=False,
)
agent = create_deep_agent(model=model)3. (Optional) Tier sub-agents by task type
4. Invoke the agent
Verification
Troubleshooting
Last updated
Was this helpful?