API Documentation

Introduction

This documentation describes the REST interface of the Chat3D API.

API Reference

Base URL

https://public.api-chat3d.com

Version

v1

Authentication

Authentication is token-based, using the Authorization HTTP header, and is required for all API endpoints.

Authorization: <token>

Content Type

All POST requests must use the application/json content type. Requests with a different content type will be rejected.

Most responses from the API are returned in application/json format. However, in some error cases (e.g., internal server errors), the response body may be returned as plain text text/plain.

HTTP Status Codes

The Chat3D API uses standard HTTP status codes to indicate whether a request was successful or if an error occurred. The table below summarizes the most common codes returned by the API.

CODEDESCRIPTION
200Request succeeded. The response contains the expected data.
400Bad request. The content have an unexcpected format.
401Authentication failed. The Authorization header is missing or contains an invalid token.
403Access denied. The token is valid but does not grant permission to access the resource or credits are insufficient.
405Unallowed method for this endpoint.
500Internal server error. An unexpected condition was encountered on the server.

Endpoints

Check API availability

/health

Checks whether the API is available.

Sample response
{
  "status": "OK"
}

Generate from prompt or images

/generate

Credit Usage: Each successful call to this endpoint results in the consumption of 3 credits per number_of_generations.

This endpoint initiates the generation of a 3D model based on a textual prompt or on some images. Each generation task is linked to a task_token, which uniquely identifies the generation process and all related assets. This includes the resulting 3D model, any supplementary resources like external textures (when not embedded), and alternate file formats of the model.

PARAMETERTYPEDESCRIPTION
prompt *stringText describing the 3D scene.
images * **arrayList containing between 1 and 4 image URLs.
number_of_generationsintegerSpecifies how many models to generate.
Must be between 1 and 4 if using prompt, or exactly 1 if using images.

* The fields prompt and images are mutually exclusive. Only one of them must be provided.

** Image URLs must meet the following requirements:
- Protocol: URLs must start with https://.
- Size limit: Maximum file size is 2 MB per image.
- Supported formats: png, jpeg, jpg, webp, gif and svg.

Important: The task_token is returned only once and is required to retrieve generation results. While it's not an authentication token, it's strongly recommended to save it, especially in case of script failure or future access needs.

Sample request
{
  "prompt": "A futuristic 3D building",
  "number_of_generations": 1
}
Sample response
{
  "task_token": "abc123-task-token"
}

Get task informations

/task/task_token

PARAMETERTYPEDESCRIPTION
task_tokenstringThe identifier of the task.

Retrieves the details of a previously submitted task. To check when a task is complete, we recommend polling the task status at regular intervals (e.g., every 30 seconds, and every 10 seconds once progress exceeds 90%).

Sample response
{
  "task_token": "b6a151ea273749bba00cae57db6ba2f9",
  "task_status": "files_generation",
  "number_of_generations": 1,
  "created_at": "2025-06-16T10:39:58",
  "updated_at": "2025-06-16T08:40:00",
  "message": "files are generating...",
  "progress": 55,
  "generated_files_count": 0.5,
  "generated_files": [
    "mesh_original_glb_1",
    "texture_original_1"
  ]
}

Get a download URL

/download_url

Provides a download URL for a previously generated file.

PARAMETERTYPEDESCRIPTIONDEFAULT VALUE
task_tokenstringTask identifier of the resource.-
file_keystringPath or name of the file to download.-
requested_file_formatstringTarget format, for 3D meshes.glb

Valid formats (for 3D meshes only) are: glb, fbx, stl, obj, ply, usd, abc, dae and usdz

The URL provided to download the requested file is valid for one hour only. This URL is not part of the API endpoints, and no Authorization header should be included in the request.

If the requested resource includes multiple files (such as textures), they will be bundled into a single ZIP archive for download.

