Topic
Python Raw REST Calls (requests/httpx)
13 posts on python raw rest calls (requests/httpx) — part of api integration on the n4n AI blog.
Timeout and connection error handling for LLM REST calls
Practical guide to python timeout error handling llm rest api: set explicit timeouts, catch connection errors, retry with backoff, and avoid common pitfalls.
Python requests vs the OpenAI SDK: raw REST tradeoffs
A pragmatic engineer's comparison of python requests vs openai sdk for LLM API calls: capabilities, latency, cost, ergonomics, and which to use when building.
Python requests session pooling for high-volume LLM calls
Learn python requests session pooling llm techniques to reuse TCP connections and reduce tail latency at high call volumes with code.
Python httpx vs requests for calling LLM APIs
A pragmatic head-to-head comparison of python httpx vs requests llm API calls across capabilities, latency, ergonomics, and verdicts for engineers.
How to send image and text requests to vision LLMs in Python
Step-by-step guide to sending image and text prompts to vision LLMs in Python using raw requests and httpx, with OpenAI-compatible payloads and verification.
How to parse streaming JSON chunks from an LLM API in Python
Learn how to python parse streaming json llm responses in Python using httpx: buffer SSE chunks, split lines, and decode JSON deltas safely.
How to call GPT-4o via REST API using Python requests
Step-by-step guide to calling GPT-4o via REST API using Python requests, from API key setup to parsing streaming responses and handling errors.
Handling server-sent events from LLM APIs in Python
Learn how to handle python server-sent events llm api responses in Python with httpx and requests, including SSE parsing, retries, and streaming pitfalls.
Building a retry-with-backoff wrapper for LLM REST calls
Build a robust python retry backoff llm rest api client with httpx. Hands-on tutorial covering exponential backoff, jitter, and flaky mock testing.
Building a minimal Python LLM client with httpx
Build a python minimal llm client httpx from scratch with auth, streaming, retries, and OpenAI-compatible calls in this hands-on tutorial for engineers.
Streaming LLM responses in Python with httpx and SSE
Stream LLM responses in Python with httpx and SSE. Build a minimal OpenAI-compatible client: sync/async code, error handling, retries, and production checklist.
Calling the n4n.ai REST API from Python with requests
Learn how to call the n4n.ai LLM REST API from Python using requests, with runnable code for auth, chat completions, streaming, and error handling.
Async LLM API calls in Python with httpx.AsyncClient
Learn to build concurrent, resilient LLM API calls in Python using httpx.AsyncClient with retries, streaming, routing, and usage metering.
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