Topic
Bash/Shell Scripting LLM Automation
12 posts on bash/shell scripting llm automation — part of api integration on the n4n AI blog.
Shell script templates for testing LLM API endpoints
Practical bash shell script templates llm api testing engineers can copy to validate endpoints, streaming, usage metering, and fallback routing.
Reading API keys from environment variables in bash safely
Practical guide to bash environment variables api key safety: load secrets from restricted files, validate, use in curl, and verify no leaks in scripts.
Piping curl and jq to extract chat completion text in bash
Learn how to use bash curl jq extract chat completion text from OpenAI-compatible LLM APIs with a reproducible shell pipeline and verification steps.
Parsing streaming SSE output in a bash script with jq
Step-by-step guide to bash sse streaming jq parsing: use curl and jq to read Server-Sent Events from LLM APIs, extract tokens, and handle stream termination.
Logging LLM API costs from a bash automation script
Learn how to implement bash log llm api cost tracking in shell automation scripts with OpenAI-compatible endpoints and per-token metering.
Error handling and exit codes in LLM shell scripts
Practical guide to robust bash exit codes error handling llm patterns: strict mode, HTTP status separation, custom exit codes, retries, and fault testing.
Cron jobs that call an LLM API on a schedule
Learn how to build a reliable cron job that calls an LLM API on a schedule using bash, with error handling, logging, retries, and alerting.
Batch processing files through an LLM API with a shell loop
Learn how to build a reliable bash batch processing llm api loop to run prompts over local files, with retries, parallelism, and output verification.
Write a bash script that summarizes files with an LLM API
Learn to build a dependency-light bash script that sends file contents to an OpenAI-compatible LLM API and returns concise summaries, with error handling.
Generate git commit messages with a bash LLM script
Build a bash script that automates git commit messages with an LLM. Step-by-step tutorial covering diff capture, API calls, parsing, and error handling.
Building a CLI chatbot in under 50 lines of bash
Build a minimal bash CLI chatbot script that talks to any OpenAI-compatible LLM endpoint, keeps conversation history, and runs in under 50 lines of shell.
A bash function for retrying failed LLM API calls
Build a robust bash retry function llm api calls with exponential backoff and jitter to handle rate limits and transient failures for shell automation.
More topics in api integration
- Function Calling Fundamentals27
- Structured Outputs & JSON Mode19
- cURL LLM API Cookbook15
- Integrating GPT-5, Claude Opus 4.8, Gemini 3, Llama 4 & More via One API15
- Next.js AI Chat Integration (App Router + Vercel AI SDK)15
- FastAPI LLM Backend Integration14
- Go net/http LLM API Client14
- LangChain + OpenAI-Compatible Gateway Integration14
- Node.js OpenAI-Compatible SDK Integration14
- Python + OpenAI-Compatible SDK Integration14
- Rate Limits, Retries & Backoff Strategies14
- React Streaming Chat UI Patterns14