# API Endpoints

## Create a new object

**Endpoint:**

<https://api.sloyd.ai/create>

Called in a post request.

**Input schema:**

```json
{
    "Prompt": "string",
    "ClientId": "string",
    "ClientSecret": "string",
    "ModelOutputType": "gltf",
    "ResponseEncoding": "json"
}
```

<table data-full-width="true"><thead><tr><th width="191">Parameter</th><th width="100">Required?</th><th width="567">Function</th><th width="100">Default</th></tr></thead><tbody><tr><td>ClientId</td><td>Yes</td><td>Authentication</td><td></td></tr><tr><td>ClientSecret</td><td>Yes</td><td></td><td></td></tr><tr><td>Prompt</td><td>Yes</td><td>A description of the 3D model requested</td><td></td></tr><tr><td>LOD</td><td></td><td>A number between 0.01 to 1. The higher the number, the mesh will be made from more triangles.</td><td>0.5</td></tr><tr><td>AiPromptModifiers</td><td></td><td>recoloring<br>texturing<br><br>When this field is empty, the object will be created in a default color (for example, in our system all the car parts are blue). When you add this field the AI will take color or texture instructions from the prompt.</td><td></td></tr><tr><td>ModelOutputType</td><td></td><td>Response format and 3D file format. Available values:<br>gtlf, glb, obj, stl, usd<br>(usdz with partial support)</td><td>gltf</td></tr><tr><td>ResponseEncoding</td><td></td><td><p>Available values:</p><ul><li>json</li><li>MessagePack</li><li>Only3dModelFormatWithoutMetaData</li></ul><p>(If you chose MessagePack, see <a data-mention href="/pages/Li8jJA7I1DSrZ6az2Jqq">/pages/Li8jJA7I1DSrZ6az2Jqq</a>)<br>(The third option is for getting just a 3D file without metadata)</p></td><td></td></tr><tr><td>ThumbnailPreviewExportType</td><td></td><td>Optional Preview image. Available values: png, jpg, webp </td><td></td></tr><tr><td>ThumbnailPreviewSizeX</td><td></td><td>Width in pixels of the preview image (e.g. 256) Min: 1, Max: 16384</td><td></td></tr><tr><td>ThumbnailPreviewSizeY</td><td></td><td>Hight in pixels of the preview image (e.g. 256) Min: 1, Max: 16384</td><td></td></tr></tbody></table>

**Output schema:**

```json
{
    "InteractionId": "63a1ab21-e0fc-4f7e-ab7d-1b904ee893ab",
    "Name": "string",
    "ConfidenceScore": num,
    "ResponseEncoding": "string",
    "ModelOutputType": "string",
    "ModelData": "string",
    "ThumbnailPreviewExportType": "string",
    "ThumbnailPreview": "string"
}
```

<table data-full-width="true"><thead><tr><th width="370">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>InteractionId</td><td>A reference to the generated model, it's required for AI editing.</td></tr><tr><td>Name</td><td>A basic name for the object. It could be useful for categorization.</td></tr><tr><td>ConfidenceScore</td><td>A score indicating how confident the AI is that the returned object matches the text prompt. </td></tr><tr><td>ResponseEncoding</td><td>file format, json or message pack</td></tr><tr><td>ModelOutputType</td><td>3D file format: obj, glb, gltf, usd, usdz, stl</td></tr><tr><td>ModelData</td><td>The 3D file</td></tr><tr><td>ThumbnailPreviewExportType</td><td>the image file format, if available. Options: none, jpg, png, webp</td></tr><tr><td>ThumbnailPreview</td><td>The preview image file, if available.</td></tr></tbody></table>

## Edit an existing object

**Endpiont:**

<https://api.sloyd.ai/edit>

Called in a post request.

**Input schema:**

```json
{
    "Prompt": "string",
    "ClientId": "string",
    "ClientSecret": "string",
    "ModelOutputType": "gltf",
    "ResponseEncoding": "json",
    "InteractionId": "string"
}
```

Every input parameter that is in create can be added to edit as well. Yet, in edit, you must include interactionId. (See create input schema table for a detailed parameter descriptions.)

**Output schema:**

```json
{
    "InteractionId": "string",
    "Name": null,
    "ResponseType": "INFO",
    "ResponseMessage": "string",
    "ResponseEncoding": "JSON",
    "ModelOutputType": "Obj",
    "ModelData": "string"
}
```

| **Parameter**   | **Description**                                                                                                                                                                                                                                                          |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| InteractionId   | A reference to the generated model, it's required for AI editing.                                                                                                                                                                                                        |
| Name            | Field is part of the schema but in case of edit it is null                                                                                                                                                                                                               |
| ResponseType    | <p>INFO - the model was changed the soda\_response\_message contains a description how it was changed.<br>WARNING - the model was not changed and response message contains information on why it was not changed.<br>ERROR - The call was timed out or other error.</p> |
| ResponseMessage | A human readable text description of what where the changes made to the model. Of in case of 'warning' why a change could not be made.                                                                                                                                   |
| ModelOutputType | 3D file format: obj, glb, gltf, usd, stl                                                                                                                                                                                                                                 |
| ModelData       | The 3D file                                                                                                                                                                                                                                                              |


---

# 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://sloyd.gitbook.io/documentation/other-products/deprecated-products/api/api-endpoints.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.
