[Integrations](/integrations/) / OpenAI Agents SDK

# FastAF for OpenAI Agents SDK: web search and scraping over MCP

Give OpenAI Agents SDK live public web data: Google search, Maps, News, YouTube transcripts, page scraping to Markdown and more, as 23 tools from the hosted FastAF MCP server at `https://api.fastaf.co/mcp` (Streamable HTTP, stateless). The same API key works over [REST](/docs/), and failed calls cost no credits.

## How do you get a key?

Sign up at [fastaf.co/signup](/signup/): the first API key arrives by email with the confirmation link. Confirm the email to unlock 500 free credits every month, then export the key:

```
export FASTAF_API_KEY=...   # keep it out of prompts and repositories
```

## How do you connect OpenAI Agents SDK?

```
pip install openai-agents
```

Connect with `MCPServerStreamableHttp` and give the server to the agent:

```
import asyncio
import os

from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp


async def main() -> None:
    async with MCPServerStreamableHttp(
        name="fastaf",
        params={
            "url": "https://api.fastaf.co/mcp",
            "headers": {"Authorization": f"Bearer {os.environ['FASTAF_API_KEY']}"},
            "timeout": 30,
        },
        cache_tools_list=True,
        client_session_timeout_seconds=60,
    ) as fastaf:
        agent = Agent(
            name="Researcher",
            instructions="Use the FastAF tools for live web data.",
            mcp_servers=[fastaf],
        )
        result = await Runner.run(agent, "Top 5 Google results for 'standing desk under $300' in the US")
        print(result.final_output)


asyncio.run(main())
```

The agent’s model runs on OpenAI, so `OPENAI_API_KEY` must be set too. `timeout` and `client_session_timeout_seconds` raise the 5-second defaults, which a rendered page scrape can exceed. `cache_tools_list=True` skips listing the tools again on every run.

Checked on Oct 28, 2026 against [OpenAI Agents SDK: MCP](https://openai.github.io/openai-agents-python/mcp/), [MCPServerStreamableHttp reference](https://openai.github.io/openai-agents-python/ref/mcp/server/) and [openai-agents 0.24.0 on PyPI](https://pypi.org/project/openai-agents/).

## How do you check it works?

`await fastaf.list_tools()` inside the `async with` block returns the FastAF tools. Listing needs no credits; each tool result reports `credits_used` and `credits_remaining`.

## What does it cost?

500 free credits every month after email verification, shared by REST and MCP and by all your keys. After that, prepaid packs from $10 for 20,000 credits, without expiry. A Google search costs 5 credits and a plain page scrape 1; failed calls cost nothing. Every tool result reports `credits_used` and `credits_remaining`. See [FastAF pricing](/pricing/).

## FAQ

### How do I add FastAF to OpenAI Agents SDK?

Use `MCPServerStreamableHttp` from `agents.mcp` with `params={"url": ..., "headers": ...}` pointing at the hosted MCP server `https://api.fastaf.co/mcp` with `Authorization: Bearer` and your FastAF API key, read from the `FASTAF_API_KEY` environment variable, and pass it to `Agent(mcp_servers=[...])`.

### Is there a free tier?

Yes: 500 free credits every month per account after email verification, no card, shared by REST and MCP. After that, pay per call with prepaid credits or with x402 on the REST endpoints.

### Am I charged for failed tool calls?

No. A call that fails costs no credits.

### Which tools does the server expose?

23 tools, for example `google_search`, `google_maps_places`, `search_news`, `youtube_transcript`, `scrape_url`, `extract`. Listing them is public and needs no key; calling one needs a FastAF API key or an OAuth token.

### Can the MCP server be paid with x402?

No. MCP tool calls need an API key or OAuth. x402 pay-per-call, from $0.003 per call, works on the REST endpoints under `https://api.fastaf.co/x402/v1/`.

## Related

[MCP server docs](/docs/#mcp) · [Add FastAF to Claude Code, Codex and Cursor](/how-to/add-fastaf-claude-code-codex-cursor/) · [SDKs](/docs/#sdks) · [Tavily-compatible API](/integrations/tavily-compatible/) · [All integrations](/integrations/)

Other clients: [FastAF for Claude Code](/integrations/claude-code/) · [FastAF for Cursor](/integrations/cursor/) · [FastAF for Vercel AI SDK](/integrations/vercel-ai-sdk/) · [FastAF for LangChain](/integrations/langchain/)
