DEV Community

Fred Santos
Fred Santos

Posted on

Essential APIs for Building an AI Agent in 2025

Essential APIs for Building an AI Agent in 2025

The LLM is only the brain of your AI agent. The real capability comes from the tools it can call — the APIs that let it perceive the world, act in it, and remember what it learned.

In 2025, a production AI agent typically needs at least 6 categories of external capabilities. This guide walks through each one, with the specific APIs most developers are using.

What an AI Agent Actually Needs

Beyond the LLM (GPT-4, Claude, Gemini), a capable agent needs:

  1. Web access — search + scrape to get current information
  2. Document processing — PDFs, images, OCR
  3. Communication — email, WhatsApp, notifications
  4. Memory/storage — vector embeddings, key-value state
  5. Media generation — images, audio, QR codes
  6. Structured data access — APIs, databases, calculators

The challenge: most of these require separate API accounts, authentication, rate limits, and integration work. A toolkit API like IteraTools consolidates many of these into one.

Capability Matrix: What You Need and Options

1. Web Search + Scraping

API Use Case Price
IteraTools /search Google-like results + scraping ~$0.002/req
Brave Search API Structured search results $3/1K queries
Serper Google results JSON $1/1K queries
IteraTools /scrape Full page content ~$0.002/page

2. Document Processing

API Use Case Price
IteraTools /pdf/extract PDF to text/markdown ~$0.005/page
IteraTools /image/ocr Image text extraction ~$0.002/img
LlamaParse Advanced PDF parsing $0.003/page

3. Communication & Notifications

API Use Case Price
IteraTools /whatsapp/send WhatsApp messages ~$0.005/msg
SendGrid Email $0.001/email
Twilio SMS SMS $0.0079/msg

4. Memory & Embeddings

API Use Case Price
IteraTools /embeddings Text → vectors ~$0.0001/1K tokens
IteraTools /memory Key-value agent memory ~$0.001/req
OpenAI Embeddings text-embedding-3-small $0.02/1M tokens
Pinecone Vector storage $0.08/1M vectors

5. Media Generation

API Use Case Price
IteraTools /image/generate AI image generation ~$0.003/img
IteraTools /tts Text to speech ~$0.001/req
IteraTools /qrcode QR code generation ~$0.001/code

Building an Agent with IteraTools as the Toolkit

IteraTools provides 64+ endpoints that cover most of the non-LLM capabilities an agent needs — all under one API key. Here's how a research agent might use it:

# 1. Search the web
curl -X POST https://api.iteratools.com/v1/search \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "latest AI agent frameworks 2025", "limit": 5}'

# 2. Scrape the most relevant result
curl -X POST https://api.iteratools.com/v1/scrape \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://...", "output": "markdown"}'

# 3. Store embeddings for memory
curl -X POST https://api.iteratools.com/v1/embeddings \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "...article content...", "store": true, "namespace": "research"}'

# 4. Send summary via WhatsApp
curl -X POST https://api.iteratools.com/v1/whatsapp/send \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to": "+5511999999999", "message": "Research summary: ..."}'
Enter fullscreen mode Exit fullscreen mode

Complete Python Agent Example

import requests
import os
from openai import OpenAI

ITERATOOLS_KEY = os.environ["ITERATOOLS_KEY"]
OPENAI_KEY = os.environ["OPENAI_API_KEY"]

it = requests.Session()
it.headers.update({"Authorization": f"Bearer {ITERATOOLS_KEY}"})
BASE = "https://api.iteratools.com/v1"
oai = OpenAI(api_key=OPENAI_KEY)

# ─── Tool Functions ───────────────────────────────────────────

def search_web(query: str, limit: int = 5) -> list[dict]:
    r = it.post(f"{BASE}/search", json={"query": query, "limit": limit})
    return r.json()["results"]

def scrape_page(url: str) -> str:
    r = it.post(f"{BASE}/scrape", json={"url": url, "output": "markdown"})
    return r.json().get("markdown", "")

