# Home GPT

#### [Demo](https://api.market/store/capix/homegpt)

### About API <a href="#about-api" id="about-api"></a>

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

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

***

#### Endpoints <a href="#endpoints" id="endpoints"></a>

**1. Home Configuration**

This endpoint is used to configure the home with an image URL and theme.

**Parameters**

* `image_url` (string): URL of the image to be used for home configuration.
* `theme` (string): Theme for the home (e.g., "Modern").

**Headers**

* x-api-market-key (string): Your API key.
* `Content-Type` (string): Must be `application/json`.

**2. Room Configuration**

This endpoint is used to configure a room with an image URL, theme, and room type.

**Parameters**

* `image_url` (string): URL of the image to be used for room configuration.
* `theme` (string): Theme for the room (e.g., "Modern").
* `room` (string): Type of the room (e.g., "Living room").

**Headers**

* x-api-market-key (string): Your API key.
* `Content-Type` (string): Must be `application/json`.

**3. Fetch Room Result**

This endpoint is used to fetch the result of a room configuration based on a request ID.

**Parameters**

* `request_id` (string): Unique identifier for the room configuration request.

**Headers**

* x-api-market-key (string): Your API key.
* `Content-Type` (string): Must be `application/json`.

**Example Workflow**

1. **Configure Home**
   * Send a POST request to the `/home/` endpoint with the image URL and theme to configure the home.
2. **Configure Room**
   * Send a POST request to the `/room/` endpoint with the image URL, theme, and room type to configure a specific room.
3. **Fetch Room Result**
   * Send a POST request to the `/room/result/` endpoint with the request ID to fetch the result of the room configuration.

**Notes**

* Replace `API_KEY` with your actual API key in all requests.
* Ensure that all JSON data in the request body is properly formatted.

By following this documentation, you should be able to interact with the Capix API v2 efficiently for configuring homes and rooms, as well as retrieving the results of those configurations.

### Code Examples <a href="#code-examples" id="code-examples"></a>

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

```bash
curl -X 'POST' \
  'https://prod.api.market/api/v1/capix/homegpt/home/v1/' \
  -H 'accept: application/json' \
  -H 'x-api-market-key: API_KEY' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'image_url=https%3A%2F%2Ftelegra.ph%2Ffile%2Fc6c8be08bfb1e27e558a1.png&theme=Modern'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    'accept': 'application/json',
    'x-api-market-key': 'API_KEY',
    'Content-Type': 'application/x-www-form-urlencoded',
}

data = {
    'image_url': 'https://telegra.ph/file/c6c8be08bfb1e27e558a1.png',
    'theme': 'Modern',
}

response = requests.post('https://prod.api.market/api/v1/capix/homegpt/home/v1/', headers=headers, data=data)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://prod.api.market/api/v1/capix/homegpt/home/v1/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'accept: application/json',
    'x-api-market-key: API_KEY',
    'Content-Type: application/x-www-form-urlencoded',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'image_url=https%3A%2F%2Ftelegra.ph%2Ffile%2Fc6c8be08bfb1e27e558a1.png&theme=Modern');

$response = curl_exec($ch);

curl_close($ch);
```

{% endtab %}

{% tab title="NodeJs" %}

```javascript
import axios from 'axios';

const response = await axios.post(
  'https://prod.api.market/api/v1/capix/homegpt/home/v1/',
  new URLSearchParams({
    'image_url': 'https://telegra.ph/file/c6c8be08bfb1e27e558a1.png',
    'theme': 'Modern'
  }),
  {
    headers: {
      'accept': 'application/json',
      'x-api-market-key': 'API_KEY'
    }
  }
);
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch('https://prod.api.market/api/v1/capix/homegpt/home/v1/', {
  method: 'POST',
  headers: {
    'accept': 'application/json',
    'x-api-market-key': 'API_KEY'
  },
  body: new URLSearchParams({
    'image_url': 'https://telegra.ph/file/c6c8be08bfb1e27e558a1.png',
    'theme': 'Modern'
  })
});
```

{% endtab %}
{% endtabs %}

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

```bash
curl -X 'POST' \
  'https://prod.api.market/api/v1/capix/homegpt/room/v1/' \
  -H 'accept: application/json' \
  -H 'x-api-market-key: API_KEY' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'image_url=https%3A%2F%2Ftelegra.ph%2Ffile%2Fc6c8be08bfb1e27e558a1.png&room=Living%20room&theme=Modern'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    'accept': 'application/json',
    'x-api-market-key': 'API_KEY',
    'Content-Type': 'application/x-www-form-urlencoded',
}

data = {
    'image_url': 'https://telegra.ph/file/c6c8be08bfb1e27e558a1.png',
    'room': 'Living room',
    'theme': 'Modern',
}

response = requests.post('https://prod.api.market/api/v1/capix/homegpt/room/v1/', headers=headers, data=data)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://prod.api.market/api/v1/capix/homegpt/room/v1/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'accept: application/json',
    'x-api-market-key: API_KEY',
    'Content-Type: application/x-www-form-urlencoded',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'image_url=https%3A%2F%2Ftelegra.ph%2Ffile%2Fc6c8be08bfb1e27e558a1.png&room=Living%20room&theme=Modern');

$response = curl_exec($ch);

curl_close($ch);
```

{% endtab %}

{% tab title="NodeJs" %}

