Skip to main content

Conectar OpenAI Agents SDK (Python) ao aicharged.io

215 ferramentas, um endpoint: https://aicharged.io/api/v1/mcp

OpenAI Agents SDK (Python)

OpenAI Agents SDK para Python: MCPServerStreamableHttp com um cabeçalho Authorization, passado ao agente em mcp_servers.

  • Chave de API (Bearer)

Código do agente

Recomendado
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())

Instalar o pacote

pip install openai-agents

Ou deixe a CLI configurar

O aicharged setup encontra os clientes de IA nesta máquina, realiza seu login pelo navegador e grava a configuração deles.

Conecte em uma linha

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

HTTP com suporte a streaming. Envie o cabeçalho Authorization: Bearer <API_KEY>, ou faça login com OAuth onde seu cliente oferecer suporte.

Ou diga ao seu agente
Leia https://aicharged.io/agent.md e configure o aicharged.io para mim

Abrir com este prompt no Claude (abre em uma nova aba) ChatGPT (abre em uma nova aba) Perplexity (abre em uma nova aba)