> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sequenzy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate SMS Messages

> Generate SMS message variants from a prompt

# Generate SMS Messages

Generates draft SMS marketing messages with per-message encoding and segment counts. Use a generated message as the `text` of an SMS sequence step.

Messages never include opt-out footers or a brand-name prefix - Sequenzy adds both automatically at send time.

## Request

<ParamField body="prompt" type="string" required>
  Description of the SMS to generate, e.g. "cart reminder with a free-shipping hook".
</ParamField>

<ParamField body="count" type="number">
  Number of variants to generate (1-10). Defaults to `3`.
</ParamField>

```bash theme={null}
curl -X POST "https://api.sequenzy.com/api/v1/generate/sms" \
  -H "Authorization: Bearer seq_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Cart reminder with a free-shipping hook",
    "count": 3
  }'
```

## Responses

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "prompt": "Cart reminder with a free-shipping hook",
    "messages": [
      {
        "text": "Hey {{FIRST_NAME}}, your cart is waiting! Complete your order today and shipping is on us.",
        "encoding": "gsm7",
        "segments": 1,
        "characterCount": 94
      }
    ]
  }
  ```

  ```json 400 theme={null}
  {
    "error": "count must be an integer between 1 and 10"
  }
  ```

  ```json 401 theme={null}
  {
    "error": "Invalid API key"
  }
  ```

  ```json 403 theme={null}
  {
    "error": "No companies found. Create a company first using the create_company tool."
  }
  ```

  ```json 500 theme={null}
  {
    "error": "Failed to generate SMS messages"
  }
  ```
</ResponseExample>
