Skip to main content

OpenAI Agents SDK (Python) ला aicharged.io शी कनेक्ट करा

215 टूल्स, एक एंडपॉइंट: https://aicharged.io/api/v1/mcp

OpenAI Agents SDK (Python)

Python साठी OpenAI Agents SDK: Authorization हेडरसह MCPServerStreamableHttp, जो mcp_servers मध्ये एजंटला दिला जातो.

  • API की (Bearer)

एजंट कोड

शिफारस केलेले
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())

पॅकेज इंस्टॉल करा

pip install openai-agents

किंवा CLI ला हे सेट अप करू द्या

aicharged setup या मशीनवरील AI क्लायंट शोधते, ब्राउझरद्वारे तुम्हाला साइन इन करते आणि त्यांचे कॉन्फिगरेशन लिहितो.

एका ओळीत कनेक्ट करा

CLI इंस्टॉल करा · macOS / Linux
curl -fsSL https://aicharged.io/install.sh | sh && aicharged setup
CLI इंस्टॉल करा · Windows
irm https://aicharged.io/install.ps1 | iex; aicharged setup
MCP एंडपॉइंट
https://aicharged.io/api/v1/mcp

स्ट्रीम करण्यायोग्य HTTP. हेडर Authorization: Bearer <API_KEY> पाठवा, किंवा तुमचा क्लायंट सपोर्ट करत असल्यास OAuth द्वारे साइन इन करा.

किंवा तुमच्या एजंटला सांगा
https://aicharged.io/agent.md वाचा आणि मला aicharged.io सह सेट अप करा

या प्रॉम्प्टसह यामध्ये उघडा Claude (नवीन टॅबमध्ये उघडते) ChatGPT (नवीन टॅबमध्ये उघडते) Perplexity (नवीन टॅबमध्ये उघडते)