curl -s http://localhost:11434/api/generate -d '{"model":"llama3.3","prompt":"hello","stream":false}' | jq .response

Category: AI Agents & MCP

curl -s http://localhost:11434/api/generate -d '{"model":"llama3.3","prompt":"hello","stream":false}' | jq .response

Call the Ollama API directly from the command line

Ollama exposes an OpenAI-compatible HTTP API on port 11434. Calling it directly lets you integrate local AI into any script. The stream:false flag returns the complete response at once instead of streaming tokens. Use jq to extract fields.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.