---
title: "Generate four new styles"
description: "Costs one credit, refunded on failure. Keeps the current diagram unchanged until a style is selected. Requires x-client-action-id; repeating a completed request is free."
---

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

Path: svgdiagram API › Generations

`POST /rest/v1/generations/{id}/styles`

Costs one credit, refunded on failure. Keeps the current diagram unchanged until a style is selected. Requires x-client-action-id; repeating a completed request is free.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `postRestV1GenerationsByIdStyles.path.id` (string, required)

## Code samples

### cURL

```curl
curl --request POST \
  --url 'https://svgdiagram.ai/rest/v1/generations/<id>/styles' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://svgdiagram.ai/rest/v1/generations/<id>/styles';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://svgdiagram.ai/rest/v1/generations/<id>/styles"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.text)
```

## Responses

### 201

New style previews

#### Example

```json
{}
```

### 400

Invalid request

#### Example

```json
{}
```

### 402

No credits

#### Example

```json
{}
```

### 409

Content changed

#### Example

```json
{}
```

### 502

Generation failed

#### Example

```json
{}
```


Source: https://docs.svgdiagram.ai/api/Generations/postRestV1GenerationsByIdStyles/index.md
