# Overview

Unleash your creative potential with our versatile API.

Welcome to the Spacely AI Enterprise! Our enterprise provides access to the powerful Spacely AI Design Engine, allowing you to generate impressive interior designs effortlessly. We also provide access to the Spacely AI Furniture Database, where you can search for a wide range of stylish furniture items which match with your designs or even upload your own furniture to enhance accuracy of your search on Spacely AI enterprise.

With our API, businesses can virtualize the staging of furniture products for their own clients, apply our AI design capabilities directly to their own platforms, or use our services for a range of creative applications. We're excited to see what you will build!

<figure><img src="https://3949085234-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv3dz3ARgGBgsVxs9udeD%2Fuploads%2FQ82Ia4GYLvufeNGN5110%2F2.0%20API.png?alt=media&amp;token=2d318858-3b56-46fa-be2c-9a12298c394c" alt=""><figcaption><p>Spacely AI Enterprise Dashboard</p></figcaption></figure>


# Getting Started

Kickstart your journey with Spacely AI Enterprise in a few simple steps.

This section guides you through your initial steps with the Spacely AI API. After registering on the Spacely AI Enterprise website using your email, an API key will be automatically generated for you. This key is crucial as it authenticates your API requests. Here are the steps:

1. **Register on the Spacely AI Enterprise with your email.**
2. **Once registered, navigate to your dashboard.**
3. **Your API key will be visible on your dashboard. Save this key safely as you will need it for making API requests.**

**Note:** If you ever need to reset your API key, you can do so directly from your dashboard. There will be an option labeled "Reset API Key" (reference image below). Click on it and your key will be reset instantly.

*{Include Image Here}*

<br>


# Authentication

Secure your interactions with our API using your unique API key.

All interactions with our API require the use of your unique API key for authentication. Remember to include this key in the header of all your requests to ensure successful processing.


# Rate Limiting

Get familiar with our rate limit policy to optimize your API usage.

Rate limiting is implemented to maintain the health of our system and ensure equitable access to all our users. **The rate limit is set at 100 calls per second on a per-user basis.** This means each user has their own limit which doesn't affect or is affected by other users.

In the event a user exceeds their rate limit, their account will be temporarily blocked from making further requests. If you find yourself in this situation, please contact our support team at <support@spacely.ai> for assistance.

If your business has requirements that exceed the 100 calls per second limit, we're more than willing to discuss custom arrangements. Please reach out to our team directly at <support@spacely.ai> to explore these options.

Always monitor your usage to avoid disruptions in your access to the Spacely AI API. Remember, rate limiting is in place for the benefit of all users to ensure optimal performance and availability.


# GET Resources

## Endpoint

<mark style="color:blue;">`GET`</mark> `https://api.spacely.ai/api/v1/resource`

This endpoint is used to fetch the resource list preset color, material, style residential, style commercial and ai model.

{% tabs %}
{% tab title="500: Internal Server Error " %}

{% endtab %}

{% tab title="200: OK " %}

