API Endpoint

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

Request Body

  • image: File - image of room
  • room: String - room type
  • style: String - room style name

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 import requests url = 'https://api2.aitwo.co/generate/ai-interior/' # Example data files = {'image': open('path/to/image.jpg', 'rb')} headers = { "Auth": "Bearer YOUR_API_KEY" } data = { "room": "living room", "style": "rustic" } response = requests.post(url, data=data, files=files, headers=headers) 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 const axios = require('axios'); const fs = require('fs'); const url = 'https://api2.aitwo.co/generate/ai-interior/'; // Example data const data = { "room": "living room", "style": "rustic" }; const headers = { "Auth": "Bearer YOUR_API_KEY" }; data.image = fs.createReadStream('path/to/image.jpg'); axios.post(url, data, { headers }) .then(response => { console.log(response.data); }) .catch(error => { console.error(error); });