everyapi
Integration · Stateful agent orchestration in the LangChain familyOpenAI-compatible · one key · live model catalog
LangGraph

Run the EveryAPI gateway inside LangGraph

LangGraph orchestrates stateful application flows and can call a ChatOpenAI instance configured for an OpenAI-compatible endpoint. Point that client at EveryAPI; graph state and persistence remain application concerns, while model-dependent capabilities must be tested separately.

01Setup code

One base URL line points LangGraph at EveryAPI

Default global Base URL / China-first Base URL: https://api.everyapi.ai/v1 / https://api-cn.everyapi.ai/v1

agent.py
from langchain_openai import ChatOpenAI
from langgraph.graph import StateGraph, START, END
from typing import TypedDict
 
llm = ChatOpenAI(
base_url="https://api.everyapi.ai/v1",
api_key="sk-everyapi-...",
model="claude-sonnet-5",
)
 
class State(TypedDict):
messages: list
 
def think(state: State):
resp = llm.invoke(state["messages"])
return {"messages": state["messages"] + [resp]}
 
graph = StateGraph(State)
graph.add_node("think", think)
graph.add_edge(START, "think")
graph.add_edge("think", END)
app = graph.compile()
 
result = app.invoke({"messages": [{"role": "user", "content": "Explain RAG"}]})
02Steps

From zero to your first call

  1. Install LangGraph

    Install LangGraph and langchain-openai versions compatible with your application, then consult their matching API references.

  2. Point ChatOpenAI at EveryAPI

    ChatOpenAI(base_url="https://api.everyapi.ai/v1", api_key="sk-everyapi-...", model="...") — same as on the LangChain integration page.

  3. Build the graph

    Build graph state, nodes, edges, and checkpoints according to the current LangGraph documentation. Test any tool-calling or structured-output path with the selected model instead of assuming provider parity.

03FAQ

LangGraph × EveryAPI

Do LangGraph checkpoints / persistence go through EveryAPI?

No. LangGraph state checkpoints use its own PostgreSQL / SQLite / in-memory backend, independent of the LLM gateway. EveryAPI only proxies the ChatOpenAI calls.