Overview
This endpoint provides text to text functionality.Request Body
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | ✅ Yes | gpt-4.1 | The model to use for the request |
messages | array | ✅ Yes | - | Array of message objects for the conversation |
stream | boolean | ❌ No | true | Whether to stream the response |
Messages Array Structure
Each message object in themessages array should have the following structure:
| Field | Type | Required | Description |
|---|---|---|---|
role | string | ✅ Yes | The role of the message. Can be: user, assistant, or system |
content | array/string | ✅ Yes | The content of the message |
Content Array Structure (when content is an array)
| Field | Type | Required | Example | Description |
|---|---|---|---|---|
type | string | ✅ Yes | text | The type of content |
text | string | ✅ Yes | "The positive prompt for the generation." | The text content when type is text |

