n4nAI

Topic

cURL LLM API Cookbook

15 posts on curl llm api cookbook — part of api integration on the n4n AI blog.

API integrationHow-to

Uploading files to an LLM API with curl multipart forms

Learn how to perform a curl multipart file upload llm api request from CLI with step-by-step examples for vision, documents, and errors.

4 min read
API integrationHow-to

Testing API key auth with curl before writing code

Learn how to curl test api key authentication against LLM endpoints before writing code. Step-by-step CLI checks for bearer tokens, error cases, and live calls.

4 min read
API integrationHow-to

Setting temperature and max_tokens in a curl request

Learn how to set curl temperature max_tokens parameters in LLM API requests with runnable examples and verification steps for OpenAI-compatible endpoints.

5 min read
API integrationHow-to

Sending images to a vision model with curl

Step-by-step guide to a curl vision model image request: encode images, build OpenAI-compatible JSON, post with curl, and verify multimodal LLM responses.

3 min read
API integrationHow-to

Retrying failed curl requests with exponential backoff

A practical curl retry exponential backoff script for bash: handle transient HTTP failures against LLM APIs with retries, jitter, and timeouts.

3 min read
API integrationHow-to

Piping curl streaming output into jq for parsing

Step-by-step guide to piping curl streaming output into jq for parsing LLM API Server-Sent Events: strip data prefixes, filter deltas, and test locally.

4 min read
API integrationHow-to

Debugging LLM API errors with curl -v

Use curl -v to debug LLM API errors by exposing raw HTTP requests, TLS issues, and provider responses—a practical how-to for engineers integrating models.

4 min read
API integrationListicle

curl one-liners for checking LLM API rate limit headers

Practical curl rate limit headers one-liners to inspect LLM API throttling, quota, and reset times across OpenAI, Anthropic, and inference providers.

3 min read
API integrationHow-to

curl examples for function calling and tool use

Runnable curl function calling tool use examples for OpenAI-compatible LLM endpoints: define tools, send requests, parse tool_calls, and return results step by step.

3 min read
API integrationHow-to

curl examples for embeddings and vector search

Hands-on curl embeddings api examples for generating OpenAI-compatible embeddings and querying a vector store, with verifiable runnable steps.

3 min read
API integrationComparison

Comparing OpenAI and Anthropic request bodies with curl

A practical head-to-head of curl OpenAI vs Anthropic request bodies: auth, message shape, streaming, cost model, limits, and ergonomics, with a comparison table and verdict.

3 min read
API integrationHow-to

Building a Postman collection from curl LLM examples

Practical guide to convert curl to Postman collection LLM API examples with ordered steps, runnable code, and verification tips for engineers.

5 min read
API integrationHow-to

Streaming chat completions from the command line with curl

Learn how to run curl streaming chat completions command line against an OpenAI-compatible API, parse SSE, and verify token streaming end to end.

4 min read
API integrationGuide

curl headers every OpenAI-compatible API call needs

Practical guide to the curl headers every OpenAI-compatible API call needs, covering auth, content negotiation, routing, and streaming pitfalls.

5 min read
API integrationHow-to

Calling the OpenAI chat completions API with curl

Learn how to call the OpenAI chat completions API with curl: from API key setup to streaming, error handling, and verifying JSON responses via CLI.

3 min read