Sample request
{
  "task_token": "abc123-task-token",
  "file_key": "mesh_original_glb_1",
  "requested_file_format": "glb"
}
Sample response
{
  "file_download_url": "https://my.s3.amazonaws.com/download/file.glb?option=value"
}

Edit an existing model

/edit

Credit Usage: Each successful call to this endpoint results in the consumption of 3 credits.

This endpoint allows you to edit an existing 3D model by providing additional instructions via a prompt. The parent_task_token must correspond to a completed task. The result of this endpoint is a new task, identified by a new task_token.

PARAMETERTYPEDESCRIPTION
edit_promptstringText describing the modifications to apply to the existing model.
parent_task_tokenstringThe task_token of the completed task whose model you want to edit.
Sample request
{
  "edit_prompt": "Add a black hat on the top",
  "parent_task_token": "abc123-task-token"
}
Sample response
{
  "task_token": "new-abc123-task-token"
}

Refine an existing model

/refine

Credit Usage: Each successful call to this endpoint results in the consumption of 3 credits.

This endpoint allows you to refine an existing 3D model generated by a previous task. The parent_task_token must correspond to a completed task, and the file_key identifies the specific mesh file to refine. The result of this endpoint is a new task, identified by a new task_token.

PARAMETERTYPEDESCRIPTION
parent_task_tokenstringThe task_token of the completed task containing the model you want to refine.
file_keystringIdentifier of the mesh file to refine (for example: mesh_original_fbx_1).
Sample request
{
  "parent_task_token": "abc123-task-token",
  "file_key": "mesh_original_glb_1"
}
Sample response
{
  "task_token": "new-abc123-task-token"
}

Resources

File Keys

File keys are unique identifiers for files generated by the API. They follow specific naming conventions based on the type of task and the generation parameters.

Key Components:
- type: original if created via the /generate endpoint, or edited if created via the /edit endpoint.
- number: Generation number, an integer between 1 and 4.
- format: File format for 3D meshes, glb is available by default, others are created with the /download_url endpoint.

Base File Keys:
For each generation, the following 4 file keys are created:

FILE KEYDESCRIPTIONFORMAT
gif_type_numberGIF preview of the generated model.GIF
mesh_image_reference_type_numberReference image of the generated model.PNG
mesh_type_glb_numberPrimary 3D model in GLB format.GLB
texture_type_numberTextures associated with the model.ZIP

Example of 'file_key' for a single task generation using the /generate endpoint
The following 4 file keys are expected:

FILE KEYDESCRIPTIONFORMAT
gif_original_1GIF preview of the generated model.GIF
mesh_image_reference_original_1Reference image of the generated model.PNG
mesh_original_glb_1Primary 3D model in GLB format.GLB
texture_original_1Textures associated with the model.ZIP

Additional File Keys:
When downloading a mesh in a format other than its default format (e.g., downloading mesh_original_glb_1 in OBJ format), a new file key is created following the pattern: mesh_type_format_number.

Task

The following fields describe the status and progress of a generation task.

FIELDTYPEDESCRIPTION
task_tokenstringUnique identifier for the generation task.
created_atstringTimestamp indicating when the task was created, in the format YYYY-MM-DD HH:MM:SS.
updated_atstringTimestamp of the most recent update to the task, in the format YYYY-MM-DD HH:MM:SS.
statusTask StatusCurrent status of the task.
number_of_generationsintegerNumber of assets to generate (i.e., number of final files expected).
messagestringHuman-readable status message.
progressintegerProgress percentage of the generation task, from 0 to 100.
generated_files_countfloatAggregated progress of all file generations for the task.
When all generations are fully completed, the value equals number_of_generations.
generated_filesarray of stringsList of file_key identifiers for each generated file.

If a file is generated but is not yet available for download, its file_key is set to "unknown file key"

Task Status

The task_status field indicates the current stage of the generation process.

VALUEDESCRIPTION
generate_promptThe prompt and any associated resources are currently being analyzed.
files_generationThe generation of output files is currently in progress.
finishedThe task has completed and the results are ready.