360 Secure SkillHub
360 安全技能中心

AI/ML API LLM + Reasoning for OpenClaw

封装 run_chat.py 脚本调用 AIMLAPI 聊天补全接口,从 AIMLAPI_API_KEY 读取密钥,携带 User-Agent 发送请求并支持重试;通过参数传入模型、system/user 提示与 extra-json(如 reasoning、response_format)获取文本或 JSON 结果,也可写入输出文件。

分类:开发
aimlapihello
aimlapihello
热度 54.78
最近更新 2026-05-17 11:50:58

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add aimlapihello/aiml-llm-reasoning
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
aimlapi-llm-reasoning
description
Run AIMLAPI LLM and reasoning workflows through chat completions with retries, structured outputs, and explicit User-Agent headers. Use when Codex needs scripted prompting/reasoning calls against AIMLAPI models.
env
["AIMLAPI_API_KEY"]
primaryEnv
AIMLAPI_API_KEY

AIMLAPI LLM + Reasoning

Overview

Use run_chat.py to call AIMLAPI chat completions with retries, optional API key file fallback, and a User-Agent header on every request.

Quick start

export AIMLAPI_API_KEY="sk-aimlapi-..."
python3 {baseDir}/scripts/run_chat.py --model aimlapi/openai/gpt-5-nano-2025-08-07 --user "Summarize this in 3 bullets."

Tasks

Run a basic chat completion

python3 {baseDir}/scripts/run_chat.py \
  --model aimlapi/openai/gpt-5-nano-2025-08-07 \
  --system "You are a concise assistant." \
  --user "Draft a project kickoff checklist." \
  --user-agent "openclaw-custom/1.0"

Add reasoning parameters

python3 {baseDir}/scripts/run_chat.py \
  --model aimlapi/openai/gpt-5-nano-2025-08-07 \
  --user "Plan a 5-step rollout for a new chatbot feature." \
  --extra-json '{"reasoning": {"effort": "medium"}, "temperature": 0.3}'

Structured JSON output

python3 {baseDir}/scripts/run_chat.py \
  --model aimlapi/openai/gpt-5-nano-2025-08-07 \
  --user "Return a JSON array of 3 project risks with mitigation." \
  --extra-json '{"response_format": {"type": "json_object"}}' \
  --output ./out/risks.json

References

  • references/aimlapi-llm.md: payload and troubleshooting notes.
  • README.md: changelog-style summary of new instructions.