API Endpoint

1 https://api2.aitwo.co/generate/ai-exterior/

Request Body

  • image: File - image of room
  • styleImage: File - (optional) if given, AI will copy style of house/arch given in this style image and will apply it to image
  • buildingType: String - type of building/arch, default: "house"
  • buildingStyle: String - building/house style name
  • materials: string - comma seperated list of materials

Request Headers

  • Auth: Bearer YOUR_API_KEY

Response

Success

{ "code": 100, "data": { "image_url": "url of generated image ", "id": "generated image id" }, "message": "success" }

Error

{ "code": "Any code other than 100", "message": "error_message" }

Code

Python

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 import requests url = 'https://api2.aitwo.co/generate/ai-exterior/' # Example data headers = { "Auth": "Bearer YOUR_API_KEY" } data = { "buildingType": "house", "buildingStyle": "rustic", "materials": "wood, stone, metal" } files = {'image': open('path/to/image.jpg', 'rb')} response = requests.post(url, headers=headers, json=data, files=files) print(response.json())

Node.js

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 const axios = require('axios'); const url = 'https://api2.aitwo.co/generate/ai-exterior/'; // Example data const data = { "buildingType": "house", "buildingStyle": "rustic", "materials": "wood, stone, metal" }; const formData = new FormData(); formData.append('image', fs.createReadStream('path/to/image.jpg')); Object.entries(data).forEach(([key, value]) => { formData.append(key, value); }); axios.post(url, formData, { headers }) .then(response => { console.log(response.data); }) .catch(error => { console.error(error); });