| name | testing-sdk-models |
| description | Test SDK connectivity with third-party model providers (GLM, MiniMax, etc.). |
| author | Henri |
| created | 2026-03-15 |
单一来源:本 skill 的唯一实体在 henri_skills 仓库中,~/.claude/skills/ 等均为软链接。编辑时请直接修改 henri_skills 中的文件。
Testing SDK Models
测试两套 SDK 与第三方 model provider 的连通性。
- test_anthropic_sdk.py — 通过 Claude Agent SDK(Anthropic 兼容端点)测试
- test_openai_sdk.py — 通过 OpenAI Agents SDK(OpenAI 兼容端点)测试
Prerequisites
- conda environment
henri_env with claude_agent_sdk and openai-agents installed
- Provider key files in
~/.configanthropic/keys/ (e.g., glm, minimax)
- Each key file contains
export ANTHROPIC_API_KEY=..., ANTHROPIC_BASE_URL=..., ANTHROPIC_MODEL=...
Usage
Anthropic SDK 测试
source ~/miniconda3/etc/profile.d/conda.sh && conda activate henri_env && python scripts/test_anthropic_sdk.py
python scripts/test_anthropic_sdk.py minimax
python scripts/test_anthropic_sdk.py --all
python scripts/test_anthropic_sdk.py claude
OpenAI SDK 测试
source ~/miniconda3/etc/profile.d/conda.sh && conda activate henri_env && python scripts/test_openai_sdk.py
python scripts/test_openai_sdk.py minimax
python scripts/test_openai_sdk.py --all
switch-api 集成
通过 --switch 调用终端的 switch_api.sh,自动 source 配置并测试:
python scripts/test_anthropic_sdk.py --switch glm
python scripts/test_anthropic_sdk.py --switch minimax
python scripts/test_anthropic_sdk.py --switch claude
python scripts/test_anthropic_sdk.py --switch --list
也可以在 Amp 中直接 source switch_api.sh 来切换(不测试):
source scripts/switch_api.sh glm
source scripts/switch_api.sh --list
Workflow
- When the user asks to test SDK or model providers, choose the appropriate script:
- "test anthropic SDK" / "test claude SDK" →
test_anthropic_sdk.py
- "test openai SDK" →
test_openai_sdk.py
- "test SDK" (unspecified) → run both
- If a specific provider is mentioned (e.g., "test glm"), pass it as argument
- If the user says "test all", use
--all flag
- If the user says "switch to X" or "切换到 X", use
--switch <provider>
- Report the results: model name, response content, success/failure
- If a provider fails, check whether
~/.configanthropic/keys/<provider> exists and has valid format
Available Providers
List providers by checking ~/.configanthropic/keys/:
ls ~/.configanthropic/keys/
Troubleshooting
- "nested session" error: The script auto-clears
CLAUDECODE env var; if running manually, unset CLAUDECODE first
- Rate limit hit: Response will contain "hit your limit"; wait for reset
- Key file not found: Create it with the three required
export lines