def extract_pdf(url: str) -> str:
    r = it.post(f"{BASE}/pdf/extract", json={"url": url, "output": "text"})
    return r.json().get("text", "")

def store_memory(key: str, value: str) -> None:
    it.post(f"{BASE}/memory/set", json={"key": key, "value": value})

def recall_memory(key: str) -> str:
    r = it.get(f"{BASE}/memory/get", params={"key": key})
    return r.json().get("value", "")

def send_whatsapp(phone: str, message: str) -> dict:
    r = it.post(f"{BASE}/whatsapp/send", json={"to": phone, "message": message})
    return r.json()

def generate_image(prompt: str) -> str:
    r = it.post(f"{BASE}/image/generate", json={"prompt": prompt, "model": "flux"})
    return r.json()["url"]

# ─── Tool Definitions for LLM ────────────────────────────────

TOOLS = [
    {
        "type": "function",
        "function": {
            "name": "search_web",
            "description": "Search the web for current information",
            "parameters": {
                "type": "object",
                "properties": {
                    "query": {"type": "string"},
                    "limit": {"type": "integer", "default": 5}
                },
                "required": ["query"]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "scrape_page",
            "description": "Get full content of a webpage as markdown",
            "parameters": {
                "type": "object",
                "properties": {"url": {"type": "string"}},
                "required": ["url"]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "send_whatsapp",
            "description": "Send a WhatsApp message to a phone number",
            "parameters": {
                "type": "object",
                "properties": {
                    "phone": {"type": "string", "description": "Phone with country code: +5511..."},
                    "message": {"type": "string"}
                },
                "required": ["phone", "message"]
            }
        }
    }
]

TOOL_MAP = {
    "search_web": search_web,
    "scrape_page": scrape_page,
    "send_whatsapp": send_whatsapp,
}

# ─── Agent Loop ───────────────────────────────────────────────

def run_agent(task: str) -> str:
    """Run an agent that can search, scrape, and send WhatsApp."""
    import json

    messages = [
        {"role": "system", "content": "You are a research assistant. Use your tools to complete tasks."},
        {"role": "user", "content": task}
    ]

    while True:
        response = oai.chat.completions.create(
            model="gpt-4o",
            messages=messages,
            tools=TOOLS,
            tool_choice="auto"
        )

        msg = response.choices[0].message
        messages.append(msg)

        if not msg.tool_calls:
            return msg.content

        for call in msg.tool_calls:
            fn_name = call.function.name
            args = json.loads(call.function.arguments)

            print(f"{fn_name}({args})")
            result = TOOL_MAP[fn_name](**args)

            messages.append({
                "role": "tool",
                "tool_call_id": call.id,
                "content": json.dumps(result)
            })

if __name__ == "__main__":
    result = run_agent(
        "Search for the top 3 AI agent frameworks released in 2025, "
        "summarize each in 2 sentences, and tell me which is most popular."
    )
    print("\n=== Agent Result ===")
    print(result)
Enter fullscreen mode Exit fullscreen mode

Architecture Tip: One API Key to Rule Them All

The main advantage of a toolkit approach: you don't need to manage 6+ separate API keys, rate limits, and billing accounts. IteraTools covers:

  • ✅ Web search + scraping + crawling
  • ✅ PDF, image, OCR processing
  • ✅ WhatsApp messaging
  • ✅ Text-to-speech + transcription
  • ✅ Memory + embeddings
  • ✅ Image generation + manipulation
  • ✅ QR codes, URL shortener, email validation, weather, crypto prices

That's most of what a general-purpose agent needs in a single API with credit-based pricing.

Conclusion

Building a capable AI agent in 2025 is more about tool integration than LLM selection. The LLM is a commodity — the differentiator is how many useful actions your agent can take.

IteraTools solves the "tooling tax" problem: instead of 10 API accounts, one key gives you 64+ capabilities with a single unified billing model. Start your agent at api.iteratools.com.

Top comments (0)