---
title: "POST /create-chat-completion"
method: POST
path: "/create-chat-completion"
---

# POST /create-chat-completion

`POST /create-chat-completion`

Create a chat completion message

## Request body

- object
  - `chat_id` string, required — Unique id of the chat to create completion.
  - `content` string, required — user message to generate agent chat completion.

## Response `201`

Successfully created chat completion.

- object
  - `messages` MessageOrToolCall[], required — New messages generated by the agent during this completion, including any tool call invocations and their results. Does not include the original input messages.
    - union
      - Message
        - `message_id` string, required — Unique id of the message
        - `role` 'agent' | 'user', required — Documents whether this message is sent by agent or user.
        - `content` string, required — Content of the message
        - `created_timestamp` integer, required — Create timestamp of the message
      - ToolCallInvocationMessage
        - `message_id` string, required — Unique id of the message
        - `role` 'tool_call_invocation', required — This is a tool call invocation.
        - `tool_call_id` string, required — Tool call id, globally unique.
        - `name` string, required — Name of the function in this tool call.
        - `arguments` string, required — Arguments for this tool call, it's a stringified JSON object.
        - `thought_signature` string — Optional thought signature from Google Gemini thinking models. This is used internally to maintain reasoning chain in multi-turn function calling.
        - `created_timestamp` integer, required — Create timestamp of the message
      - ToolCallResultMessage
        - `message_id` string, required — Unique id of the message
        - `role` 'tool_call_result', required — This is the result of a tool call.
        - `tool_call_id` string, required — Tool call id, globally unique.
        - `content` string, required — Result of the tool call, can be a string, a stringified json, etc.
        - `successful` boolean — Whether the tool call was successful.
        - `created_timestamp` integer, required — Create timestamp of the message
      - NodeTransitionMessage
        - `message_id` string, required — Unique id of the message
        - `role` 'node_transition', required — This is a node transition.
        - `former_node_id` string — Former node id
        - `former_node_name` string — Former node name
        - `new_node_id` string — New node id
        - `new_node_name` string — New node name
        - `transition_type` 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal' — How this node was reached. "global" means a global node transition, "global_go_back" means returning from a global node, "interrupt_go_back" means going back due to user interruption, and "normal" means a regular edge transition.
        - `created_timestamp` integer, required — Create timestamp of the message
      - StateTransitionMessage
        - `message_id` string, required — Unique id of the message
        - `role` 'state_transition', required — This is a state transition.
        - `former_state_name` string — Former state name
        - `new_state_name` string — New state name
        - `created_timestamp` integer, required — Create timestamp of the message

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `402` — Payment Required
- `422` — Unprocessable Content
- `429` — Too Many Requests
- `500` — Internal Server Error

---

[API](https://skmtc.net/retellai/apis/retell-sdk.md) · [All operations](https://skmtc.net/retellai/apis/retell-sdk/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/retellai/retell-sdk/revisions/2a182bedbfc5/schema)