```json
{
  "data": {
    "color": [
      {
        "id": "set_1",
        "label": "",
        "hex": ["#8c6140", "#b98d6b", "#362e2c", "#c3b869", "#676165"]
      },
      .........
    ],
    "material": {
      "wallpaper": [
        {
          "id": "paper_wallpaper",
          "label": "Paper wallpaper"
        },
        .........
      ],
      "metal": [
        {
          "id": "aluminum",
          "label": "Aluminum"
        },
        .........
      ]
    },
    "styleResidential": [
      {
        "label": "Modern",
        "id": "modern",
        "preset": {
          "bathroom": "https://storage.googleapis.com/spacely/public/image/roomstyle3/bathroom-modern.jpg",
          "bed_and_living_room": "https://storage.googleapis.com/spacely/public/image/roomstyle3/bed_and_living_room-modern.jpg",
          "bedroom": "https://storage.googleapis.com/spacely/public/image/roomstyle3/bedroom-modern.jpg",
          "dining_and_kitchen": "https://storage.googleapis.com/spacely/public/image/roomstyle3/dining_and_kitchen-modern.jpg",
          "dining_room": "https://storage.googleapis.com/spacely/public/image/roomstyle3/dining_room-modern.jpg",
          "kitchen": "https://storage.googleapis.com/spacely/public/image/roomstyle3/kitchen-modern.jpg",
          "living_and_dining_room": "https://storage.googleapis.com/spacely/public/image/roomstyle3/living_and_dining_room-modern.jpg",
          "living_room": "https://storage.googleapis.com/spacely/public/image/roomstyle3/living_room-modern.jpg",
          "working_room": "https://storage.googleapis.com/spacely/public/image/roomstyle3/working_room-modern.jpg"
        },
        "colors": [
          "set_1",
          "set_2",
          "set_3",
          "set_4",
          "set_5",
          "set_6",
          "set_7"
        ],
        "isTrending": true,
        "isNew": false
      },
      .........
    ],
    "styleCommercial": [
      {
        "label": "Modern",
        "id": "modern",
        "preset": {
          "barber_shop": "https://storage.googleapis.com/spacely/public/image/commercial-room-style/barbershop-modern.png",
          "cafe": "https://storage.googleapis.com/spacely/public/image/commercial-room-style/cafe-modern.png",
          "office": "https://storage.googleapis.com/spacely/public/image/commercial-room-style/office-modern.png",
          "spa": "https://storage.googleapis.com/spacely/public/image/commercial-room-style/spa-modern.png"
        },
        "colors": [
          "set_1",
          "set_2",
          "set_3",
          "set_4",
          "set_5",
          "set_6",
          "set_7"
        ],
        "isTrending": true,
        "isNew": false
      },
      .........
    ],
    "model": [
      {
        "id": "spacely-v1",
        "name": "Spacely V1"
      },
      {
        "id": "spacely-unfurnished-space",
        "name": "Spacely Unfurnished Space"
      },
      {
        "id": "spacely-style-transfer",
        "name": "Spacely Style Transfer"
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## Example

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

```sh
curl --location 'https://api.spacely.ai/api/v1/resource'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
var requestOptions = {
  method: 'GET',
  redirect: 'follow'
};

