# Overview

Welcome on Gepetto API documentation

Welcome to Gepetto API! Dive into our cutting-edge AI Design Engine to craft stunning interior designs with ease. For businesses, our API opens doors to virtual staging, integration of our redesign AI and all of what your imagination can build. We can't wait to witness your creations!


# Getting Started

Kickstart your integration with the Gepetto API in a few simple steps.

* **Login to Gepetto and go to the** [**API Page**](https://app.gepettoapp.com/easy/account/api)
* **Create a free testing API key**
* **Subscribe to an API License to receive your production API Key**


# Rate limiting

Familiarize yourself with our rate limit rules to maximize your API experience.

Rate limiting is in place to preserve system integrity and guarantee fair access for all users. Each user is allocated a limit of **120 calls per minute**, ensuring that one user's activity doesn't impact or get impacted by another's.

This limit is likely to increase soon. Please let us know if your use-case requires more flexibility.


# Server Status

Check the status page to get updates: [https://gepettoai.statuspage.io/](https://gepettoai.statuspage.io)


# Creative Redesign

Creative Redesign will redesign a room in a specific style.

**Creative Redesign** will redesign a room in a specific style. If the room is empty it won't add many furnitures, use the [Smart Staging v2](/endpoints/smart-staging-v2) or [Furnish](/endpoints/furnish) mode if you need to add furnitures first.

{% hint style="success" %}
This mode is fully automatic, no mask is required, and results tends to be more creative and smart than the default Redesign mode.
{% endhint %}

### Endpoint

<mark style="color:green;">`POST`</mark> `https://europe-west1-gepettoai.cloudfunctions.net/v1/creative-redesign`

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {{API\_KEY}} |

#### Request Body

<table><thead><tr><th width="269">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>url<mark style="color:red;">*</mark></td><td>String (Url)</td><td><p>Image URL of the room to be redesigned.</p><p>Ex: <a href="https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg">https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg</a></p></td></tr><tr><td>styleId<mark style="color:red;">*</mark></td><td>String</td><td>The style ID that can be fetched on the <a href="https://docs.gepettoapp.com/endpoints/get-styles">Get Styles </a>endpoint.</td></tr><tr><td>roomId<mark style="color:red;">*</mark></td><td>String</td><td>The room ID that can be fetched on the <a href="https://docs.gepettoapp.com/endpoints/get-rooms">Get Rooms</a> endpoint.</td></tr><tr><td>webhook</td><td>String</td><td>(optional) Webhook <strong>POST</strong> URL to send the result on completion.<br><br>If not provided, the request will wait for the result.</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK If webhook is not set" %}

```json
{
  "base64": "<base64 encoded image>",
  "status": "success"
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}

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

{% endtab %}

{% tab title="200: OK If webhook is provided" %}

```json
{
  "status": "pending",
  "id": "xxxxxxxxxxxxxx", // You can use that id with Get Job
  "styleId": "your_style",
  "roomId": "your_room",
  "creativity": 14,
  "mode": "redesign"
}
```

{% endtab %}
{% endtabs %}

### Code Examples

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

```bash
curl --location 'https://europe-west1-gepettoai.cloudfunctions.net/v1/creative-redesign' \
--header 'Authorization: Bearer {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
  "url": "https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg",
  "styleId": "demeures",
  "roomId": "living_room"
}'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {{API_KEY}}");
myHeaders.append("Content-Type", "application/json");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: JSON.stringify({
    "url": "https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg",
    "styleId": "demeures",
    "roomId": "living_room"
  })
};

const response = await fetch("https://europe-west1-gepettoai.cloudfunctions.net/v1/creative-redesign", requestOptions)
const body = await reponse.json();
console.log(body)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://europe-west1-gepettoai.cloudfunctions.net/v1/creative-redesign"

payload = json.dumps({
  "url": "https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg",
  "styleId": "demeures",
  "roomId": "living_room"
})
headers = {
  'Authorization': 'Bearer {{API_KEY}}',
  'Content-Type': 'application/json'
}

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

