aptx-api-core-python

Installation
SKILL.md

aptx-api-core-python

Python 异步 HTTP 运行时,为 aptx 代码生成的 API 客户端提供请求执行能力。

在需要接入或调整请求内核时,按以下顺序执行:

  1. 创建 RequestClient,确定全局配置:base_urlheaderstimeout。详见 实例化配置
  2. 通过 pipeline.use(middleware) 注册中间件处理横切关注点(认证、日志、错误处理等)。详见 中间件
  3. 使用 AuthMiddleware 或自定义中间件添加认证信息。详见 授权与认证
  4. 在调用方使用 try/except 按错误类型分流:HttpErrorNetworkErrorTimeoutErrorDecodeError。详见 错误处理
  5. 通过全局单例 set_api_client() / get_api_client() 让生成代码访问共享客户端。详见 全局单例

最小接入模板:

from aptx_api_core import (
    create_api_client, set_api_client, get_api_client,
    RequestSpec, AuthMiddleware,
)
Related skills

More from haibaraaiaptx/aptx-skill

Installs
4
First Seen
Apr 7, 2026