Piotr Sikora - Logo - Automatyzacja procesów | AI | JavaScript | Front End | Team Leader
  • Home
  • Services
    • Process Automation
    • AI for Lawyers
  • Blog
  • Quotes
  • Contact
PL/EN

Ollama - how to use it with cURL

  • Home
  • Blog
  • Ollama - how to use it with cURL
Ollama - how to use it with cURL

By Piotr Sikora

  • ollama

  • 10 November 2025

  • 2 min read

Table of Contents

  • List Ollama models
  • Ollama chat cURL request
  • Ollama chat cURL without streaming
  • Ollama generate response

List Ollama models

└─$ ollama ls               
NAME                    ID              SIZE      MODIFIED      
qwen2.5-coder:latest    dae161e27b0e    4.7 GB    8 minutes ago    
gpt-oss:latest          17052f91a42e    13 GB     3 weeks ago      
llama3:latest           365c0bd3c000    4.7 GB    3 weeks ago      
gemma2:latest           ff02c3702f32    5.4 GB    3 weeks ago      
deepseek-r1:latest      6995872bfe4c    5.2 GB    3 weeks ago      
starcoder:latest        847e5a7aa26f    1.8 GB    3 weeks ago    s

Ollama chat cURL request

Now lets write a simple cURL which will invoke *llama3 model:

curl http://localhost:11434/api/chat -d '{
  "model": "llama3",
  "messages": [
    { "role": "user", "content": "Give me very short answer. The capitol of Poland is?" }                       
  ]
}'

The output will be similar to:

{"model":"llama3","created_at":"2025-11-10T10:10:03.318829243Z","message":{"role":"assistant","content":"Wars"},"done":false}
{"model":"llama3","created_at":"2025-11-10T10:10:03.519302483Z","message":{"role":"assistant","content":"aw"},"done":false}
{"model":"llama3","created_at":"2025-11-10T10:10:03.703234588Z","message":{"role":"assistant","content":"!"},"done":false}
{"model":"llama3","created_at":"2025-11-10T10:10:03.883560841Z","message":{"role":"assistant","content":""},"done":true,"done_reason":"stop","total_duration":1631819270,"load_duration":103364571,"prompt_eval_count":23,"prompt_eval_duration":961241860,"eval_count":4,"eval_duration":559116162}

Ollama chat cURL without streaming

 curl http://localhost:11434/api/chat -d '{
  "model": "llama3",
  "messages": [
    { "role": "user", "content": "Give me very short answer. The capitol of Poland is?" }
  ], 
  "stream": false
}'

Ollama generate response

curl http://localhost:11434/api/generate -d '{
  "model": "llama3",
  "prompt": "Give me very short answer. Write a simple code in Python with hello world example." , "stream": false}
}' | jq -r ".response"

Share this article

TwitterLinkedInFacebook

Tags:

  • #ollama

  • #cURL

  • #ai

Categories

after-hours(1)AI(7)ai-en(1)angular(4)automatic-tests(1)Automation(2)cryptography(1)css(8)CyberSecurity(2)Development(6)DevOps(1)events(3)javascript(11)n8n(10)ollama(1)security(2)seo(1)

Recent Posts

Testing Kimi Code: First Impressions from Web and CLI

Development

Testing Kimi Code: First Impressions from Web and CLI

Why You Shouldn't Cram Multiple Webhooks Into One n8n Workflow

Automation

Why You Shouldn't Cram Multiple Webhooks Into One n8n Workflow

DRY, WET, AHA: Finding the Right Balance in Code Reuse

Development

DRY, WET, AHA: Finding the Right Balance in Code Reuse

API vs Webhook: Understanding the Difference

Development

API vs Webhook: Understanding the Difference

RTCROS Framework: Structure Your Prompts for Better AI Results

AI

RTCROS Framework: Structure Your Prompts for Better AI Results

About Me

Piotr Sikora - Process Automation | AI | n8n | Python | JavaScript

Piotr Sikora

Process Automation Specialist

I implement automation that saves time and money, streamlines operations, and increases the predictability of results. Specializing in process automation, AI implementation, and workflow optimization using n8n, Python, and JavaScript.

n8n Workflows

n8n workflow automation templates

Explore my workflow templates on n8n. Ready-to-use automations for blog management, data collection, and AI-powered content processing.

3Workflow Templates
View Templates

• Auto-Categorize Blog Posts with AI

• Collect LinkedIn Profiles

• Export WordPress Posts for SEO

Tags

activepiecesafter-hoursahrefsaiAI cost reductionai-agentsai-automationangularantigravityapiAqua Securityarcade-gamesarchitectureautomationbackendbest-practicescadillacs-and-dinosaurschatbotchatgptCI/CD
“An intellectual says a simple thing in a hard way, an artist says a hard thing in a simple way.”
Charles Bukowski
View more quotes

Similar Articles

Discover more related content

Testing Kimi Code: First Impressions from Web and CLI

Testing Kimi Code: First Impressions from Web and CLI

Why I started testing Kimi Code, how it compares to Claude Code, and why the $1.49 first-month deal made it a no-brainer

19 February 2026
RTCROS Framework: Structure Your Prompts for Better AI Results

RTCROS Framework: Structure Your Prompts for Better AI Results

A six-part framework to eliminate guesswork and get consistent, high-quality responses from AI

20 January 2026
llms.txt and llms-full.txt: Making Your Website AI-Readable

llms.txt and llms-full.txt: Making Your Website AI-Readable

Use llms.txt & llms-full.txt files to help AI systems understand your website and potentially boost visibility in AI-generated answers.

18 December 2025
Piotr Sikora | ai | n8n | javascript | python

Let's get to know each other!

Get in touch with me
Piotr Sikora | Process Automation  | AI Implementation 🤖 | Technology Consulting
Quick links
  • Home
  • Blog
  • Contact
Contact
  • piotr.sikora.ck@gmail.com
  • +48 505 684 661

© Piotr Sikora 2026 | All Rights Reserved