透過 OAuth 連接 AI Agent。無人值守自動化請使用機器用戶端或服務帳戶,並將憑證保存在受保護的環境變數或金鑰儲存中。呼叫前先瀏覽註冊表並處理結構化回應。

Argus 自身不產生投資判斷或執行訂單,但不限制客戶端 AI Agent 使用合法取得的資料獨立推理和輸出。

REST 與 API

  1. 使用權威 OpenAPI 文件取得目前 REST 請求結構。
  2. 傳送 OAuth Bearer token;machine client 與 service account 可使用 X-Argus-API-Key。
  3. 根據 OpenAPI 契約驗證結構化 HTTP 回應與狀態碼。
  4. 400/422 代表請求問題,401 代表驗證問題,403 代表治理拒絕,500/503 代表服務故障。
  5. 保留 audit_id,僅對可重試故障進行有限重試。
# First run: argus auth login
import json
from urllib.request import Request, HTTPRedirectHandler, build_opener
from argus.cli.oauth import CliOAuthProfile

profile = CliOAuthProfile()
token = profile.client().access_token()
if token is None:
    raise RuntimeError("Run argus auth login first")

class NoRedirect(HTTPRedirectHandler):
    def redirect_request(self, *args, **kwargs):
        return None

request = Request(
    profile.api_base_url + "/v1/entity-resolve",
    data=json.dumps(json.loads(r'''{"identifier_type":"lei","identifier_value":"HWUPKR0MPOU8FGXBT394","purpose":"factual_lookup","requires_redistribution":false}''')).encode(),
    headers={"Authorization": f"Bearer {token}",
             "Content-Type": "application/json", "User-Agent": "Argus REST client"},
    method="POST",
)
with build_opener(NoRedirect()).open(request, timeout=30) as response:
    envelope = json.load(response)
    print(json.dumps(envelope, indent=2))

閱讀 REST 端點清單與錯誤契約。