Skip to main content

Create an agent chat completion (OpenAI Chat Completions API)

POST 

/agent/:id/chat/completions

OpenAI Chat Completions-compatible endpoint for the agent identified by id (the workflow id). When stream: true, returns a text/event-stream of OpenAI chat.completion.chunk frames terminated by data: [DONE]; when stream is false/absent, returns a single chat.completion JSON object.

The last user-role message is taken as the prompt (multi-modal content is flattened to its text parts). Generation parameters (temperature, top_p, max_tokens, tools, tool_choice, ...) are accepted for SDK compatibility but ignored — the agent runs with its workflow-bound model and tool set. n must be 1. The legacy functions / function_call fields are rejected. The Alien extension conversation_id carries the session id between turns.

This endpoint has no native resume (POSTing again starts a fresh run); use the Responses API for resume. The full SSE taxonomy is in the Chat Completions streaming guide.

Request

Responses

When stream: true: an OpenAI Chat Completions-conformant SSE stream terminated by data: [DONE]. When non-streaming: a single chat.completion JSON object.