fetch("https://api.spacely.ai/api/v1/resource", 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 config = {
  method: 'get',
  maxBodyLength: Infinity,
  url: 'https://api.spacely.ai/api/v1/resource',
  headers: { }
};

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"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.spacely.ai/api/v1/resource"
  method := "GET"

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

  if err != nil {
    fmt.Println(err)
    return
  }
  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

url = "https://api.spacely.ai/api/v1/resource"

payload = {}
headers = {}

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

print(response.text)

```

{% endtab %}
{% endtabs %}


# POST Generate Standard

Generate unlimited space designs.

## Endpoint

<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>                                                                                                                                                                        |
| 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.).                                                                                                                                             |
| renovateType<mark style="color:red;">\*</mark> | String    | The type of renovation, whether "**residential**", "**commercial**" or "exterior"                                                                                                                                                                                                           |

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

{% endtab %}

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

{% endtab %}

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

{% endtab %}

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

```json
{
  "data": "ea6abee1-ed4b-4ca8-0000-2c215150bf9e"
}
```

{% endtab %}
{% endtabs %}

## Example

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

```sh
curl --location 'https://api.spacely.ai/api/v1/generate/standard' \
--header 'X-API-KEY: YOUR_X_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_X_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_X_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 %}


# POST Generate Advance

Advance generate unlimited space designs.

## Endpoint

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

This endpoint is used to advance 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> |
| prompt                                         | String | This could be a parameter that serves as a prompt or instruction for the model, possibly related to the style or theme of the image processing task.                                                                                                                                        |
| nPrompt                                        | String | It seems to be an empty parameter, potentially used to provide additional instructions or information to the model.                                                                                                                                                                         |
| renovateType<mark style="color:red;">\*</mark> | String | The type of renovation, whether "**residential**" or "**commercial**"                                                                                                                                                                                                                       |

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

```json
{
  "data": "63d17492-43d9-4161-0000-b067be1316dc"
}
```

{% 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/advance' \
--header 'X-API-KEY: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
    "model": "spacely-v1",
    "imageUrl": IMAGE_URL,
    "prompt": "mid_century",
    "nPrompt": "",
    "renovateType": "residential"
}
'
```

{% 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,
  "prompt": "mid_century",
  "nPrompt": "",
  "renovateType": "residential"
});

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

fetch("https://api.spacely.ai/api/v1/generate/advance", 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,
  "prompt": "mid_century",
  "nPrompt": "",
  "renovateType": "residential"
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.spacely.ai/api/v1/generate/advance',
  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/advance"
  method := "POST"

  payload := strings.NewReader(`{
    "model": "spacely-v1",
    "imageUrl": IMAGE_URL,
    "prompt": "mid_century",
    "nPrompt": "",
    "renovateType": "residential"
}
`)

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

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("X-API-KEY", 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/advance"

payload = json.dumps({
  "model": "spacely-v1",
  "imageUrl": IMAGE_URL,
  "prompt": "mid_century",
  "nPrompt": "",
  "renovateType": "residential"
})
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 %}


# POST Generate Style Transfer

Merge your selected style into your designs seamlessly.

## Endpoint

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

This endpoint is used to style transfer generate

#### Headers

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

#### Request Body

| Name                                           | Type   | Description                                                                                                                                                                                                                                                                                 |
| ---------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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.).                                                                                                                                                                                                                   |
| styleImageUrl                                  | String | The URL pointing to additional references or inspirations for the design                                                                                                                                                                                                                    |
| renovateType<mark style="color:red;">\*</mark> | String | The type of renovation, whether "**residential**", "**commercial**" or "exterior"                                                                                                                                                                                                           |

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

{% endtab %}

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

{% endtab %}

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

{% endtab %}

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

```json
{
  "data": "ea6abee1-ed4b-4ca8-0000-2c215150bf9e"
}
```

{% endtab %}
{% endtabs %}

## Example

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

```sh
curl --location 'https://api.spacely.ai/api/v1/generate/style-transfer' \
--header 'X-API-KEY: YOUR_X_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
    "spaceType": "bathroom",
    "imageUrl": "https://storage.googleapis.com/spacely/public/image/roomstyle3/bathroom-modern.jpg",
    "styleImageUrl": "https://storage.googleapis.com/spacely/public/image/residential-room-style-2/nordic-bedroom.jpg",
    "renovateType": "residential"
}'
```

{% endtab %}

{% tab title="JavaScript" %}

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

var raw = JSON.stringify({
  "spaceType": "bathroom",
  "imageUrl": "https://storage.googleapis.com/spacely/public/image/roomstyle3/bathroom-modern.jpg",
  "styleImageUrl": "https://storage.googleapis.com/spacely/public/image/residential-room-style-2/nordic-bedroom.jpg",
  "renovateType": "residential"
});

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

fetch("https://api.spacely.ai/api/v1/generate/style-transfer", 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({
  "spaceType": "bathroom",
  "imageUrl": "https://storage.googleapis.com/spacely/public/image/roomstyle3/bathroom-modern.jpg",
  "styleImageUrl": "https://storage.googleapis.com/spacely/public/image/residential-room-style-2/nordic-bedroom.jpg",
  "renovateType": "residential"
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.spacely.ai/api/v1/generate/style-transfer',
  headers: { 
    'X-API-KEY': YOUR_X_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/style-transfer"
  method := "POST"

  payload := strings.NewReader(`{
    "spaceType": "bathroom",
    "imageUrl": "https://storage.googleapis.com/spacely/public/image/roomstyle3/bathroom-modern.jpg",
    "styleImageUrl": "https://storage.googleapis.com/spacely/public/image/residential-room-style-2/nordic-bedroom.jpg",
    "renovateType": "residential"
}`)

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

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("X-API-KEY", YOUR_X_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/style-transfer"

payload = json.dumps({
  "spaceType": "bathroom",
  "imageUrl": "https://storage.googleapis.com/spacely/public/image/roomstyle3/bathroom-modern.jpg",
  "styleImageUrl": "https://storage.googleapis.com/spacely/public/image/residential-room-style-2/nordic-bedroom.jpg",
  "renovateType": "residential"
})
headers = {
  'X-API-KEY': YOUR_X_API_KEY,
  'Content-Type': 'application/json'
}

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

print(response.text)

```

