Kết nối agent AI bằng OAuth. Với tự động hóa không người giám sát, dùng máy khách hoặc tài khoản dịch vụ và giữ thông tin xác thực trong biến môi trường được bảo vệ hoặc kho lưu trữ bí mật.

Argus không tạo quyết định đầu tư hoặc lệnh, nhưng không hạn chế agent phía khách hàng phân tích và xuất kết quả độc lập từ dữ liệu có được hợp pháp.

REST và API

  1. Dùng tài liệu OpenAPI có thẩm quyền cho schema yêu cầu REST hiện tại.
  2. Gửi OAuth Bearer token; machine clients và service accounts có thể dùng X-Argus-API-Key.
  3. Xác thực phản hồi HTTP có cấu trúc và mã trạng thái theo hợp đồng OpenAPI.
  4. Xem 400/422 là lỗi yêu cầu, 401 là lỗi xác thực, 403 là từ chối quản trị và 500/503 là lỗi dịch vụ.
  5. Giữ lại audit_id và chỉ retry có giới hạn khi lỗi cho phép thử lại.
# 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))

Đọc danh mục REST và hợp đồng lỗi.