---
title: "Generate a stream of token using Server-Sent Events"
method: POST
path: "/generate_stream"
tags: ["Text Generation Inference"]
---

# Generate a stream of token using Server-Sent Events

`POST /generate_stream`

Generate a stream of token using Server-Sent Events

## Request body

- GenerateRequest — unresolved $ref

## Response `200`

Generated Text

## Other responses

- `422` — Input validation error
- `424` — Generation Error
- `429` — Model is overloaded
- `500` — Incomplete generation

## Changes

- **2023-02-24** `b1dc76c2e991` — 1 info
  - added the required property `token/special` to the response with the `200` status
- **2023-02-16** `85e3db450aba` — 5 breaking, 12 info
  - the response's body type changed from `array` to `object` for status `200`
  - the response's body type changed from `array` to `object` for status `422`
  - the response's body type changed from `array` to `object` for status `424`
  - the response's body type changed from `array` to `object` for status `429`
  - …13 more
- **2023-02-03** `a9059df72b92` — 15 breaking, 8 warning, 6 info
  - the request property `parameters/seed` became not nullable
  - the response's body type changed from `object` to `array` for status `200`
  - the response's body type changed from `object` to `array` for status `422`
  - the response's body type changed from `object` to `array` for status `424`
  - …25 more

[Change history](https://skmtc.dev/preemo-inc/apis/text-generation-inference/changes/generate_stream/post.md)

---

[API](https://skmtc.dev/preemo-inc/apis/text-generation-inference.md) · [All operations](https://skmtc.dev/preemo-inc/apis/text-generation-inference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/preemo-inc/text-generation-inference/revisions/b1dc76c2e991/schema)
