⏺️Endpoints

Follow up endpoint information's in the page to generate a model.

Summary of workflow

Pick any model name from Get All Model Names endpoint. -> Then check customizable parameters of your selection using "Get Attributes of a Model" endpoint. -> Use "Create Component" or "Create Structure" endpoints to generate 3D model. -> Use "Get Job Result" endpoint to grab download link of generated 3D model. Thats all!

1. Fetching Available 3D Model Names

Endpoint: GET /get_model_names

Returns: All available model names in JSON format.

To begin, you'll need to know which 3D model names are available for customization. This endpoint helps retrieve all available models categorized under "Structure" and "Component".

Python Code:

import requests

url = "https://opus5.p.rapidapi.com/get_model_names"
headers = {
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "opus5.p.rapidapi.com"
}

response = requests.get(url, headers=headers)
model_names = response.json()
print(model_names)

2. Discovering Customizable Attributes

Endpoint: GET /get_attributes_with_name

Returns: All attributes of requested model. Components, assets, tags, parameter presets and parameters in JSON format.

Fetch attributes for your chosen model, which include parameters like "keywords" and specific "parameters".

Python Code:

3. Customize and Create 3D Models

After deciding on the attributes, you can customize and create your 3D model.

a. Create Structure

Endpoint: POST /create_opus_structure

This endpoint is disabled temporarily.

Python Code:

b. Create Component

Endpoint: POST /create_opus_component

Returns: An Job UUID.

Use this endpoint to create a component based on the desired attributes. Here's Python code examples to help you understand the process:

Example #1 - Create a Table with 1.2 meter width and .95 meter depth

Example #2 - Create a small Sofa

Example #3 - Create a modern Sofa with 2 meter width

4. Checking the Job Result

Once the model is created, you can poll for the job result using the returned UUID from the creation step.

Endpoint: GET /get_opus_job_result

Returns: Job Status and download links.

Python Code:

Extensions

To customize your 3D model's file extension, you'll utilize the extensions property in the payload. The provided schema highlights several potential values:

  • usd: Pixar's Universal Scene Description format.

  • gltf: JSON-based 3D model format.

  • fbx: Autodesk's Filmbox format.

For instance, if you wish to designate the model's extension to fbx, you would adjust the extensions attribute in your request payload as follows:

Last updated