aimlapi-llm-reasoning

TotalClaw 作者 totalclaw

通过重试、结构化输出和显式用户代理标头的聊天完成来运行 AIMLAPI LLM 和推理工作流程。当 Codex 需要针对 AIMLAPI 模型进行脚本化提示/推理调用时使用。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw install totalclaw:totalclaw~aimlapihello-aiml-llm-reasoning
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~aimlapihello-aiml-llm-reasoning/file -o aimlapihello-aiml-llm-reasoning.md
## 概述(中文)

通过重试、结构化输出和显式用户代理标头的聊天完成来运行 AIMLAPI LLM 和推理工作流程。当 Codex 需要针对 AIMLAPI 模型进行脚本化提示/推理调用时使用。

## 原文

# 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

```bash
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

```bash
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

```bash
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

```bash
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.