Send Completion Message
Available for: Text Generator apps.
Sends a request to a text-generation app and returns the generated text.
1 min read
post/completion-messages
Request example
Response
post/completion-messages
Authorization
Body
application/jsonFiles to attach to the request. For a local file, first upload it via Upload File, then reference the returned
id as upload_file_id with transfer_method: local_file.Values for the app's input variables, keyed by variable name. The expected names and types come from the
user_input_form field of Get App Parameters.The text to process. Legacy field; newer apps pass this inside
inputs instead.Default: ""
Mode of response return.
streaming (recommended) uses SSE. blocking returns after completion (may be interrupted for long processes). Cloudflare timeout is 100 s. When omitted, defaults to blocking behavior.Options:
streamingblockingEnd-user identifier, defined by your app and unique within it. Messages and files are visible only to requests carrying the same
user. See End User Identity.Responses
Successful response. The content type and structure depend on the response_mode parameter in the request.
- If
response_modeisblocking, returnsapplication/jsonwith aCompletionResponseobject. - If
response_modeisstreaming, returnstext/event-streamwith a stream ofChunkCompletionEventobjects.
Complete response content.
Message creation timestamp (Unix epoch seconds).
Event type, fixed as
message.Unique ID of this response event.
Unique message ID. Use this as the
message_id parameter when calling feedback or suggested questions endpoints.App mode, fixed as
completion.Task ID for request tracking and the Stop Completion Message Generation API.