print(response.text)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$client = new Client();
$headers = [
  'Authorization' => 'Bearer {{API_KEY}}',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg",
  "styleId": "demeures",
  "roomId": "living_room"
}';
$request = new Request('POST', 'https://europe-west1-gepettoai.cloudfunctions.net/v1/creative-redesign', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

```

{% endtab %}

{% tab title="GO" %}

```go
package main

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

func main() {

  url := "https://europe-west1-gepettoai.cloudfunctions.net/v1/creative-redesign"
  method := "POST"

  payload := strings.NewReader(`{
    "url": "https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg",
    "styleId": "demeures",
    "roomId": "living_room"
}`)

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

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer {{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="Ruby" %}

```ruby
require "uri"
require "json"
require "net/http"

url = URI("https://europe-west1-gepettoai.cloudfunctions.net/v1/creative-redesign")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer {{API_KEY}}"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg",
  "styleId": "demeures",
  "roomId": "living_room"
})

response = https.request(request)
puts response.read_body

```

{% endtab %}
{% endtabs %}

### Results To Expect

<figure><img src="/files/2huTa0cijD4dauTKtRtK" alt=""><figcaption><p>Living room in a Scandinave style (Upscaled)</p></figcaption></figure>

<figure><img src="/files/usY8Q9Si4GAQVnKUGck8" alt=""><figcaption><p>Kitchen in a Provence style (Upscaled)</p></figcaption></figure>

<figure><img src="/files/UfGowu006r1Z9WWVj5Bu" alt=""><figcaption><p>Terrace with Pool in a Copenhagen Style (Upscaled)</p></figcaption></figure>

<figure><img src="/files/0cnAmpV1tabB4rzCb94P" alt=""><figcaption><p>Living room in a scandinave style (Upscaled)</p></figcaption></figure>

<figure><img src="/files/Hg5dGNMTNQIa3f2RseMY" alt=""><figcaption><p>Bathroom in a Cap Ferret style (Upscaled)</p></figcaption></figure>

<figure><img src="/files/JVyqqbDZgYDVi5qr7P0Y" alt=""><figcaption><p>Terrace with pool in a provence style (Upscaled)</p></figcaption></figure>


# Furnish

Furnish will let you add furnitures to empty rooms.

For an automatic staging without mask and more advanced technology, we recommend to use the [Smart Staging V2 endpoint](/endpoints/smart-staging-v2).

<div><figure><img src="/files/F64lLxOsyrMNqghAJZRS" alt=""><figcaption><p>Before</p></figcaption></figure> <figure><img src="/files/9KxtFzN8uqOGKkRSCzA7" alt=""><figcaption><p>After</p></figcaption></figure></div>

### Endpoint

<mark style="color:green;">`POST`</mark> `https://europe-west1-gepettoai.cloudfunctions.net/v1/furnish`

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {{API\_KEY}} |

#### Request Body

| Name                                          | Type                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                   |
| --------------------------------------------- | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| url<mark style="color:red;">\*</mark>         | String (URL)           | <p>Image URL of the room to be redesigned.</p><p>Ex: <a href="https://firebasestorage.googleapis.com/v0/b/gepettoai.appspot.com/o/raw-images%2F7aa0df81-854a-4676-9bf0-026492c3cc4d.jpeg?alt=media&#x26;token=a259551b-0c01-4268-a069-20117c124ede">Base Image</a></p>                                                                                                                                                        |
| mask                                          | String (URL)           | <p>Custom mask image URL of the area to furnish.<br>Ex: <a href="https://firebasestorage.googleapis.com/v0/b/gepettoai.appspot.com/o/mask%2F77fe7e96-5a4a-40eb-8364-bdb7b91dee27.jpeg?alt=media&#x26;token=c8f97323-18b7-4281-b2ae-8220c3ee3b66">Mask Image</a><br></p><p>⚠️ The mask should have the same dimension as the base image <code>url</code> parameter.<br><br>If set, <code>preserveWindows</code> is ignored</p> |
| roomId<mark style="color:red;">\*</mark>      | String                 | <p>The room ID that can be fetched on the <a href="https://docs.gepettoapp.com/endpoints/get-rooms">Get Rooms</a> endpoint.<br><br><mark style="color:$danger;">Cannot be used simultaneouly with <strong>furnitureId</strong></mark></p>                                                                                                                                                                                     |
| furnitureId<mark style="color:red;">\*</mark> | String                 | <p>The furniture ID that can be fetched on the<a data-mention href="/pages/tVum1xHYTYStxg6W3rEh">/pages/tVum1xHYTYStxg6W3rEh</a> endpoint<br><br><mark style="color:$danger;">Cannot be used simultaneouly with <strong>roomId</strong></mark></p>                                                                                                                                                                            |
| styleId<mark style="color:red;">\*</mark>     | String                 | The style ID that can be fetched on the [Get Styles ](https://docs.gepettoapp.com/endpoints/get-styles)endpoint.                                                                                                                                                                                                                                                                                                              |
| webhook                                       | String (URL)           | <p>(optional) Webhook <strong>POST</strong> URL to send the result on completion.<br><br>If not provided, the request will wait for the result.</p>                                                                                                                                                                                                                                                                           |
| preserveWindows                               | Boolean (true / false) | <p>(optional but highly recommend to set true)</p><p><br>Tells explicitly to not touch windows, doors, french doors and bay windows and thus not modify the view.</p>                                                                                                                                                                                                                                                         |

{% tabs %}
{% tab title="200: OK If webhook is not set" %}

```json
{
  "base64": "<base64 encoded image>",
  "status": "success"
}
```

{% endtab %}

{% tab title="200: OK If webhook is provided" %}

```json
{
  "status": "pending",
  "id": "xxxxxxxxxxxxxx", // You can use that id with Get Job
  "styleId": "your_style",
  "roomId": "your_room",
  "mode": "furnish"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}

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

{% endtab %}
{% endtabs %}

### Code Examples

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

```bash
curl --location 'https://europe-west1-gepettoai.cloudfunctions.net/v1/furnish' \
--header 'Authorization: Bearer {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
  "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg",
  "styleId": "demeures",
  "roomId": "living_room",
  "preserveWindows": true
}'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {{API_KEY}}");
myHeaders.append("Content-Type", "application/json");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: JSON.stringify({
    "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg",
    "styleId": "demeures",
    "roomId": "living_room",
    "preserveWindows": true
  })
};

const response = await fetch("https://europe-west1-gepettoai.cloudfunctions.net/v1/furnish", requestOptions)
const body = await reponse.json();
console.log(body)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://europe-west1-gepettoai.cloudfunctions.net/v1/furnish"

payload = json.dumps({
  "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg",
  "styleId": "demeures",
  "roomId": "living_room",
  "preserveWindows": True
})
headers = {
  'Authorization': 'Bearer {{API_KEY}}',
  'Content-Type': 'application/json'
}

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

print(response.text)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$client = new Client();
$headers = [
  'Authorization' => 'Bearer {{API_KEY}}',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg",
  "styleId": "demeures",
  "roomId": "living_room",
  "preserveWindows": True
}';
$request = new Request('POST', 'https://europe-west1-gepettoai.cloudfunctions.net/v1/furnish', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

```

{% endtab %}

{% tab title="GO" %}

```go
package main

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

func main() {

  url := "https://europe-west1-gepettoai.cloudfunctions.net/v1/furnish"
  method := "POST"

  payload := strings.NewReader(`{
    "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg",
    "styleId": "demeures",
    "roomId": "living_room",
    "preserveWindows": true
}`)

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

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer {{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="Ruby" %}

```ruby
require "uri"
require "json"
require "net/http"

url = URI("https://europe-west1-gepettoai.cloudfunctions.net/v1/furnish")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer {{API_KEY}}"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg",
  "styleId": "scandinave",
  "roomId": "living_room",
  "preserveWindows": true
})

response = https.request(request)
puts response.read_body

```

{% endtab %}
{% endtabs %}

<figure><img src="/files/YIYdI76u6LSd2s0BESMa" alt=""><figcaption><p>Empty room (before)</p></figcaption></figure>

<figure><img src="/files/1EoWFiRQLFe4IWFd0Zr7" alt=""><figcaption><p>Room furnish with scandinave style (after furnish + upscale)</p></figcaption></figure>

<figure><img src="/files/BCXl0oo1AV5mQpVTVCxS" alt=""><figcaption><p>Room furnish with retro style (after furnish + upscale)</p></figcaption></figure>

<figure><img src="/files/LTctbsdIPOVqJITI4YBm" alt=""><figcaption><p>Empty room (before)</p></figcaption></figure>

<figure><img src="/files/jROTXuknEfjXsUIMSnof" alt=""><figcaption><p>Mask of the space to furnish</p></figcaption></figure>

<figure><img src="/files/aMCPempiPVfpF9zVEt0p" alt=""><figcaption><p>Room with haussmann style (after furnish + upscale)</p></figcaption></figure>


# Smart Staging v2 🔮

Smart Staging allows you to furnish an interior more accurately using a more advanced technology.

<mark style="color:red;">⚠️ Smart Staging v2 is a add-on of the Gepetto API billed separately, per request.</mark>

<mark style="color:yellow;">⚠️ This feature works best with empty rooms</mark>

The only roomIds available in this mode are:&#x20;

```typescript
['living_room', 'living_dining', 'kitchen', 'kitchen_living', 'bedroom', 'dining_room', 'home_office', 'outdoor_terrace']
```

### Endpoint

<mark style="color:green;">`POST`</mark> `https://europe-west1-gepettoai.cloudfunctions.net/v1/smart-staging-v2`

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {{API\_KEY}} |

#### Request Body

<table><thead><tr><th>Name</th><th width="179">Type</th><th>Description</th></tr></thead><tbody><tr><td>url<mark style="color:red;">*</mark></td><td>String</td><td><p>Image URL of the room to be redesigned.</p><p>Ex: <br><a href="https://assets.gepettoapp.com/empty-2.png">https://assets.gepettoapp.com/empty-2.png</a></p></td></tr><tr><td>roomId<mark style="color:red;">*</mark></td><td>String</td><td>The room ID:<br><code>['living_room', 'living_dining', 'kitchen_living', 'bedroom', 'dining_room', 'home_office', 'outdoor_terrace']</code></td></tr><tr><td>styleId<mark style="color:red;">*</mark></td><td>String</td><td>The style ID that can be fetched on the <a href="https://docs.gepettoapp.com/endpoints/get-styles">Get Styles</a> endpoint.</td></tr><tr><td>webhook</td><td>String</td><td>(optional) Webhook <strong>POST</strong> URL to send the result on completion.<br><br>If not provided, the request will wait for the result.</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK If webhook is not set" %}

```json
{
  "base64": "<base64 encoded image>",
  "status": "success"
}
```

{% endtab %}

{% tab title="200: OK If webhook is provided" %}

```json
{
  "status": "pending",
  "id": "xxxxxxxxxxxxxx", // You can use that id with Get Job
  "styleId": "your_style",
  "roomId": "your_room",
  "mode": "furnish"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}

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

{% endtab %}
{% endtabs %}

### Code Examples

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

```bash
curl --location 'https://europe-west1-gepettoai.cloudfunctions.net/v1/smart-staging-v2' \
--header 'Authorization: Bearer {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
  "url": "https://assets.gepettoapp.com/empty-2.png",
  "styleId": "modern",
  "roomId": "living_room",
}'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {{API_KEY}}");
myHeaders.append("Content-Type", "application/json");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: JSON.stringify({
    "url": "https://assets.gepettoapp.com/empty-2.png",
    "styleId": "modern",
    "roomId": "living_room"
  })
};

const response = await fetch("https://europe-west1-gepettoai.cloudfunctions.net/v1/smart-staging-v2", requestOptions)
const body = await reponse.json();
console.log(body)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://europe-west1-gepettoai.cloudfunctions.net/v1/smart-staging-v2"

payload = json.dumps({
  "url": "https://assets.gepettoapp.com/empty-2.png",
  "styleId": "modern",
  "roomId": "living_room"
})
headers = {
  'Authorization': 'Bearer {{API_KEY}}',
  'Content-Type': 'application/json'
}

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

print(response.text)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$client = new Client();
$headers = [
  'Authorization' => 'Bearer {{API_KEY}}',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "https://assets.gepettoapp.com/empty-2.png",
  "styleId": "modern",
  "roomId": "living_room"
}';
$request = new Request('POST', 'https://europe-west1-gepettoai.cloudfunctions.net/v1/smart-staging-v2', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

```

{% endtab %}

{% tab title="GO" %}

```go
package main

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

func main() {

  url := "https://europe-west1-gepettoai.cloudfunctions.net/v1/smart-staging-v2"
  method := "POST"

  payload := strings.NewReader(`{
    "url": "https://assets.gepettoapp.com/empty-2.png",
    "styleId": "modern",
    "roomId": "living_room"
}`)

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

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer {{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="Ruby" %}

```ruby
require "uri"
require "json"
require "net/http"

url = URI("https://europe-west1-gepettoai.cloudfunctions.net/v1/smart-staging-v2")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer {{API_KEY}}"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "https://assets.gepettoapp.com/empty-2.png",
  "styleId": "modern",
  "roomId": "living_room"
})

response = https.request(request)
puts response.read_body

```

{% endtab %}
{% endtabs %}

### Results

<figure><img src="/files/P1DDQFVslN99Uyz8P2xj" alt=""><figcaption><p>Modern living room (Upscaled)</p></figcaption></figure>

<figure><img src="/files/ZAcmcysC0ipghgexag9q" alt=""><figcaption><p>Haussmann living room (Upscaled)</p></figcaption></figure>

<figure><img src="/files/dWI8mrHy9C6IzdQkuvpy" alt=""><figcaption><p>Living dining room (Upscaled)</p></figcaption></figure>

<figure><img src="/files/xcS0Z7LKjZbNXYoGv8VH" alt="Modern Kitchen upscaled"><figcaption><p>Modern Kitchen (Upscaled)</p></figcaption></figure>


# Refresh 🎨

The Refresh endpoint allows you to transform interior spaces by changing wall colors or floor types using advanced AI image processing.

### Wall Colors (8 options)

* `white` - Clean, bright white walls
* `egg shell` - Soft, warm off-white tone
* `black` - Bold, dramatic black walls
* `gray` - Modern, neutral gray
* `blue` - Classic blue accent
* `deep blue` - Rich, sophisticated navy
* `olive` - Earthy, natural green tone
* `terracotta` - Warm, Mediterranean orange-red

### Floor Types (5 options)

* `parquet`
* `tile`
* `marble`
* `carpet`
* `concrete`&#x20;

### Endpoint

<mark style="color:green;">`POST`</mark> `https://europe-west1-gepettoai.cloudfunctions.net/v1/refresh`

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {{API\_KEY}} |

#### Request Body

<table><thead><tr><th width="269">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>url<mark style="color:red;">*</mark></td><td>String (Url)</td><td><p>Image URL of the room to be redesigned.</p><p>Ex: <a href="https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg">https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg</a></p></td></tr><tr><td>transformation<mark style="color:red;">*</mark></td><td>String</td><td>The type of transformation:<br><code>walls</code> or <code>floor</code></td></tr><tr><td>value<mark style="color:red;">*</mark></td><td>String</td><td>The <a href="#wall-colors-8-options">color</a> or <a href="#floor-types-6-options">floor type</a></td></tr><tr><td>webhook</td><td>String</td><td>(optional) Webhook <strong>POST</strong> URL to send the result on completion.<br><br>If not provided, the request will wait for the result.</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK If webhook is not set" %}

```json
{
  "base64": "<base64 encoded image>",
  "status": "success"
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}

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

{% endtab %}

{% tab title="200: OK If webhook is provided" %}

```json
{
  "status": "pending",
  "id": "xxxxxxxxxxxxxx", // You can use that id with Get Job
  "styleId": "your_style",
  "roomId": "your_room",
  "creativity": 14,
  "mode": "redesign"
}
```

{% endtab %}
{% endtabs %}

### Code Examples

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

```bash
curl --location 'https://europe-west1-gepettoai.cloudfunctions.net/v1/refresh' \
--header 'Authorization: Bearer {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
  "url": "https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg",
  "transformation": "walls",
  "value": "white"
}'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {{API_KEY}}");
myHeaders.append("Content-Type", "application/json");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: JSON.stringify({
    "url": "https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg",
    "transformation": "walls",
    "value": "white"
  })
};

const response = await fetch("https://europe-west1-gepettoai.cloudfunctions.net/v1/refresh", requestOptions)
const body = await reponse.json();
console.log(body)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://europe-west1-gepettoai.cloudfunctions.net/v1/refresh"

payload = json.dumps({
  "url": "https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg",
  "transformation": "walls",
  "value": "white"
})
headers = {
  'Authorization': 'Bearer {{API_KEY}}',
  'Content-Type': 'application/json'
}

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

print(response.text)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$client = new Client();
$headers = [
  'Authorization' => 'Bearer {{API_KEY}}',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg",
  "transformation": "walls",
  "value": "white"
}';
$request = new Request('POST', 'https://europe-west1-gepettoai.cloudfunctions.net/v1/refresh', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

```

{% endtab %}

{% tab title="GO" %}

```go
package main

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

func main() {

  url := "https://europe-west1-gepettoai.cloudfunctions.net/v1/refresh"
  method := "POST"

  payload := strings.NewReader(`{
    "url": "https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg",
    "transformation": "walls",
    "value": "white"
}`)

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

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer {{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="Ruby" %}

```ruby
require "uri"
require "json"
require "net/http"

url = URI("https://europe-west1-gepettoai.cloudfunctions.net/v1/refresh")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer {{API_KEY}}"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg",
  "transformation": "walls",
  "value": "white"
})

response = https.request(request)
puts response.read_body

```

{% endtab %}
{% endtabs %}

### Results To Expect

| Before                                                                                              | After                                                                                                                                                                     |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <div><figure><img src="/files/mIQH4mTrqHlTCFnxTSBW" alt=""><figcaption></figcaption></figure></div> | <div><figure><img src="/files/5j4x1hH5QNZr3SMulcn3" alt=""><figcaption><p>transformation: <code>walls</code>, value: <code>white</code></p></figcaption></figure></div>   |
| <div><figure><img src="/files/bAVOuoKK4H9qIOsHA0wv" alt=""><figcaption></figcaption></figure></div> | <div><figure><img src="/files/U8vuX6TtKW7DDYg2rP7J" alt=""><figcaption><p>transformation: <code>floor</code>, value: <code>parquet</code></p></figcaption></figure></div> |


# Sunshine ☀️

Sunshine allows you to refresh the sky of your outdoors when your pictures when taken during gloomy day. 🌧️

### 💵 Credit Cost

You have two options:

* [**Enhanced sunshine**](#enhanced-mode-true) : **2 credits**
  * Ultra realistic sky with surroundings modification
  * Works for outdoor and indoor photos
* [**Regular sunshine**](#enhance-mode-false): **1 credit** <mark style="color:red;">(retired now, the sunshine mode will default to enhanced starting december 10th 2025)</mark>
  * Basic sky modification and do not affect the surroundings
  * Only works for outdoor photos

{% hint style="success" %}
For best results, we highly suggest the **Enhanced** option. It will deliver the best quality and the best accuracy. [See examples](#enhanced-mode-true)
{% endhint %}

### Endpoint

<mark style="color:green;">`POST`</mark> `https://europe-west1-gepettoai.cloudfunctions.net/v1/sunshine`

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {{API\_KEY}} |

#### Request Body

| Name                                    | Type           | Description                                                                                                                                                                                                                                                                         |
| --------------------------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| url<mark style="color:red;">\*</mark>   | String         | <p>Image URL of the outdoor to be sunshined.</p><p>Ex: <br><a href="https://img.freepik.com/premium-photo/abandoned-dilapidated-house-gloomy-sky_419341-152622.jpg"><https://img.freepik.com/premium-photo/abandoned-dilapidated-house-gloomy-sky_419341-152622.jpg></a></p><p></p> |
| skyId<mark style="color:red;">\*</mark> | String         | <p>The sky ID that can be fetched on the <a href="https://docs.gepettoapp.com/endpoints/get-skies">Get Skies </a>endpoint.<br><code>sunny, sunrise, sunset, sunset\_rose</code></p>                                                                                                 |
| webhook                                 | String         | <p>(optional) Webhook <strong>POST</strong> URL to send the result on completion.<br><br>If not provided, the request will wait for the result.</p>                                                                                                                                 |
| enhanced                                | (True / False) | <p>(recommended)</p><p></p><p>Default to false.</p><p><br>Will use to enhanced mode to deliver an ultra realistic sky modification with advanced effects on the environment. (works for both indoors and outdoors photos)<br><br><a href="#credit-cost">Cost: 2 credits</a></p>     |

{% tabs %}
{% tab title="200: OK If webhook is not set" %}

```json
{
  "base64": "<base64 encoded image>",
  "status": "success"
}
```

{% endtab %}

{% tab title="200: OK If webhook is provided" %}

```json
{
  "status": "pending",
  "id": "xxxxxxxxxxxxxx", // You can use that id with Get Job
  "skyId": "your_style"
  "mode": "sunshine"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}

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

{% endtab %}
{% endtabs %}

### Code Examples

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

```bash
curl --location 'https://europe-west1-gepettoai.cloudfunctions.net/v1/sunshine' \
--header 'Authorization: Bearer {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
  "url": "https://img.freepik.com/premium-photo/abandoned-dilapidated-house-gloomy-sky_419341-152622.jpg",
  "skyId": "sunny",
  "enhanced": true
}'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {{API_KEY}}");
myHeaders.append("Content-Type", "application/json");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: JSON.stringify({
    "url": "https://img.freepik.com/premium-photo/abandoned-dilapidated-house-gloomy-sky_419341-152622.jpg",
    "skyId": "sunny",
    "enhanced": true
  })
};

const response = await fetch("https://europe-west1-gepettoai.cloudfunctions.net/v1/sunshine", requestOptions)
const body = await reponse.json();
console.log(body)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://europe-west1-gepettoai.cloudfunctions.net/v1/sunshine"

payload = json.dumps({
  "url": "https://img.freepik.com/premium-photo/abandoned-dilapidated-house-gloomy-sky_419341-152622.jpg",
  "skyId": "demeures",
  "enhanced": True
})
headers = {
  'Authorization': 'Bearer {{API_KEY}}',
  'Content-Type': 'application/json'
}

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

print(response.text)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$client = new Client();
$headers = [
  'Authorization' => 'Bearer {{API_KEY}}',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "https://img.freepik.com/premium-photo/abandoned-dilapidated-house-gloomy-sky_419341-152622.jpg",
  "skyId": "sunny",
  "enhanced": True
}';
$request = new Request('POST', 'https://europe-west1-gepettoai.cloudfunctions.net/v1/sunshine', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

```

{% endtab %}

{% tab title="GO" %}

```go
package main

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

func main() {

  url := "https://europe-west1-gepettoai.cloudfunctions.net/v1/sunshine"
  method := "POST"

  payload := strings.NewReader(`{
    "url": "https://img.freepik.com/premium-photo/abandoned-dilapidated-house-gloomy-sky_419341-152622.jpg",
    "styleId": "sunny",
    "enhanced": true
}`)

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

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer {{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="Ruby" %}

```ruby
require "uri"
require "json"
require "net/http"

url = URI("https://europe-west1-gepettoai.cloudfunctions.net/v1/sunshine")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer {{API_KEY}}"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "https://img.freepik.com/premium-photo/abandoned-dilapidated-house-gloomy-sky_419341-152622.jpg",
  "skyId": "sunny",
  "enhanced": true
})

response = https.request(request)
puts response.read_body

```

{% endtab %}
{% endtabs %}

### Results

#### Enhanced mode "true"

<figure><img src="/files/zXgQcYR0xmd3ISk8mkEf" alt=""><figcaption><p>Original photo</p></figcaption></figure>

<figure><img src="/files/Bllj5EGrV2aCP2S3cFMK" alt=""><figcaption><p>Sunny (enhanced) + Upscale</p></figcaption></figure>

<figure><img src="/files/0z56WXEMrVkdQNOLQMAQ" alt=""><figcaption><p>Sunset (enhanced) + Upscale</p></figcaption></figure>

<figure><img src="/files/J5KozQO262dKSfYfAOKj" alt=""><figcaption><p>Sunrise (enhanced) + Upscale</p></figcaption></figure>

<div><figure><img src="/files/iQAvKH3sE9AILBCmafeu" alt=""><figcaption><p>Original photo</p></figcaption></figure> <figure><img src="/files/z4HTGkxiinsTBfq3IokY" alt=""><figcaption><p>Sunset (enhanced) + Upscale</p></figcaption></figure></div>

#### Enhance mode "false"

<figure><img src="/files/iXHynEMe36iwsM0agpIm" alt=""><figcaption><p>BEFORE</p></figcaption></figure>

<figure><img src="/files/nZjZc8oF1EKtP6DiVvc7" alt=""><figcaption><p>AFTER SUNRISE + UPSCALE</p></figcaption></figure>

<figure><img src="/files/cAv1P6TwTv5Qh5D7Yh4N" alt=""><figcaption><p>BEFORE</p></figcaption></figure>

<figure><img src="/files/zxjoRqSIWyG52il4M62e" alt=""><figcaption><p>AFTER SUNNY + UPSCALE</p></figcaption></figure>

<figure><img src="/files/qukviOSF1iSWNML70B9E" alt=""><figcaption><p>BEFORE</p></figcaption></figure>

<figure><img src="/files/626llonQ57O6ghv2YRh8" alt=""><figcaption><p>AFTER SUNNY + UPSCALE</p></figcaption></figure>


# Declutter 🧹

Declutter mode allows you to remove objects and existing furnitures from a picture.

### 💵 Credit Cost

You have two options:

* **Automatic declutter** (no mask provided): **2 credits**
* **Manual declutter** (user provides a mask): **1 credit**

{% hint style="success" %}
For best results if you need to empty a room, we highly suggest the **Automatic Declutter**. It will deliver the best quality and the best accuracy.
{% endhint %}

### Endpoint

<mark style="color:green;">`POST`</mark> `https://europe-west1-gepettoai.cloudfunctions.net/v1/declutter`

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {{API\_KEY}} |

#### Request Body

| Name                                  | Type   | Description                                                                                                                                                                                                                                        |
| ------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| url<mark style="color:red;">\*</mark> | String | <p>Image URL.</p><p><a href="https://firebasestorage.googleapis.com/v0/b/gepettoai.appspot.com/o/raw-images%2F49d4311f-2d8e-459b-97c0-5543c544a2f0.jpeg?alt=media&#x26;token=6761e09c-bf49-4b34-9606-bc4ee9909d87">Example here</a></p>            |
| mask                                  | String | <p>(optional) The mask image URL.<br><a href="https://firebasestorage.googleapis.com/v0/b/gepettoai.appspot.com/o/mask%2F268179cb-b5c7-46e3-81e8-4453a7aec8b8.jpeg?alt=media&#x26;token=f4faa70d-83a7-447d-802d-29b016ef3027">Example here</a></p> |
| webhook                               | String | <p>(optional) Webhook <strong>POST</strong> URL to send the result on completion.<br><br>If not provided, the request will wait for the result.</p>                                                                                                |

{% tabs %}
{% tab title="200: OK If webhook is not set" %}

```json
{
  "base64": "<base64 encoded image>",
  "status": "success"
}
```

{% endtab %}

{% tab title="200: OK If webhook is provided" %}

```json
{
  "status": "pending",
  "id": "xxxxxxxxxxxxxx", // You can use that id with Get Job
  "skyId": "your_style"
  "mode": "sunshine"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}

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

{% endtab %}
{% endtabs %}

### Code Examples (automatic declutter)

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

```bash
curl --location 'https://europe-west1-gepettoai.cloudfunctions.net/v1/decluter' \
--header 'Authorization: Bearer {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
  "url": "https://firebasestorage.googleapis.com/v0/b/gepettoai.appspot.com/o/raw-images%2F49d4311f-2d8e-459b-97c0-5543c544a2f0.jpeg?alt=media&token=6761e09c-bf49-4b34-9606-bc4ee9909d87"
}'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {{API_KEY}}");
myHeaders.append("Content-Type", "application/json");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: JSON.stringify({
    "url": "https://firebasestorage.googleapis.com/v0/b/gepettoai.appspot.com/o/raw-images%2F49d4311f-2d8e-459b-97c0-5543c544a2f0.jpeg?alt=media&token=6761e09c-bf49-4b34-9606-bc4ee9909d87"
  })
};

const response = await fetch("https://europe-west1-gepettoai.cloudfunctions.net/v1/declutter", requestOptions)
const body = await reponse.json();
console.log(body)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://europe-west1-gepettoai.cloudfunctions.net/v1/declutter"

payload = json.dumps({
  "url": "https://firebasestorage.googleapis.com/v0/b/gepettoai.appspot.com/o/raw-images%2F49d4311f-2d8e-459b-97c0-5543c544a2f0.jpeg?alt=media&token=6761e09c-bf49-4b34-9606-bc4ee9909d87"
})
headers = {
  'Authorization': 'Bearer {{API_KEY}}',
  'Content-Type': 'application/json'
}

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

print(response.text)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$client = new Client();
$headers = [
  'Authorization' => 'Bearer {{API_KEY}}',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "https://firebasestorage.googleapis.com/v0/b/gepettoai.appspot.com/o/raw-images%2F49d4311f-2d8e-459b-97c0-5543c544a2f0.jpeg?alt=media&token=6761e09c-bf49-4b34-9606-bc4ee9909d87"
}';
$request = new Request('POST', 'https://europe-west1-gepettoai.cloudfunctions.net/v1/declutter', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

```

{% endtab %}

{% tab title="GO" %}

```go
package main

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

func main() {

  url := "https://europe-west1-gepettoai.cloudfunctions.net/v1/declutter"
  method := "POST"

  payload := strings.NewReader(`{
    "url": "https://firebasestorage.googleapis.com/v0/b/gepettoai.appspot.com/o/raw-images%2F49d4311f-2d8e-459b-97c0-5543c544a2f0.jpeg?alt=media&token=6761e09c-bf49-4b34-9606-bc4ee9909d87"
}`)

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

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer {{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="Ruby" %}

```ruby
require "uri"
require "json"
require "net/http"

url = URI("https://europe-west1-gepettoai.cloudfunctions.net/v1/declutter")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer {{API_KEY}}"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "https://firebasestorage.googleapis.com/v0/b/gepettoai.appspot.com/o/raw-images%2F49d4311f-2d8e-459b-97c0-5543c544a2f0.jpeg?alt=media&token=6761e09c-bf49-4b34-9606-bc4ee9909d87"
})

response = https.request(request)
puts response.read_body

```

{% endtab %}
{% endtabs %}

### Results

#### Automatic Decluttering

<figure><img src="/files/CYe7DMgIlTxK0CS4i3af" alt=""><figcaption><p>Automatic declutter of living room</p></figcaption></figure>

<figure><img src="/files/ZusKT9pwWwqskm4TYYct" alt=""><figcaption><p>Automatic declutter + upscale</p></figcaption></figure>

#### Manual decluttering (with a mask)

<figure><img src="https://firebasestorage.googleapis.com/v0/b/gepettoai.appspot.com/o/raw-images%2F49d4311f-2d8e-459b-97c0-5543c544a2f0.jpeg?alt=media&#x26;token=6761e09c-bf49-4b34-9606-bc4ee9909d87" alt=""><figcaption><p>BEFORE</p></figcaption></figure>

<figure><img src="https://firebasestorage.googleapis.com/v0/b/gepettoai.appspot.com/o/mask%2F268179cb-b5c7-46e3-81e8-4453a7aec8b8.jpeg?alt=media&#x26;token=f4faa70d-83a7-447d-802d-29b016ef3027" alt=""><figcaption><p>MASK OF THE ELEMENTS TO REMOVE</p></figcaption></figure>

<figure><img src="https://assets.gepettoapp.com/r/9ebe1d3f-5dec-454f-b430-d7655f544540.png" alt=""><figcaption><p>AFTER DECLUTTER (with mask)</p></figcaption></figure>


# Magic Enhancer ✨

The magic enhancer will enhance your photos contrast, exposure, color and brightness to make them more appealing. The Magic Enhancer also lets you fix the sky and hide people's faces or plates.

<mark style="color:red;">⚠️ Enhancer is a add-on of the Gepetto API billed separately, per request.</mark>

### Endpoint

<mark style="color:green;">`POST`</mark> `https://europe-west1-gepettoai.cloudfunctions.net/v1/enhancer`

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {{API\_KEY}} |

#### Request Body

<table><thead><tr><th>Name</th><th width="179">Type</th><th>Description</th></tr></thead><tbody><tr><td>url<mark style="color:red;">*</mark></td><td>String</td><td><p>Image URL of the room to be enhanced </p><p>💡 <mark style="color:yellow;">better to use high definition images.</mark></p><p>Ex: <br><a href="https://firebasestorage.googleapis.com/v0/b/gepettoai.appspot.com/o/raw-images%2Ffd6db4d6-aaf6-4563-9340-c7c2b59fe69e.jpeg?alt=media&#x26;token=4d3b728a-5ebc-4a55-a694-1c21c580c8aa">https://firebasestorage.googleapis.com/v0/b/gepettoai.appspot.com/o/raw-images%2Ffd6db4d6-aaf6-4563-9340-c7c2b59fe69e.jpeg?alt=media&#x26;token=4d3b728a-5ebc-4a55-a694-1c21c580c8aa</a></p></td></tr><tr><td>sky_fix</td><td>Boolean (true / false)</td><td>(optional) Will change a grey sky to a blue sky.</td></tr><tr><td>auto_privacy</td><td>Boolean (true / false)</td><td>(optional) Will blur faces and car plates.</td></tr><tr><td>webhook</td><td>String</td><td>(optional) Webhook <strong>POST</strong> URL to send the result on completion.<br><br>If not provided, the request will wait for the result.</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK If webhook is not set" %}

```json
{
  "base64": "<base64 encoded image>",
  "status": "success"
}
```

{% endtab %}

{% tab title="200: OK If webhook is provided" %}

```json
{
  "status": "pending",
  "id": "xxxxxxxxxxxxxx", // You can use that id with Get Job
  "mode": "enhance"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}

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

{% endtab %}
{% endtabs %}

### Code Examples

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

```bash
curl --location 'https://europe-west1-gepettoai.cloudfunctions.net/v1/enhancer' \
--header 'Authorization: Bearer {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
  "url": "https://firebasestorage.googleapis.com/v0/b/gepettoai.appspot.com/o/raw-images%2Ffd6db4d6-aaf6-4563-9340-c7c2b59fe69e.jpeg?alt=media&token=4d3b728a-5ebc-4a55-a694-1c21c580c8aa",
  "sky_fix": true,
  "auto_privacy": false,
}'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {{API_KEY}}");
myHeaders.append("Content-Type", "application/json");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: JSON.stringify({
    "url": "https://firebasestorage.googleapis.com/v0/b/gepettoai.appspot.com/o/raw-images%2Ffd6db4d6-aaf6-4563-9340-c7c2b59fe69e.jpeg?alt=media&token=4d3b728a-5ebc-4a55-a694-1c21c580c8aa",
    "sky_fix": true,
    "auto_privacy": false
  })
};

const response = await fetch("https://europe-west1-gepettoai.cloudfunctions.net/v1/enhancer", requestOptions)
const body = await reponse.json();
console.log(body)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://europe-west1-gepettoai.cloudfunctions.net/v1/enhancer"

payload = json.dumps({
  "url": "https://firebasestorage.googleapis.com/v0/b/gepettoai.appspot.com/o/raw-images%2Ffd6db4d6-aaf6-4563-9340-c7c2b59fe69e.jpeg?alt=media&token=4d3b728a-5ebc-4a55-a694-1c21c580c8aa",
  "sky_fix": True,
  "auto_privacy": False
})
headers = {
  'Authorization': 'Bearer {{API_KEY}}',
  'Content-Type': 'application/json'
}

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

print(response.text)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$client = new Client();
$headers = [
  'Authorization' => 'Bearer {{API_KEY}}',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "https://firebasestorage.googleapis.com/v0/b/gepettoai.appspot.com/o/raw-images%2Ffd6db4d6-aaf6-4563-9340-c7c2b59fe69e.jpeg?alt=media&token=4d3b728a-5ebc-4a55-a694-1c21c580c8aa",
  "sky_fix": True,
  "auto_privacy": False
}';
$request = new Request('POST', 'https://europe-west1-gepettoai.cloudfunctions.net/v1/enhancer', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

```

{% endtab %}

{% tab title="GO" %}

```go
package main

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

func main() {

  url := "https://europe-west1-gepettoai.cloudfunctions.net/v1/enhancer"
  method := "POST"

  payload := strings.NewReader(`{
    "url": "https://firebasestorage.googleapis.com/v0/b/gepettoai.appspot.com/o/raw-images%2Ffd6db4d6-aaf6-4563-9340-c7c2b59fe69e.jpeg?alt=media&token=4d3b728a-5ebc-4a55-a694-1c21c580c8aa",
    "sky_fix": true,
    "auto_privacy": false
}`)

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

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer {{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="Ruby" %}

```ruby
require "uri"
require "json"
require "net/http"

url = URI("https://europe-west1-gepettoai.cloudfunctions.net/v1/smart-staging")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer {{API_KEY}}"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "https://firebasestorage.googleapis.com/v0/b/gepettoai.appspot.com/o/raw-images%2Ffd6db4d6-aaf6-4563-9340-c7c2b59fe69e.jpeg?alt=media&token=4d3b728a-5ebc-4a55-a694-1c21c580c8aa",
  "sky_fix": true,
  "auto_privacy": false
})

response = https.request(request)
puts response.read_body

```

{% endtab %}
{% endtabs %}

### Results

<figure><img src="/files/tpoQytZiGcRcIno4r5Pk" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/T8Z78iiplibGhGGdjkf1" alt=""><figcaption></figcaption></figure>


# Upscale

Upscale and refine the quality of your image.

<mark style="color:green;">`POST`</mark> `https://europe-west1-gepettoai.cloudfunctions.net/v1/upscale`

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {{API\_KEY}} |

#### Request Body

| Name                                  | Type                                 | Description                                                                                                                                                                              |
| ------------------------------------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| url<mark style="color:red;">\*</mark> | String                               | <p>Image URL of the room to be redesigned.</p><p>Ex: <a href="https://thumbs.dreamstime.com/b/empty-room-26533582.jpg"><https://thumbs.dreamstime.com/b/empty-room-26533582.jpg></a></p> |
| scale                                 | <p>Number - 2 or 3<br>Default: 2</p> | <p>(optional) Define the scale of the output. 3 being the largest size it will take more time to compute.<br>Scale of 2 is recommended for an optimal time to result.</p>                |
| webhook                               | String                               | <p>(optional) Webhook <strong>POST</strong> URL to send the result on completion.<br><br>If not provided, the request will wait for the result.</p>                                      |

{% tabs %}
{% tab title="200: OK If webhook is not set" %}

```json
{
  "base64": "<base64 encoded image>",
  "status": "success"
}
```

{% endtab %}

{% tab title="200: OK If webhook is provided" %}

```json
{
  "status": "pending",
  "id": "xxxxxxxxxxxxxx", // You can use that id with Get Job
  "mode": "upscale"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}

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

{% endtab %}
{% endtabs %}

### Code Examples

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

```bash

curl --location 'https://europe-west1-gepettoai.cloudfunctions.net/v1/upscale' \
--header 'Authorization: Bearer {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
  "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg"
}'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {{API_KEY}}");
myHeaders.append("Content-Type", "application/json");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: JSON.stringify({
    "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg"
  })
};

const response = await fetch("https://europe-west1-gepettoai.cloudfunctions.net/v1/upscale", requestOptions)
const body = await reponse.json();
console.log(body)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://europe-west1-gepettoai.cloudfunctions.net/v1/upscale"

payload = json.dumps({
  "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg"
})
headers = {
  'Authorization': 'Bearer {{API_KEY}}',
  'Content-Type': 'application/json'
}

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

print(response.text)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$client = new Client();
$headers = [
  'Authorization' => 'Bearer {{API_KEY}}',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg"
}';
$request = new Request('POST', 'https://europe-west1-gepettoai.cloudfunctions.net/v1/upscale', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

```

{% endtab %}

{% tab title="GO" %}

```go
package main

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

func main() {

  url := "https://europe-west1-gepettoai.cloudfunctions.net/v1/upscale"
  method := "POST"

  payload := strings.NewReader(`{
    "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg"
}`)

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

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer {{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="Ruby" %}

```ruby
require "uri"
require "json"
require "net/http"

url = URI("https://europe-west1-gepettoai.cloudfunctions.net/v1/upscale")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer {{API_KEY}}"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg"
})

response = https.request(request)
puts response.read_body

```

{% endtab %}
{% endtabs %}

### Results

<figure><img src="/files/pkxhgCJvqx4o0eeGRB38" alt=""><figcaption><p>BEFORE UPSCALE</p></figcaption></figure>

<figure><img src="/files/E6RX5P8xxoEPBEAYehfx" alt=""><figcaption><p>AFTER UPSCALE</p></figcaption></figure>

<figure><img src="/files/lghRpXwNKic6RNTGj7EJ" alt=""><figcaption><p>BEFORE UPSCALE</p></figcaption></figure>

<figure><img src="/files/61aMN3Fqur12krIjRFHc" alt=""><figcaption><p>AFTER UPSCALE</p></figcaption></figure>


# Upscale (advanced)

Upscale and refine the quality of your image while maintaining high fidelity.

<mark style="color:green;">`POST`</mark> `https://europe-west1-gepettoai.cloudfunctions.net/v1/upscale_advanced`

### 💵 Credit Cost : 2 credits

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {{API\_KEY}} |

#### Request Body

| Name                                  | Type                                      | Description                                                                                                                                                                              |
| ------------------------------------- | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| url<mark style="color:red;">\*</mark> | String                                    | <p>Image URL of the room to be redesigned.</p><p>Ex: <a href="https://thumbs.dreamstime.com/b/empty-room-26533582.jpg"><https://thumbs.dreamstime.com/b/empty-room-26533582.jpg></a></p> |
| scale                                 | <p>Number - 2 or 4 or 6<br>Default: 2</p> | (optional) Define the scale of the output.                                                                                                                                               |
| webhook                               | String                                    | <p>(optional) Webhook <strong>POST</strong> URL to send the result on completion.<br><br>If not provided, the request will wait for the result.</p>                                      |

{% tabs %}
{% tab title="200: OK If webhook is not set" %}

```json
{
  "base64": "<base64 encoded image>",
  "status": "success"
}
```

{% endtab %}

{% tab title="200: OK If webhook is provided" %}

```json
{
  "status": "pending",
  "id": "xxxxxxxxxxxxxx", // You can use that id with Get Job
  "mode": "upscale"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}

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

{% endtab %}
{% endtabs %}

### Code Examples

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

```bash

curl --location 'https://europe-west1-gepettoai.cloudfunctions.net/v1/upscale_advanced' \
--header 'Authorization: Bearer {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
  "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg"
}'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {{API_KEY}}");
myHeaders.append("Content-Type", "application/json");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: JSON.stringify({
    "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg"
  })
};

const response = await fetch("https://europe-west1-gepettoai.cloudfunctions.net/v1/upscale_advanced", requestOptions)
const body = await reponse.json();
console.log(body)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://europe-west1-gepettoai.cloudfunctions.net/v1/upscale_advanced"

payload = json.dumps({
  "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg"
})
headers = {
  'Authorization': 'Bearer {{API_KEY}}',
  'Content-Type': 'application/json'
}

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

print(response.text)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$client = new Client();
$headers = [
  'Authorization' => 'Bearer {{API_KEY}}',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg"
}';
$request = new Request('POST', 'https://europe-west1-gepettoai.cloudfunctions.net/v1/upscale_advanced', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

```

{% endtab %}

{% tab title="GO" %}

```go
package main

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

func main() {

  url := "https://europe-west1-gepettoai.cloudfunctions.net/v1/upscale_advanced"
  method := "POST"

  payload := strings.NewReader(`{
    "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg"
}`)

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

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer {{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="Ruby" %}

```ruby
require "uri"
require "json"
require "net/http"

url = URI("https://europe-west1-gepettoai.cloudfunctions.net/v1/upscale_advanced")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer {{API_KEY}}"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg"
})

response = https.request(request)
puts response.read_body

```

{% endtab %}
{% endtabs %}


# Get Styles

List all the available styles

### Endpoint

<mark style="color:blue;">`GET`</mark> `https://europe-west1-gepettoai.cloudfunctions.net/v1/styles`

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {{API\_KEY}} |

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

```json
[
  {
    "id": "art_deco",
    "name": "Art déco"
  },
  {
    "id": "bauhaus",
    "name": "Bauhaus"
  }
  ...
]
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}

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

{% endtab %}
{% endtabs %}

### Code Examples

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

```bash

curl --location 'https://europe-west1-gepettoai.cloudfunctions.net/v1/styles' \
--header 'Authorization: Bearer {{API_KEY}}' \
--header 'Content-Type: application/json'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {{API_KEY}}");
myHeaders.append("Content-Type", "application/json");

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

const response = await fetch("https://europe-west1-gepettoai.cloudfunctions.net/v1/styles", requestOptions)
const body = await reponse.json();
console.log(body)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://europe-west1-gepettoai.cloudfunctions.net/v1/styles"

payload = {}
headers = {
  'Authorization': 'Bearer {{API_KEY}}',
  'Content-Type': 'application/json'
}

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

print(response.text)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$client = new Client();
$headers = [
  'Authorization' => 'Bearer {{API_KEY}}',
  'Content-Type' => 'application/json'
];

$request = new Request('GET', 'https://europe-west1-gepettoai.cloudfunctions.net/v1/styles', $headers);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

```

{% endtab %}

{% tab title="GO" %}

```go
package main

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

func main() {

  url := "https://europe-west1-gepettoai.cloudfunctions.net/v1/styles"
  method := "GET"

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

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer {{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="Ruby" %}

```ruby
require "uri"
require "json"
require "net/http"

url = URI("https://europe-west1-gepettoai.cloudfunctions.net/v1/styles")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer {{API_KEY}}"
request["Content-Type"] = "application/json"

response = https.request(request)
puts response.read_body
```

{% endtab %}
{% endtabs %}


# Get Skies

List all the available skies

### Endpoint

<mark style="color:blue;">`GET`</mark> `https://europe-west1-gepettoai.cloudfunctions.net/v1/skies`

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {{API\_KEY}} |

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

```json
[
  {
    "id": "sunny",
    "name": "Ensoleillé"
  },
  {
    "id": "sunrise",
    "name": "Levé du soleil"
  }
  ...
]
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}

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

{% endtab %}
{% endtabs %}

### Code Examples

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

```bash

curl --location 'https://europe-west1-gepettoai.cloudfunctions.net/v1/skies' \
--header 'Authorization: Bearer {{API_KEY}}' \
--header 'Content-Type: application/json'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {{API_KEY}}");
myHeaders.append("Content-Type", "application/json");

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

const response = await fetch("https://europe-west1-gepettoai.cloudfunctions.net/v1/skies", requestOptions)
const body = await reponse.json();
console.log(body)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://europe-west1-gepettoai.cloudfunctions.net/v1/skies"

payload = {}
headers = {
  'Authorization': 'Bearer {{API_KEY}}',
  'Content-Type': 'application/json'
}

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

print(response.text)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$client = new Client();
$headers = [
  'Authorization' => 'Bearer {{API_KEY}}',
  'Content-Type' => 'application/json'
];

$request = new Request('GET', 'https://europe-west1-gepettoai.cloudfunctions.net/v1/skies', $headers);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

```

{% endtab %}

{% tab title="GO" %}

```go
package main

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

func main() {

  url := "https://europe-west1-gepettoai.cloudfunctions.net/v1/skies"
  method := "GET"

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

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer {{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="Ruby" %}

```ruby
require "uri"
require "json"
require "net/http"

url = URI("https://europe-west1-gepettoai.cloudfunctions.net/v1/skies")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer {{API_KEY}}"
request["Content-Type"] = "application/json"

response = https.request(request)
puts response.read_body
```

{% endtab %}
{% endtabs %}


# Get Rooms

List all the available rooms in english and french

### Endpoint

<mark style="color:blue;">`GET`</mark> `https://europe-west1-gepettoai.cloudfunctions.net/v1/rooms`

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {{API\_KEY}} |

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

```json
[
  {
    "id": "living_room",
    "name": "Salon / Pièce à vivre",
    "name-en": "Living room",
    "type": "home"
  },
  ...
]
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}

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

{% endtab %}
{% endtabs %}

### Code Examples

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

```bash
curl --location 'https://europe-west1-gepettoai.cloudfunctions.net/v1/rooms' \
--header 'Authorization: Bearer {{API_KEY}}' \
--header 'Content-Type: application/json'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {{API_KEY}}");
myHeaders.append("Content-Type", "application/json");

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

const response = await fetch("https://europe-west1-gepettoai.cloudfunctions.net/v1/rooms", requestOptions)
const body = await reponse.json();
console.log(body)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://europe-west1-gepettoai.cloudfunctions.net/v1/rooms"

payload = {}
headers = {
  'Authorization': 'Bearer {{API_KEY}}',
  'Content-Type': 'application/json'
}

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

print(response.text)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$client = new Client();
$headers = [
  'Authorization' => 'Bearer {{API_KEY}}',
  'Content-Type' => 'application/json'
];

$request = new Request('GET', 'https://europe-west1-gepettoai.cloudfunctions.net/v1/rooms', $headers);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

```

{% endtab %}

{% tab title="GO" %}

```go
package main

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

func main() {

  url := "https://europe-west1-gepettoai.cloudfunctions.net/v1/rooms"
  method := "GET"

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

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer {{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="Ruby" %}

```ruby
require "uri"
require "json"
require "net/http"

url = URI("https://europe-west1-gepettoai.cloudfunctions.net/v1/rooms")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer {{API_KEY}}"
request["Content-Type"] = "application/json"

response = https.request(request)
puts response.read_body
```

{% endtab %}
{% endtabs %}


# Get Furnitures

List all the available furnitures in multiple lang for the furnish mode

### Endpoint

<mark style="color:blue;">`GET`</mark> `https://europe-west1-gepettoai.cloudfunctions.net/v1/furnitures`

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {{API\_KEY}} |

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

```json
[
  "interior": [
        {
            "id": "closet",
            "name": "Armoire / Garde-robe",
            "name_en": "Wardrobe",
            "name_es": "Guardarropa",
            "name_pt": "Guarda-roupa",
            "name_de": "Garderobe",
            "type": "interior"
        },

        {
            "id": "round_dining_table",
            "name": "Table ronde",
            "name_en": "Round dining table",
            "name_es": "Mesa redonda",
            "name_pt": "Mesa redonda",
            "name_de": "Runder Tisch",
            "type": "interior"
        },
        ....
    ],
    "bathroom": [
        {
            "id": "bathtub",
            "name": "Baignoire",
            "name_en": "Bathtub",
            "name_es": "Bañera",
            "name_pt": "Banheira",
            "name_de": "Badewanne",
            "type": "bathroom"
        },
        ....
    ],
    ...
]
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}

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

{% endtab %}
{% endtabs %}

### Code Examples

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

```bash
curl --location 'https://europe-west1-gepettoai.cloudfunctions.net/furnitures' \
--header 'Authorization: Bearer {{API_KEY}}' \
--header 'Content-Type: application/json'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {{API_KEY}}");
myHeaders.append("Content-Type", "application/json");

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

const response = await fetch("https://europe-west1-gepettoai.cloudfunctions.net/v1/furnitures", requestOptions)
const body = await reponse.json();
console.log(body)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://europe-west1-gepettoai.cloudfunctions.net/v1/furnitures"

payload = {}
headers = {
  'Authorization': 'Bearer {{API_KEY}}',
  'Content-Type': 'application/json'
}

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

print(response.text)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$client = new Client();
$headers = [
  'Authorization' => 'Bearer {{API_KEY}}',
  'Content-Type' => 'application/json'
];

$request = new Request('GET', 'https://europe-west1-gepettoai.cloudfunctions.net/v1/furnitures', $headers);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

```

{% endtab %}

{% tab title="GO" %}

```go
package main

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

func main() {

  url := "https://europe-west1-gepettoai.cloudfunctions.net/v1/furnitures"
  method := "GET"

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

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer {{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="Ruby" %}

```ruby
require "uri"
require "json"
require "net/http"

url = URI("https://europe-west1-gepettoai.cloudfunctions.net/v1/furnitures")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer {{API_KEY}}"
request["Content-Type"] = "application/json"

response = https.request(request)
puts response.read_body
```

{% endtab %}
{% endtabs %}


# Get Job

### Endpoint

<mark style="color:blue;">`GET`</mark> `https://europe-west1-gepettoai.cloudfunctions.net/v1/job/{id}`

#### Path Parameters

| Name                                 | Type   | Description                                                                                       |
| ------------------------------------ | ------ | ------------------------------------------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark> | String | JOB ID received in **/redesign** **/furnish** or **/upscale** when setting the webhook parameter. |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {{API\_KEY}} |

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

```json
{
  "status": "success",
  "output": "<Image URL>",
  "mode": "furnish",
  "createdAt": "2023-09-29T13:17:21.774Z"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}

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

{% endtab %}
{% endtabs %}

### Code Examples

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

```bash

curl --location 'https://europe-west1-gepettoai.cloudfunctions.net/v1/job/{id}' \
--header 'Authorization: Bearer {{API_KEY}}' \
--header 'Content-Type: application/json'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {{API_KEY}}");
myHeaders.append("Content-Type", "application/json");

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

const response = await fetch("https://europe-west1-gepettoai.cloudfunctions.net/v1/job/{id}", requestOptions)
const body = await reponse.json();
console.log(body)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://europe-west1-gepettoai.cloudfunctions.net/v1/job/{id}"

payload = {}
headers = {
  'Authorization': 'Bearer {{API_KEY}}',
  'Content-Type': 'application/json'
}

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

print(response.text)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$client = new Client();
$headers = [
  'Authorization' => 'Bearer {{API_KEY}}',
  'Content-Type' => 'application/json'
];

$request = new Request('GET', 'https://europe-west1-gepettoai.cloudfunctions.net/v1/job/{id}', $headers);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

```

{% endtab %}

{% tab title="GO" %}

```go
package main

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

func main() {

  url := "https://europe-west1-gepettoai.cloudfunctions.net/v1/job/{id}"
  method := "GET"

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

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer {{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="Ruby" %}

```ruby
require "uri"
require "json"
require "net/http"

url = URI("https://europe-west1-gepettoai.cloudfunctions.net/v1/job/{id}")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer {{API_KEY}}"
request["Content-Type"] = "application/json"

response = https.request(request)
puts response.read_body
```

{% endtab %}
{% endtabs %}


# Webhooks

When using the Gepetto API to generate renderings with **/redesign**, **/furnish** and **/upscale** endpoints, you have the option to use a `webhook` parameter to avoid waiting for a synchronous server reply.

To leverage this functionality, simply pass the `webhook` parameter in the body followed by the URL where you want to receive the rendering results.

When the rendering process is complete, our server will send a **POST** request to the provided URL, allowing you to receive the results asynchronously. This means you can proceed with other tasks and retrieve the rendering once it’s ready, making your workflow more efficient and seamless. It’s crucial to ensure that the provided webhook URL is correct and capable of receiving POST requests to avoid any disruptions or loss of data.

#### Here is an example of result our server will send to you URL:

```json
{  
    "id": "xxxxxxxxxxxxxxxxxxx",  
    "output": "<Image URL>"
}
```


# Redesign

Redesign will redesign a room in a specific style.

<mark style="color:red;">⚠️This is a Legacy endpoint, for better results we recommend to use the most recent version</mark> [Creative Redesign](/endpoints/creative-redesign)

Redesign will redesign a room in a specific style. If the room is empty it won't add many furnitures, use the Furnish mode if you need to add furnitures first.

🦋 **Creativity**: It lets you control how crazy Gepetto will be with your room. The higher the number is, the less it will look like the original photo.

### Endpoint

<mark style="color:green;">`POST`</mark> `https://europe-west1-gepettoai.cloudfunctions.net/v1/redesign`

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {{API\_KEY}} |

#### Request Body

<table><thead><tr><th width="269">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>url<mark style="color:red;">*</mark></td><td>String (Url)</td><td><p>Image URL of the room to be redesigned.</p><p>Ex: <a href="https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg">https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg</a></p></td></tr><tr><td>styleId<mark style="color:red;">*</mark></td><td>String</td><td>The style ID that can be fetched on the <a href="https://docs.gepettoapp.com/endpoints/get-styles">Get Styles </a>endpoint.</td></tr><tr><td>roomId<mark style="color:red;">*</mark></td><td>String</td><td>The room ID that can be fetched on the <a href="https://docs.gepettoapp.com/endpoints/get-rooms">Get Rooms</a> endpoint.</td></tr><tr><td>creativity<mark style="color:red;">*</mark></td><td>Number</td><td><p><mark style="color:red;"><strong>Number between 0 and 30.</strong></mark></p><p></p><p>The creativity tells how much freedom you give the AI. The higher the value is, the less likely the result will look like the original image.</p></td></tr><tr><td>mask</td><td>String (Url)</td><td><p>(Optional but recommended for more precision)</p><p></p><p>Custom mask image URL of the area to préserve or modify<br></p><p>⚠️ The mask should have the same dimension as the base image <code>url</code> parameter.<br><br>If set, <code>preserveWindows</code> <code>preserverWalls</code> <code>preserveCeiling</code> <code>preserveFloor</code> are ignored</p></td></tr><tr><td>preserveWindows</td><td>Boolean (true / false)</td><td>(optional) Will prevent the AI from modifying the existing windowpanes / doors and bay window from the original image.</td></tr><tr><td>preserveWalls</td><td>Boolean (true / false)</td><td>(optional) Will prevent the AI from modifying the walls from the original image.</td></tr><tr><td>preserveCeiling</td><td>Boolean (true / false)</td><td>(optional) Will prevent the AI from modifying the ceiling from the original image.</td></tr><tr><td>preserveFloor</td><td>Boolean (true / false)</td><td>(optional) Will prevent the AI from modifying the floor from the original image.</td></tr><tr><td>webhook</td><td>String</td><td>(optional) Webhook <strong>POST</strong> URL to send the result on completion.<br><br>If not provided, the request will wait for the result.</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK If webhook is not set" %}

```json
{
  "base64": "<base64 encoded image>",
  "status": "success"
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}

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

{% endtab %}

{% tab title="200: OK If webhook is provided" %}

```json
{
  "status": "pending",
  "id": "xxxxxxxxxxxxxx", // You can use that id with Get Job
  "styleId": "your_style",
  "roomId": "your_room",
  "creativity": 14,
  "mode": "redesign"
}
```

{% endtab %}
{% endtabs %}

### Code Examples

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

```bash
curl --location 'https://europe-west1-gepettoai.cloudfunctions.net/v1/redesign' \
--header 'Authorization: Bearer {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
  "url": "https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg",
  "styleId": "demeures",
  "roomId": "living_room",
  "creativity": 15
}'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {{API_KEY}}");
myHeaders.append("Content-Type", "application/json");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: JSON.stringify({
    "url": "https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg",
    "styleId": "demeures",
    "roomId": "living_room",
    "creativity": 15
  })
};

const response = await fetch("https://europe-west1-gepettoai.cloudfunctions.net/v1/redesign", requestOptions)
const body = await reponse.json();
console.log(body)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://europe-west1-gepettoai.cloudfunctions.net/v1/redesign"

payload = json.dumps({
  "url": "https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg",
  "styleId": "demeures",
  "roomId": "living_room",
  "creativity": 15
})
headers = {
  'Authorization': 'Bearer {{API_KEY}}',
  'Content-Type': 'application/json'
}

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

print(response.text)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$client = new Client();
$headers = [
  'Authorization' => 'Bearer {{API_KEY}}',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg",
  "styleId": "demeures",
  "roomId": "living_room",
  "creativity": 15
}';
$request = new Request('POST', 'https://europe-west1-gepettoai.cloudfunctions.net/v1/redesign', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

```

{% endtab %}

{% tab title="GO" %}

```go
package main

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

func main() {

  url := "https://europe-west1-gepettoai.cloudfunctions.net/v1/redesign"
  method := "POST"

  payload := strings.NewReader(`{
    "url": "https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg",
    "styleId": "demeures",
    "roomId": "living_room",
    "creativity": 15
}`)

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

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer {{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="Ruby" %}

```ruby
require "uri"
require "json"
require "net/http"

url = URI("https://europe-west1-gepettoai.cloudfunctions.net/v1/redesign")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer {{API_KEY}}"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "https://theneo-prod-public.s3.amazonaws.com/images-1695201150801.jpg",
  "styleId": "demeures",
  "roomId": "living_room",
  "creativity": 15,
})

response = https.request(request)
puts response.read_body

```

{% endtab %}
{% endtabs %}

### Results To Expect

| Before                           | After                                            |
| -------------------------------- | ------------------------------------------------ |
| ![](/files/TOOdQRy9AZxOECIi0GfE) | ![Hausmann Style](/files/IUXBO4PdTFpUK3DTTSEL)   |
|                                  |                                                  |
| ![](/files/8yXMPUttjlx2HpSWcDRf) | ![Cap Ferret style](/files/fZGQVowYm8Ybqng0bdlA) |


# Smart Staging v1 🔮

Smart Staging allows you to furnish an interior more accurately using a more advanced technology.

<mark style="color:red;">⚠️This is a Legacy endpoint, we recommend to use the most recent version</mark>[Smart Staging v2 🔮](/endpoints/smart-staging-v2)

<mark style="color:red;">⚠️</mark> <mark style="color:yellow;">Smart Staging is a add-on of the Gepetto API billed separately, per request.</mark>

<mark style="color:yellow;">⚠️ This feature only works for empty rooms</mark>

The only roomIds available in this mode are:&#x20;

```typescript
['living_room', 'bedroom', 'dining_room', 'home_office', 'gaming_room']
```

### Endpoint

<mark style="color:green;">`POST`</mark> `https://europe-west1-gepettoai.cloudfunctions.net/v1/smart-staging`

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {{API\_KEY}} |

#### Request Body

<table><thead><tr><th>Name</th><th width="179">Type</th><th>Description</th></tr></thead><tbody><tr><td>url<mark style="color:red;">*</mark></td><td>String</td><td><p>Image URL of the room to be redesigned.</p><p>Ex: <a href="https://gepettoapp.com/empty-living.jpeg">https://gepettoapp.com/empty-living.jpeg</a></p></td></tr><tr><td>roomId<mark style="color:red;">*</mark></td><td>String</td><td>The room ID:<br><code>['living_room', 'bedroom', 'dining_room', 'home_office', 'gaming_room']</code></td></tr><tr><td>styleId<mark style="color:red;">*</mark></td><td>String</td><td>The style ID that can be fetched on the <a href="https://docs.gepettoapp.com/endpoints/get-styles">Get Styles</a> endpoint.</td></tr><tr><td>webhook</td><td>String</td><td>(optional) Webhook <strong>POST</strong> URL to send the result on completion.<br><br>If not provided, the request will wait for the result.</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK If webhook is not set" %}

```json
{
  "base64": "<base64 encoded image>",
  "status": "success"
}
```

{% endtab %}

{% tab title="200: OK If webhook is provided" %}

```json
{
  "status": "pending",
  "id": "xxxxxxxxxxxxxx", // You can use that id with Get Job
  "styleId": "your_style",
  "roomId": "your_room",
  "mode": "furnish"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}

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

{% endtab %}
{% endtabs %}

### Code Examples

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

```bash
curl --location 'https://europe-west1-gepettoai.cloudfunctions.net/v1/smart-staging' \
--header 'Authorization: Bearer {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
  "url": "https://gepettoapp.com/empty-living.jpeg",
  "styleId": "demeures",
  "roomId": "living_room",
}'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {{API_KEY}}");
myHeaders.append("Content-Type", "application/json");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: JSON.stringify({
    "url": "https://gepettoapp.com/empty-living.jpeg",
    "styleId": "demeures",
    "roomId": "living_room"
  })
};

const response = await fetch("https://europe-west1-gepettoai.cloudfunctions.net/v1/smart-staging", requestOptions)
const body = await reponse.json();
console.log(body)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://europe-west1-gepettoai.cloudfunctions.net/v1/smart-staging"

payload = json.dumps({
  "url": "https://gepettoapp.com/empty-living.jpeg",
  "styleId": "demeures",
  "roomId": "living_room"
})
headers = {
  'Authorization': 'Bearer {{API_KEY}}',
  'Content-Type': 'application/json'
}

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

print(response.text)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$client = new Client();
$headers = [
  'Authorization' => 'Bearer {{API_KEY}}',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "https://gepettoapp.com/empty-living.jpeg",
  "styleId": "demeures",
  "roomId": "living_room"
}';
$request = new Request('POST', 'https://europe-west1-gepettoai.cloudfunctions.net/v1/smart-staging', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

```

{% endtab %}

{% tab title="GO" %}

```go
package main

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

func main() {

  url := "https://europe-west1-gepettoai.cloudfunctions.net/v1/smart-staging"
  method := "POST"

  payload := strings.NewReader(`{
    "url": "https://gepettoapp.com/empty-living.jpeg",
    "styleId": "demeures",
    "roomId": "living_room"
}`)

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

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer {{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="Ruby" %}

```ruby
require "uri"
require "json"
require "net/http"

url = URI("https://europe-west1-gepettoai.cloudfunctions.net/v1/smart-staging")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer {{API_KEY}}"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "https://gepettoapp.com/empty-living.jpeg",
  "styleId": "demeures",
  "roomId": "living_room"
})

response = https.request(request)
puts response.read_body

```

{% endtab %}
{% endtabs %}

### Results

<figure><img src="/files/o9z8cTyEQAnbMkxevZcG" alt=""><figcaption><p>Living room - Cap ferret</p></figcaption></figure>

<figure><img src="/files/5Z48ccMRBdN0FdMALPDx" alt=""><figcaption><p>Bedroom - Rio vintage</p></figcaption></figure>

<figure><img src="/files/vD8zZYRUoLVHFvZEOjGX" alt=""><figcaption><p>Living room - Scandinave</p></figcaption></figure>

<figure><img src="/files/UcHJSuh6ZjW833jEWzPX" alt=""><figcaption><p>Dining room - Scandinave</p></figcaption></figure>

<figure><img src="/files/gcO6OAQbn7atQYrkKdkr" alt=""><figcaption><p>Living room - Scandinave</p></figcaption></figure>


