# Pattern AI

```
POST /v2/generate
```

**Parameters**

<table><thead><tr><th width="174">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>model</td><td>string</td><td><p><strong>Required</strong></p><p>Value must be <strong><code>pattern</code></strong> for Pattern AI. Browse other <a href=""><strong>Generators</strong></a>.</p></td></tr><tr><td>prompt</td><td>string</td><td><p><strong>Required</strong></p><p>Description of desired pattern design</p></td></tr><tr><td>image</td><td>string</td><td><p><em>Optional</em></p><p>URL of the input image. Encode your image url if url have special characters.</p></td></tr><tr><td>enhance_prompt</td><td>string</td><td><p><em>Optional</em></p><p>If you want to use <strong>Prompt Enhance</strong> model, use <strong><code>true</code></strong> value. If you want to continue without Prompt Enhancer don't add <strong><code>enhance_prompt</code></strong> parameter to your requests.</p></td></tr><tr><td>pid</td><td>integer</td><td><p><em>Optional</em></p><p>Persona ID to use if you want to use <a href="../personas/persona-slots">Persona Slots</a> for images.</p></td></tr><tr><td>format</td><td>string</td><td><p><em>Optional</em></p><p>Output format values: <code>jpg</code>, <code>png</code> or <code>webp</code></p></td></tr><tr><td>processing_url</td><td>string</td><td><p>O<em>ptional</em></p><p>Get process results with same endpoint, alternative to <a href="../introduction/get-process-results"><strong><code>/results</code></strong></a> endpoint usage.</p></td></tr><tr><td>webhook</td><td>string</td><td><p><em>Optional</em></p><p>Get process results with real-time <a href="../introduction/webhooks">webhooks</a>, alternative to <a href="../introduction/get-process-results"><strong><code>/results</code></strong></a> endpoint usage.</p></td></tr></tbody></table>

**Curl Example**

```bash
curl -X POST https://api.luw.ai/v2/generate \
  -H "Authorization: Bearer LUW_API_TOKEN" \
  -d "model=pattern" \
  -d "query=flowers"
```

**Response Example**

```json
{
  "status": true,
  "progress": {
    "started_at": "2024-01-04T12:00:00Z",
    "state": "processing",
    "percent": 45
  },
  "processing": true,
  "processing_url": "abc_123..."
}
```

## ✨ Get results using the [**`/results`**](https://luw-ai.gitbook.io/api/luw.ai-api-documentation/introduction/get-process-results) endpoint.

Alternative legacy method: Add **`&processing_url={url}`** to your request.
