---
title: "Ollama-dialect generate (NDJSON stream) — successor: POST /v1/chat/completions"
method: POST
path: "/legacy/ollama/api/generate"
tags: ["Legacy: Ollama-compatible API"]
deprecated: true
---

# Ollama-dialect generate (NDJSON stream) — successor: POST /v1/chat/completions

`POST /legacy/ollama/api/generate`

## Request

- Base URL: `http://localhost:9998`
- URL: `http://localhost:9998/legacy/ollama/api/generate`
- Auth: HTTP bearer

> **Deprecated.**

Prompt-completion spelling of the same inference path. The deprecated `context` field is emitted empty and ignored on input (stateless generate); `raw`, `suffix`, and `template` are refused 400 — no honest mapping onto chat-template inference exists.

## Request body

- object
  - `model` string, required
  - `prompt` string
  - `stream` boolean
  - `images` string[]
  - `format` unknown
  - `options` object

## Response `200`

NDJSON delta stream; terminal object has done:true

## Other responses

- `400`: Unsupported field (raw/suffix/template) or malformed request

---

[API](https://skmtc.dev/modelpiper/apis/toolpiper-api.md) · [All operations](https://skmtc.dev/modelpiper/apis/toolpiper-api/llms.txt) · [OpenAPI document](https://skmtc.dev/modelpiper/apis/toolpiper-api/revisions/6722bf56385c?raw)
