CrewAI / LangGraph Multi-Agent Systems: Real Cost per Run
Back to blogEngineering

CrewAI / LangGraph Multi-Agent Systems: Real Cost per Run

Multi-agent frameworks multiply your token spend by design — every agent hop is another LLM call. Here's how to wire CrewAI and LangGraph to AICredits and what a typical run actually costs.

Author

AICredits Team

Published

25 Aug 2026

Reading time

7 min read

Why multi-agent cost adds up faster than single-call cost

A single chatbot request is one LLM call. A multi-agent system — a researcher agent, a writer agent, a reviewer agent, coordinated by CrewAI or LangGraph — can be five, ten, or more LLM calls for a single user-facing task, each carrying its own input context (often including prior agents' output). The framework's power comes precisely from this decomposition, but it means cost estimation has to account for the whole chain, not just the final response.

CrewAI with AICredits

CrewAI's LLM class accepts a custom base_url, which routes any agent through AICredits:

from crewai import Agent, Task, Crew, LLM
 
llm = LLM(
    model="openai/gpt-4o-mini",
    base_url="https://api.aicredits.in/v1",
    api_key="sk-your-aicredits-key",
)
 
researcher = Agent(
    role="Researcher",
    goal="Find the three most important facts about the topic",
    backstory="A meticulous research analyst.",
    llm=llm,
)
 
writer = Agent(
    role="Writer",
    goal="Turn research into a concise summary",
    backstory="A clear, concise technical writer.",
    llm=llm,
)
 
research_task = Task(description="Research: {topic}", agent=researcher, expected_output="Three key facts")
write_task = Task(description="Write a summary from the research", agent=writer, expected_output="A 3-sentence summary")
 
crew = Crew(agents=[researcher, writer], tasks=[research_task, write_task])
result = crew.kickoff(inputs={"topic": "quantum error correction"})

Give each agent a different model to balance cost and capability — a cheap model for the researcher's broad pass, a stronger model only for the final writer or reviewer step:

cheap_llm = LLM(model="google/gemini-2.0-flash", base_url="https://api.aicredits.in/v1", api_key="sk-your-key")
strong_llm = LLM(model="anthropic/claude-3-5-sonnet-20241022", base_url="https://api.aicredits.in/v1", api_key="sk-your-key")
 
researcher = Agent(role="Researcher", llm=cheap_llm, ...)
reviewer = Agent(role="Reviewer", llm=strong_llm, ...)

LangGraph with AICredits

LangGraph builds on LangChain's model abstractions, so the same base_url override applies:

from langchain_openai import ChatOpenAI
from langgraph.graph import StateGraph, END
 
llm = ChatOpenAI(
    model="openai/gpt-4o-mini",
    base_url="https://api.aicredits.in/v1",
    api_key="sk-your-aicredits-key",
)
 
def research_node(state):
    response = llm.invoke(f"Research key facts about: {state['topic']}")
    return {"research": response.content}
 
def write_node(state):
    response = llm.invoke(f"Write a summary from: {state['research']}")
    return {"summary": response.content}
 
graph = StateGraph(dict)
graph.add_node("research", research_node)
graph.add_node("write", write_node)
graph.add_edge("research", "write")
graph.add_edge("write", END)
graph.set_entry_point("research")
 
app = graph.compile()
result = app.invoke({"topic": "quantum error correction"})

What a typical run costs

A 3-agent pipeline (researcher → writer → reviewer), each call averaging 600 input tokens (including prior agents' output) and 300 output tokens:

| Model for all 3 agents | Approx. cost per run | |--------------------------|-------------------------| | Gemini 2.0 Flash | ~₹0.06 | | GPT-4o-mini | ~₹0.08 | | DeepSeek V3 | ~₹0.07 | | Claude 3.5 Sonnet (all 3 agents) | ~₹1.05 | | Mixed: cheap researcher + Sonnet reviewer | ~₹0.45 |

The mixed strategy — cheap models for exploratory steps, a stronger model only where quality genuinely matters — typically costs 50-70% less than running every agent on the most capable model, with little to no quality loss on the intermediate steps.

Guardrails against runaway agent loops

Multi-agent systems occasionally loop — an agent rejects another's output and requests a redo indefinitely. Set a per-key budget cap in the AICredits dashboard specifically for agent-facing keys, separate from your main application key, so a looping crew can't silently burn through your entire wallet. See Agentic AI Costs: How One Loop Burned ₹5,000 in 10 Minutes for a real example of what this looks like when it goes wrong.

Frequently Asked Questions

Can different agents in the same crew use different models?

Yes — both CrewAI and LangGraph let you assign a separate LLM instance per agent or node. This is the main lever for controlling multi-agent cost.

Does tool/function calling work across agent frameworks through AICredits?

Yes — both frameworks pass tool definitions through the same OpenAI-compatible function-calling format, which AICredits forwards to the underlying provider unchanged.

How do I estimate cost before running a large agent workflow?

Run a single end-to-end pass, capture the token usage per agent from the LLM response objects, then multiply by expected volume. This gives a far more accurate estimate than guessing from headline per-token prices alone.

Get started

AICredits

Build with any AI model. Pay in INR.

One OpenAI-compatible API for every major model, with a prepaid rupee wallet. Top up via UPI — no international credit card, no forex surprises.

Top up via UPI · Prepaid INR wallet · No international card needed

Related Articles

Continue in Docs

Need implementation commands and endpoint details? Go to quickstart or API reference.