{% endtab %}
{% endtabs %}


# GET Polling Data

## Endpoint

<mark style="color:blue;">`GET`</mark> `https://api.spacely.ai/api/v1/generate/poll-result?refId={{refId}}`

This endpoint is used to fetch result from standard and advance generate

#### Path Parameters

| Name                                    | Type   | Description                              |
| --------------------------------------- | ------ | ---------------------------------------- |
| refId<mark style="color:red;">\*</mark> | String | Refid after stansard or advance generate |

#### Headers

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

{% tabs %}
{% tab title="200: OK Response status success" %}

```json
{
  "data": {
    "status": "success",
    "result": [
      "https://storage.googleapis.com/spacely-enterprise/c18302f5-a9de-422d-000/ea6abee1-ed4b-4ca8-994e-2c215150bf9e-1.png",
      "https://storage.googleapis.com/spacely-enterprise/c18302f5-a9de-422d-000/ea6abee1-ed4b-4ca8-994e-2c215150bf9e-2.png",
      "https://storage.googleapis.com/spacely-enterprise/c18302f5-a9de-422d-000/ea6abee1-ed4b-4ca8-994e-2c215150bf9e-3.png",
      "https://storage.googleapis.com/spacely-enterprise/c18302f5-a9de-422d-000/ea6abee1-ed4b-4ca8-994e-2c215150bf9e-4.png"
    ]
  }
}
```

{% endtab %}

{% tab title="200: OK Response status processing" %}

```json
{
  "data": {
    "status": "processing",
    "result": []
  }
}
```

{% 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/poll-result?refId=REF_ID' \
--header 'X-API-KEY: YOUR_API_KEY'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("X-API-KEY", YOUR_API_KEY);

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://api.spacely.ai/api/v1/generate/poll-result?refId=068e3933-4aeb-4b4d-a473-9f8fa9f2d20a", 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 config = {
  method: 'get',
  maxBodyLength: Infinity,
  url: 'https://api.spacely.ai/api/v1/generate/poll-result?refId=REF_ID',
  headers: { 
    'X-API-KEY': YOUR_API_KEY
  }
};

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"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.spacely.ai/api/v1/generate/poll-result?refId=REF_ID"
  method := "GET"

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

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

  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

url = "https://api.spacely.ai/api/v1/generate/poll-result?refId=REF_ID"

payload = {}
headers = {
  'X-API-KEY': YOUR_API_KEY
}

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

print(response.text)

