## Create Completion `client.agents.createCompletion(stringuuid, AgentCreateCompletionParamsbody, RequestOptionsoptions?): AgentCreateCompletionResponse` **post** `/v1/agents/{UUID}/completions` Create a completion for an agent ### Parameters - **uuid:** `string` - **body:** `AgentCreateCompletionParams` - **enable\_conversation\_history:** `boolean` Enable conversation history - **messages:** `Array` - **content:** `string | Array` - `string` - `Array` - **role:** `"user" | "agent"` - `"user"` - `"agent"` - **stream:** `boolean` Whether to stream the response using SSE - **enable\_agent\_clarification\_questions:** `boolean` - **enable\_editable\_workflow:** `boolean` - **sources:** `Array` - `SourceURL` - **type:** `"url"` - `"url"` - **url:** `string` - `SourceFile` - **file\_uri:** `string` - **type:** `"file"` - `"file"` - **thread\_id:** `string | null` Optional thread identifier - **tools:** `Array` - **search\_additional\_sources:** `boolean` - **search\_depth:** `"dynamic" | "quick" | "deep"` - `"dynamic"` - `"quick"` - `"deep"` - **type:** `"web_search"` - `"web_search"` - **sites:** `Array | null` - **url:** `string` URL for inclusion or exclusion (prefix with '-' for exclusion) - **use\_nested\_youchat\_updates:** `boolean` ### Returns - `AgentCreateCompletionResponse` - **id:** `string` - **content:** `Array` - `ContentThinking` - **citations:** `Array` - **id:** `number` - **type:** `"file" | "url"` - `"file"` - `"url"` - **attributes:** `Record` - **uri:** `string | null` - **text:** `string` - **type:** `"thinking"` - `"thinking"` - `ContentText` - **text:** `string` - **type:** `"text"` - `"text"` - **citations:** `Array` - **id:** `number` - **type:** `"file" | "url"` - `"file"` - `"url"` - **attributes:** `Record` - **uri:** `string | null` - `ContentImage` - **path:** `string` - **type:** `"image"` - `"image"` - **type:** `"response"` - `"response"` - **intermediatary\_results:** `unknown` Intermediate results (type unspecified) - **related\_searches:** `Array | null` - **text:** `string` - **sources:** `Array | null` - `ResponseSourceWeb` - **snippet:** `string` - **title:** `string` - **type:** `"web"` - `"web"` - **url:** `string` - `ResponseSourceFile` - **type:** `"file"` - `"file"` - **uri:** `string` ### Example ```typescript import YouAPI from 'you-api'; const client = new YouAPI({ bearerToken: 'My Bearer Token', }); const response = await client.agents.createCompletion('UUID', { enable_conversation_history: true, messages: [{ content: 'string', role: 'user' }], stream: true, }); console.log(response.id); ```