﻿---
title: stack kb security-ai-assistant-api chat-complete cli command
description: Create a model response Behaviour flags: --dry-run — validate all inputs and exit without performing any action 
url: https://www.elastic.co/elastic/docs-builder/docs/4075/reference/elastic-cli/cli/stack/kb/security-ai-assistant-api/chat-complete
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

# stack kb security-ai-assistant-api chat-complete cli command
<cli-modifiers>
</cli-modifiers>

```bash
elastic stack kb security-ai-assistant-api chat-complete \
  --connector-id <connector-id> \
  --messages <messages> \
  --persist \
  [options]
```

Create a model response
**Behaviour flags:**
`--dry-run` — validate all inputs and exit without performing any action

## Options

<definitions>
  <definition term="--connector-id string required">
    Required connector identifier to route the request.
  </definition>
  <definition term="--messages string[] required">
    List of chat messages exchanged so far.
    **Repeatable:** pass `--messages` multiple times to supply more than one value
  </definition>
  <definition term="--persist required">
    Whether to persist the chat and response to storage.
  </definition>
  <definition term="--content-references-disabled">
    If true, the response will not include content references.
  </definition>
  <definition term="--conversation-id string">
    Existing conversation ID to continue.
  </definition>
  <definition term="--is-stream">
    If true, the response will be streamed in chunks.
  </definition>
  <definition term="--lang-smith-api-key string">
    API key for LangSmith integration.
  </definition>
  <definition term="--lang-smith-project string">
    LangSmith project name for tracing.
  </definition>
  <definition term="--model string">
    Model ID or name to use for the response.
  </definition>
  <definition term="--prompt-id string">
    Prompt template identifier.
  </definition>
  <definition term="--response-language string">
    ISO language code for the assistant's response.
  </definition>
  <definition term="--input-file string">
    path to a JSON file to use as command input
  </definition>
  <definition term="--dry-run">
    validate all inputs and exit without performing any action (preview changes without applying them)
  </definition>
</definitions>


## Global Options

<definitions>
  <definition term="--json">
    output as JSON
  </definition>
</definitions>