# Create renders from Spacely AI preset styles

<div><figure><img src="/files/MFvGPWPIds1ekG3n04NL" alt="" width="563"><figcaption><p>Before</p></figcaption></figure> <figure><img src="/files/TkqGXCgKG06CFeqfnikx" alt="" width="563"><figcaption><p>After - Moonless Night Style</p></figcaption></figure></div>

## Description

Transform your room images into beautifully designed spaces by selecting one of Spacely AI's preset styles. Ideal for instant redesigns and style visualizations.

## Use cases

1. Visual style experimentation for client proposals.
2. Rapid concept generation for design projects.

## Credit

1 successful Space Design API call = 1 credit.

## API

<mark style="color:green;">`POST`</mark> `https://api.spacely.ai/api/v1/generate/standard`

This endpoint is used to standard generate

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| X-API-KEY<mark style="color:red;">\*</mark> | String |             |

#### Request Body

| Name                                           | Type      | Description                                                                                                                                                                                                                                                                                 |
| ---------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| model<mark style="color:red;">\*</mark>        | String    | <p>The model name of the project. </p><p>(e.g., "spacely-v1", "spacely-unfurnished-space", "spacely-style-transfer").</p>                                                                                                                                                                   |
| imageUrl<mark style="color:red;">\*</mark>     | String    | <p>The URL of the image representing the room or space to be designed/renovated.</p><p>(e.g., "<a href="https://storage.googleapis.com/spacely/public/image/roomstyle3/bathroom-modern.jpg"><https://storage.googleapis.com/spacely/public/image/roomstyle3/bathroom-modern.jpg></a>").</p> |
| spaceType<mark style="color:red;">\*</mark>    | String    | The type of the space (e.g., "bedroom", "living\_room", "kitchen", etc.).                                                                                                                                                                                                                   |
| spaceStyle<mark style="color:red;">\*</mark>   | String    | The style of the space (e.g., "modern", "minimalist", "industrial\_loft", etc.).                                                                                                                                                                                                            |
| spaceColor                                     | String    | <p>The primary color theme or set used in the space (optional).</p><p>(e.g., "set\_1", "set\_2", "set\_3", etc.)</p>                                                                                                                                                                        |
| renovateType<mark style="color:red;">\*</mark> | String    | The type of renovation, whether "**residential**", "**commercial**" or "**exterior**"                                                                                                                                                                                                       |
| styleUrl                                       | String    | The URL pointing to additional references or inspirations for the design                                                                                                                                                                                                                    |
| materialsIds                                   | String\[] | An array of material IDs representing the materials used in the project (e.g., "paper\_wallpaper", "particle\_board", "porcelain\_tile", etc.).                                                                                                                                             |

{% tabs %}
{% tab title="200: OK Response ref Id for pulling data" %}

```json
{
  "data": REF_ID
}
```

{% endtab %}

{% tab title="400: Bad Request Not Found: Requested resource not found on the server." %}

{% endtab %}

{% tab title="401: Unauthorized The API key provided was invalid or missing." %}

{% endtab %}

{% tab title="500: Internal Server Error Unexpected condition on the server preventing request fulfillment." %}

{% endtab %}
{% endtabs %}

## Example

{% tabs %}
{% tab title="cURL" %}

```sh
curl --location 'https://api.spacely.ai/api/v1/generate/standard' \
--header 'X-API-KEY: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
    "model": "spacely-v1",
    "imageUrl": IMAGE_URL,
    "spaceType": "bedroom",
    "spaceStyle": "modern",
    "spaceColor": "",
    "renovateType": "residential",
    "styleUrl": "",
    "materialsIds": [
        "paper_wallpaper",
        "particle_board",
        "porceline_tile"
    ]
}'
```

{% endtab %}

{% tab title="JavaScript  " %}

```javascript
var myHeaders = new Headers();
myHeaders.append("X-API-KEY", YOUR_API_KEY);
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "model": "spacely-v1",
  "imageUrl": IMAGE_URL,
  "spaceType": "bedroom",
  "spaceStyle": "modern",
  "spaceColor": "",
  "renovateType": "residential",
  "styleUrl": "",
  "materialsIds": [
    "paper_wallpaper",
    "particle_board",
    "porceline_tile"
  ]
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.spacely.ai/api/v1/generate/standard", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="NodeJs" %}

```javascript
const axios = require('axios');
let data = JSON.stringify({
  "model": "spacely-v1",
  "imageUrl": IMAGE_URL,
  "spaceType": "bedroom",
  "spaceStyle": "modern",
  "spaceColor": "",
  "renovateType": "residential",
  "styleUrl": "",
  "materialsIds": [
    "paper_wallpaper",
    "particle_board",
    "porceline_tile"
  ]
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.spacely.ai/api/v1/generate/standard',
  headers: { 
    'X-API-KEY': YOUR_API_KEY, 
    'Content-Type': 'application/json'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
```

{% endtab %}

{% tab title="Go" %}

```go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.spacely.ai/api/v1/generate/standard"
  method := "POST"

  payload := strings.NewReader(`{
    "model": "spacely-v1",
    "imageUrl": IMAGE_URL
    "spaceType": "bedroom",
    "spaceStyle": "modern",
    "spaceColor": "",
    "renovateType": "residential",
    "styleUrl": "",
    "materialsIds": [
        "paper_wallpaper",
        "particle_board",
        "porceline_tile"
    ]
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("X-API-KEY", YOUR_API_KEY)
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://api.spacely.ai/api/v1/generate/standard"

payload = json.dumps({
  "model": "spacely-v1",
  "imageUrl": IMAGE_URL
  "spaceType": "bedroom",
  "spaceStyle": "modern",
  "spaceColor": "",
  "renovateType": "residential",
  "styleUrl": "",
  "materialsIds": [
    "paper_wallpaper",
    "particle_board",
    "porceline_tile"
  ]
})
headers = {
  'X-API-KEY': YOUR_API_KEY,
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
```

{% endtab %}
{% endtabs %}

## Tips and tricks

After receiving the response, use this api to retrieve the data.

{% content-ref url="/pages/Rigpf4zaZeApMsn4mhHe" %}
[Get Resources](/spacely-ai-enterprise/other-endpoints/get-resources.md)
{% endcontent-ref %}

## Support

Any question? Contact us at <support@spacely.ai>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.enterprise.spacely.ai/spacely-ai-enterprise/instant-rendering-api/create-renders-from-spacely-ai-preset-styles.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