```

{% endtab %}
{% endtabs %}


# How can you link your products to Spacely AI?

At Spacely AI, we understand that businesses have diverse operational frameworks. Hence, to seamlessly integrate your furniture products into our system, we offer two straightforward methods. Assess the options below to determine which fits best with your current setup:

***

#### Option 1: CSV File with Image Directories

**Overview:** This method requires you to prepare a CSV file containing product details and send your product images as separate files. The images are referenced in the CSV by their exact filenames.

**Who Should Choose This?**

* If you already have a local directory of product images.
* If your images aren't already hosted online.
* If you prefer a consolidated upload of data and images.

{% content-ref url="/pages/KGwY09kYPzysWsGlH2ZK" %}
[Option 1 : CSV file with image directories](/spacely-ai-enterprise-old/furniture-partnership/option-1-csv-file-with-image-directories)
{% endcontent-ref %}

***

#### Option 2: CSV File with Image URLs

**Overview:** This is a more streamlined method where you only send a CSV file. In the CSV, you provide direct URLs pointing to where each product image is hosted online.

**Who Should Choose This?**

* If your product images are already hosted online.
* If you want a faster and simpler integration method.
* If you can ensure the URLs are publicly accessible and long-lasting.

{% content-ref url="/pages/h3pIixQ4yK8f0W3px3LR" %}
[Option 2 : CSV file with image urls](/spacely-ai-enterprise-old/furniture-partnership/option-2-csv-file-with-image-urls)
{% endcontent-ref %}


# Option 1 : CSV file with image directories

{% file src="/files/yGGaInFhy4woN6PQ1aws" %}
Template Option 1: CSV File with Image Directories
{% endfile %}

This method requires partners to send their product images as separate files, referenced in the CSV by their respective directory names.

**Steps:**

1. **Prepare the CSV**:
   * Populate the CSV with all the necessary product information.
   * For the image column, list the exact filename (including the file extension) of the corresponding product image.
2. **Prepare the Image Files**:
   * Collate all product images into one folder.
   * Ensure each image file is named exactly as listed in the CSV.
   * Compress the folder to reduce the file size (using tools like WinRAR or 7-Zip).
3. **Sending the Data**:
   * Attach the completed CSV and the compressed image folder to an email.
   * Subject should be “*\[Your Name]* - Add Product Database with Image Directories”.
   * Email it to <support@spacely.ai>.

**CSV directory:**

<table><thead><tr><th width="190">Column</th><th>Definition</th><th data-hidden>Definition</th><th data-hidden></th></tr></thead><tbody><tr><td>product_id <mark style="color:red;">(required)</mark></td><td>A unique identifier for each product.</td><td></td><td></td></tr><tr><td>url <mark style="color:red;">(required)</mark></td><td>The web address where more information about the product can be found.</td><td></td><td></td></tr><tr><td>brand <mark style="color:red;">(required)</mark></td><td>The brand name of the product.</td><td></td><td></td></tr><tr><td>name <mark style="color:red;">(required)</mark></td><td>The name or title of the product.</td><td></td><td></td></tr><tr><td>category <mark style="color:red;">(required)</mark></td><td>The broad category to which the product belongs (e.g., Bed Frames, Tables &#x26; desks).</td><td></td><td></td></tr><tr><td>sub_category</td><td>A more specific classification within the main category (e.g., Sofa-beds, Desks &#x26; Computer Desks).</td><td>no require</td><td></td></tr><tr><td>tags</td><td>Keywords or phrases associated with the product, useful for search and categorization.</td><td></td><td></td></tr><tr><td>color</td><td>The primary color(s) of the product.</td><td>no require</td><td></td></tr><tr><td>price</td><td>The selling price of the product.</td><td></td><td></td></tr><tr><td>currency</td><td>The currency in which the price is listed.</td><td></td><td></td></tr><tr><td>unit</td><td>The number of units this pricing refers to.</td><td></td><td></td></tr><tr><td><mark style="color:blue;">images</mark> <mark style="color:red;">(required)</mark></td><td><mark style="color:blue;">Paths or filenames of images associated with the product, typically relative to a base directory.</mark></td><td></td><td></td></tr><tr><td>width_cm</td><td>The width of the product in centimeters.</td><td></td><td></td></tr><tr><td>length_cm</td><td>The length of the product in centimeters.</td><td></td><td></td></tr><tr><td>height_cm</td><td>The height of the product in centimeters.</td><td></td><td></td></tr></tbody></table>


# Option 2 : CSV file with image urls

{% file src="/files/Pk2UHL5lffZlRMRnHam8" %}
Option 2 : CSV file with image urls
{% endfile %}

This method is more streamlined as it requires only the CSV, with direct URLs pointing to where each product image is hosted online.

**Steps:**

1. **Prepare the CSV**:
   * Populate the CSV with all the necessary product information.
   * For the image column, paste the direct URL where the product image is hosted online. Ensure these URLs are publicly accessible and do not expire.
2. **Image Hosting Recommendations**:
   * Use reliable image hosting platforms to ensure the URLs remain active and accessible.
   * Opt for high-resolution images but consider the loading time and bandwidth for end-users.
3. **Sending the Data**:
   * Attach the completed CSV to an email.
   * Subject should be “Name - Add Product Database with Image URLs”.
   * Email it to <support@spacely.ai>.

**CSV directory:**

<table><thead><tr><th width="190">Column</th><th>Definition</th><th data-hidden>Definition</th><th data-hidden></th></tr></thead><tbody><tr><td>product_id <mark style="color:red;">(required)</mark></td><td>A unique identifier for each product.</td><td></td><td></td></tr><tr><td>url <mark style="color:red;">(required)</mark></td><td>The web address where more information about the product can be found.</td><td></td><td></td></tr><tr><td>brand <mark style="color:red;">(required)</mark></td><td>The brand name of the product.</td><td></td><td></td></tr><tr><td>name <mark style="color:red;">(required)</mark></td><td>The name or title of the product.</td><td></td><td></td></tr><tr><td>category <mark style="color:red;">(required)</mark></td><td>The broad category to which the product belongs (e.g., Bed Frames, Tables &#x26; desks).</td><td></td><td></td></tr><tr><td>sub_category</td><td>A more specific classification within the main category (e.g., Sofa-beds, Desks &#x26; Computer Desks).</td><td>no require</td><td></td></tr><tr><td>tags</td><td>Keywords or phrases associated with the product, useful for search and categorization.</td><td></td><td></td></tr><tr><td>color</td><td>The primary color(s) of the product.</td><td>no require</td><td></td></tr><tr><td>price</td><td>The selling price of the product.</td><td></td><td></td></tr><tr><td>currency</td><td>The currency in which the price is listed.</td><td></td><td></td></tr><tr><td>unit</td><td>The number of units this pricing refers to.</td><td></td><td></td></tr><tr><td><mark style="color:blue;">images</mark> <mark style="color:red;">(required)</mark></td><td><mark style="color:blue;">URLs of images associated with the product, directly accessible over the internet.</mark></td><td></td><td></td></tr><tr><td>width_cm</td><td>The width of the product in centimeters.</td><td></td><td></td></tr><tr><td>length_cm</td><td>The length of the product in centimeters.</td><td></td><td></td></tr><tr><td>height_cm</td><td>The height of the product in centimeters.</td><td></td><td></td></tr></tbody></table>


# An example of furniture images

**Requirement:**

* High-resolution images: Minimum dimensions of **512 x 512 pixels.**
* Format preference: Require images in **both PNG with background and PNG without background (transparent).** If only one image is available, it should be PNG without background.
* Multiple angles: Capture the **same furniture piece from different perspectives.**
* Single item per image: **Ensure only one primary furniture item** is featured in each image.

<br>


# FAQs

Find answers to your most common queries about Spacely AI Enterprise API usage.

1. **What is the difference between accounts on Spacely AI and Spacely AI Enterprise?** \
   The account you create on the Spacely AI Enterprise website is separate from the one you have on the Spacely AI website. These two platforms serve different purposes. Spacely AI is used for generating designs on the Spacely AI website, while Spacely AI Enterprise offers an API to use the Spacely AI engine on your own website.
2. **Are the pricing and payment different between Spacely AI and Spacely AI Enterprise?** \
   Yes, pricing and payment options for Spacely AI and Spacely AI Enterprise are separate and cater to the specific features and offerings of each platform.
3. **I have exceeded the rate limit. What can I do now?** \
   If you have exceeded the rate limit, please reach out to our support team at **<support@spacely.ai>**  for assistance.
4. **How do I reset my API Key?** \
   You can reset your API key on the Spacely AI Enterprise website dashboard.
5. **How do I report a technical issue or error?** \
   Technical issues or errors can be reported to our support team. Please provide a detailed description of the issue, any error messages you have received, and your account email.


# Support

Discover how to connect with our dedicated support team for swift issue resolution.

For any questions or issues related to the Spacely AI Enterprise API, our support team is here to assist you. You can reach out to us via:

**Email:** <support@spacely.ai> - Please provide your registered email address for quicker resolution.

**Live Chat:** Our live chat support is available on the Spacely AI Enterprise website for real-time assistance.

We are dedicated to providing swift and helpful support to all our users. Please don't hesitate to reach out to us for any concerns or issues.