```javascript
import axios from 'axios';

const response = await axios.post(
  'https://prod.api.market/api/v1/capix/homegpt/room/v1/',
  new URLSearchParams({
    'image_url': 'https://telegra.ph/file/c6c8be08bfb1e27e558a1.png',
    'room': 'Living room',
    'theme': 'Modern'
  }),
  {
    headers: {
      'accept': 'application/json',
      'x-api-market-key': 'API_KEY'
    }
  }
);
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch('https://prod.api.market/api/v1/capix/homegpt/room/v1/', {
  method: 'POST',
  headers: {
    'accept': 'application/json',
    'x-api-market-key': 'API_KEY'
  },
  body: new URLSearchParams({
    'image_url': 'https://telegra.ph/file/c6c8be08bfb1e27e558a1.png',
    'room': 'Living room',
    'theme': 'Modern'
  })
});
```

{% endtab %}
{% endtabs %}

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

```bash
curl -X 'POST' \
  'https://prod.api.market/api/v1/capix/homegpt/result/' \
  -H 'accept: application/json' \
  -H 'x-api-market-key: API_KEY' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'request_id=REQUEST_ID'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    'accept': 'application/json',
    'x-api-market-key': 'API_KEY',
    'Content-Type': 'application/x-www-form-urlencoded',
}

data = {
    'request_id': 'REQUEST_ID',
}

response = requests.post('https://prod.api.market/api/v1/capix/homegpt/result/', headers=headers, data=data)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://prod.api.market/api/v1/capix/homegpt/result/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'accept: application/json',
    'x-api-market-key: API_KEY',
    'Content-Type: application/x-www-form-urlencoded',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'request_id=REQUEST_ID');

$response = curl_exec($ch);

curl_close($ch);
```

{% endtab %}

{% tab title="NodeJs" %}

```javascript
import axios from 'axios';

const response = await axios.post(
  'https://prod.api.market/api/v1/capix/homegpt/result/',
  new URLSearchParams({
    'request_id': 'REQUEST_ID'
  }),
  {
    headers: {
      'accept': 'application/json',
      'x-api-market-key': 'API_KEY'
    }
  }
);
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch('https://prod.api.market/api/v1/capix/homegpt/result/', {
  method: 'POST',
  headers: {
    'accept': 'application/json',
    'x-api-market-key': 'API_KEY'
  },
  body: new URLSearchParams({
    'request_id': 'REQUEST_ID'
  })
});
```

{% endtab %}
{% endtabs %}

### Theme <a href="#theme" id="theme"></a>

While you are generating your room images, you can use different themes. You can find themes [here ](https://www.homegpt.app/roomgpt).

<figure><img src="https://docs.capix.uz/~gitbook/image?url=https%3A%2F%2F2897687215-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FSeO3NtyiVp4pZWbnaKgi%252Fuploads%252FPApT9f6wK5rZejxYPbxn%252Fimage.png%3Falt%3Dmedia%26token%3Dfdaf134b-5fee-4de7-9c94-83df7b570584&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=42bed893fd5ae20efe3016cf1f0254245ff12b4ed29ce3dab3657b5c059f5fca" alt=""><figcaption></figcaption></figure>

**Room names could be one of these**: `Living Room`, `Dining Room`, `Gaming Room`, `Bedroom`, `Bathroom`, `Office`, `Kitchen`, `Guest Room`, `Laundry Room`, `Home Theater`, `Playroom`, `Music Room`, `Exercise Room`, `Library`, `Sunroom`, `Mudroom`, `Attic`, `Basement`, `Pantry`, `Wine Cellar`, `Garage`, `Outdoor Living Space`, `Pool Room`, `Study Room`, `Home Office`, `House Exterior`, `Outdoor Pool Area`, `Outdoor Patio`, `Outdoor Garden`, `Meeting Room`, `Workshop`, `Fitness Gym`, `Coffee Shop`, `Clothing Store`, `Walk-in Closet`, `Toilet`, `Restaurant`, `Coworking Space`, `Hotel Lobby`, `Hotel Room`, `Hotel Bathroom`, `Exhibition Space`, `Onsen`, `Drop Zone`

**Themes could be one of these**: `Modern`, `Neutral`, `Monochromatic`, `Complementary`, `Cyberpunk`, `Analogous`, `Warm`, `Cool`, `Pastel`, `Black and white`, `Earthy`, `Vintage`, `Minimalist`, `Scandinavian`, `Bohemian`, `High-Contrast`, `Bright`, `Ocean-inspired`, `Rustic`, `Tropical`, `Bold`, `Jewel-toned`, `Art Deco`, `Mediterranean`, `Traditional`, `Beachy`, `Moody`, `Urban`, `Contemporary`, `Retro`, `Whimsical`, `Zen`, `Industrial`, `Biophilic`, `Farmhouse`, `Japanese Design`, `Coastal`, `Cottagecore`, `French Country`, `Maximalist`, `Art Nouveau`, `Baroque`, `Vaporwave`, `Ski Chalet`, `Sketch`, `Christmas`, `Tribal`, `Medieval`, `Chinese New Year`, `Halloween`, `Kelly Wearstler`, `Nate Berkus`, `Joanna Gaines`, `Martyn Lawrence Bullard`, `Philippe Starck`, `Emily Henderson`, `Miles Redd`, `Victoria Hagan`, `Tom Dixon`, `Timothy Corrigan`, `Axel Vervoordt`, `Kelly Hoppen`, `Ilse Crawford`, `India Mahdavi`, `David Collins`, `Thomas O'Brien`, `Jacques Garcia`, `Bunny Williams`, `Kelly Behun`, `Robert Couturier`


---

# Agent Instructions: Querying This Documentation

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

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

```
GET https://docs.api.market/api-product-docs/capix-ai/home-gpt.md?ask=<question>
```

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

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