Source Code
AIMLAPI LLM + Reasoning
Overview
Use reusable scripts to call AIMLAPI chat completions, pass model-specific reasoning parameters, and capture structured outputs.
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."
Add reasoning or provider-specific parameters
Use --extra-json to pass fields such as reasoning effort, response format, or tool configs without editing the script.
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"}}'
References
references/aimlapi-llm.md: payload fields and troubleshooting notes.