---
title: "Create chat completion (proxy stream)"
method: POST
path: "/liteforms/chat_proxy_stream"
tags: ["Liteforms"]
---

# Create chat completion (proxy stream)

`POST /liteforms/chat_proxy_stream`

Sends a message to the OpenAI chat completions endpoint. Partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only <a href="https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#event_stream_format">server-sent events</a> as they become available, with the stream terminated by a data: [DONE] message.

## Request body

- LiteformsChatProxyStreamBody
  - `model` 'gpt-3.5-turbo' | 'gpt-3.5-turbo-0613' | 'gpt-4' | 'gpt-4-0613' | 'gpt-4-32k' | 'gpt-4-32k-0613' | 'gpt-4o' — The OpenAI model to use.
  - `messages` object[], required
    - `role` 'system' | 'user' | 'assistant' | 'function', required
    - `content` string, required — The content of the message.
    - `name` string — The name of the author of this message. May contain a-z, A-Z, 0-9, and underscores, with a maximum length of 64 characters.
  - `presence_penalty` number — Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
  - `frequency_penalty` number — Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
  - `temperature` number — The temperature of the model. Must be between 0 and 1.
  - `top_p` number — The top_p of the model. Must be between 0 and 1.
  - `max_tokens` number — The maximum number of tokens to return.

## Response `200`

Successful response

- unknown

## Other responses

- `401` — Invalid authentication credentials.
- `408` — The server timed out waiting for the request.
- `412` — Usage has exceeded the monthly limit.
- `500` — An unspecified error occurred.

---

[API](https://skmtc.dev/blocks/apis/looking-glass-api.md) · [All operations](https://skmtc.dev/blocks/apis/looking-glass-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/blocks/looking-glass-api/revisions/c79a9a0e44b0/schema)
