Skip to main content

Kết nối OpenAI Responses API với aicharged.io

215 công cụ, một endpoint: https://aicharged.io/api/v1/mcp

OpenAI Responses API

OpenAI Responses API: công cụ mcp dạng hosted — OpenAI gọi aicharged.io thay bạn; khóa được đặt vào trường authorization.

  • Khóa API (Bearer)

Công cụ MCP dạng hosted — API gọi aicharged.io thay bạn

Khuyên dùng
import os
from openai import OpenAI

client = OpenAI()
response = client.responses.create(
    model="gpt-6-astra",
    input="List my recent aicharged.io runs",
    tools=[{
        "type": "mcp",
        "server_label": "aicharged",
        "server_url": "https://aicharged.io/api/v1/mcp",
        "authorization": os.environ["AICHARGED_API_KEY"],
        "require_approval": "never",
    }],
)
print(response.output_text)

OpenAI không bao giờ lưu giá trị authorization — hãy gửi nó trong mọi yêu cầu.

Cùng yêu cầu đó với curl

curl https://api.openai.com/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
    "model": "gpt-6-astra",
    "input": "List my recent aicharged.io runs",
    "tools": [{"type": "mcp", "server_label": "aicharged", "server_url": "https://aicharged.io/api/v1/mcp", "authorization": "<API_KEY>", "require_approval": "never"}]
  }'

Hoặc để CLI tự động thiết lập

`aicharged setup` tìm kiếm các client AI trên máy này, đăng nhập cho bạn qua trình duyệt và ghi cấu hình của chúng.

Kết nối chỉ với một dòng lệnh

Cài đặt CLI · macOS / Linux
curl -fsSL https://aicharged.io/install.sh | sh && aicharged setup
Cài đặt CLI · Windows
irm https://aicharged.io/install.ps1 | iex; aicharged setup
Endpoint MCP
https://aicharged.io/api/v1/mcp

HTTP dạng stream. Gửi header Authorization: Bearer <API_KEY>, hoặc đăng nhập bằng OAuth nếu client của bạn hỗ trợ.

Hoặc yêu cầu agent của bạn
Hãy đọc https://aicharged.io/agent.md và thiết lập aicharged.io cho tôi

Mở bằng prompt này trong Claude (mở trong tab mới) ChatGPT (mở trong tab mới) Perplexity (mở trong tab mới)