Skip to main content

Connect OpenAI Agents SDK (Python) to aicharged.io

215 tools, one endpoint: https://aicharged.io/api/v1/mcp

OpenAI Agents SDK (Python)

OpenAI Agents SDK for Python: MCPServerStreamableHttp with an Authorization header, passed to the agent in mcp_servers.

  • API key (Bearer)

Agent code

Recommended
import asyncio, os
from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp

async def main():
    async with MCPServerStreamableHttp(
        name="aicharged",
        params={
            "url": "https://aicharged.io/api/v1/mcp",
            "headers": {"Authorization": f"Bearer {os.environ['AICHARGED_API_KEY']}"},
            "timeout": 30,
        },
    ) as server:
        agent = Agent(name="Assistant", instructions="Use the aicharged.io tools.", mcp_servers=[server])
        result = await Runner.run(agent, "List my recent aicharged.io runs")
        print(result.final_output)

asyncio.run(main())

Install the package

pip install openai-agents

Or let the CLI set it up

aicharged setup finds the AI clients on this machine, signs you in through the browser and writes their configuration.

Connect in one line

Install the CLI · macOS / Linux
curl -fsSL https://aicharged.io/install.sh | sh && aicharged setup
Install the CLI · Windows
irm https://aicharged.io/install.ps1 | iex; aicharged setup
MCP endpoint
https://aicharged.io/api/v1/mcp

Streamable HTTP. Send the header Authorization: Bearer <API_KEY>, or sign in with OAuth where your client supports it.

Or tell your agent
Read https://aicharged.io/agent.md and set me up with aicharged.io

Open with this prompt in Claude (opens in a new tab) ChatGPT (opens in a new tab) Perplexity (opens in a new tab)