리메시 API

리메시 API를 사용하면 다른 Meshy API(예: 이미지로 3D 또는 텍스트로 3D)로 생성된 기존 3D 모델을 리메시하고 다양한 형식으로 내보낼 수 있습니다. 이 섹션에서는 리메시 API 사용 방법에 대한 세부 정보를 제공합니다.


POST/openapi/v1/remesh

리메시 작업 생성

이 엔드포인트는 새 리메시 작업을 생성합니다.

파라미터

  • Name
    input_task_id
    Type
    string
    필수
    Description

    리메시하려는 완료된 이미지로 3D 또는 텍스트로 3D 작업의 ID입니다. 이 작업은 다음 작업 중 하나여야 합니다: 텍스트로 3D 미리보기, 텍스트로 3D Refine, 이미지로 3D 또는 리텍스처. 또한 상태가 SUCCEEDED여야 합니다.

  • Name
    model_url
    Type
    string
    필수
    Description

    공개적으로 접근 가능한 URL 또는 Data URI를 통해 Meshy가 리메시할 3D 모델을 제공해 주세요. 지원 형식: .glb, .gltf, .obj, .fbx, .stl.

    Data URI의 경우 MIME type을 사용하세요: application/octet-stream.

  • Name
    target_formats
    Type
    string[]
    기본값 ["glb"]
    Description

    리메시된 모델의 대상 형식 목록입니다. 생략하면 GLB만 생성됩니다.

    사용 가능한 값: glb, fbx, obj, usdz, blend, stl, 3mf.

  • Name
    topology
    Type
    string
    기본값 triangle
    Description

    생성된 모델의 topology를 지정합니다.

    사용 가능한 값:

    • quad: 쿼드 중심 메시를 생성합니다.
    • triangle: 디시메이션된 삼각형 메시를 생성합니다.
  • Name
    target_polycount
    Type
    integer
    기본값 30,000
    Description

    생성된 모델의 대상 폴리곤 수를 지정합니다. 실제 폴리곤 수는 지오메트리의 복잡도에 따라 대상에서 벗어날 수 있습니다.

    유효한 값 범위는 사용자 등급에 따라 달라집니다:

    • 100~300,000(포함)
  • Name
    decimation_mode
    Type
    integer
    Description

    폴리곤 수 레벨을 설정하여 적응형 디시메이션을 활성화합니다. 설정하면 target_polycount는 무시됩니다.

    사용 가능한 값:

    • 1: 적응형 — 초고 폴리곤 수.
    • 2: 적응형 — 높은 폴리곤 수.
    • 3: 적응형 — 중간 폴리곤 수.
    • 4: 적응형 — 낮은 폴리곤 수.
  • Name
    resize_height
    Type
    number
    사용 중단
    기본값 0
    Description

    모델을 미터 단위로 측정한 특정 높이로 크기 조정합니다. 대신 전용 크기 조정 API를 사용하는 것을 권장합니다.

  • Name
    resize_longest_side
    Type
    number
    사용 중단
    기본값 0
    Description

    가장 긴 바운딩 박스 치수가 지정된 미터 값과 같아지도록 모델을 크기 조정합니다. 대신 전용 크기 조정 API를 사용하는 것을 권장합니다.

  • Name
    auto_size
    Type
    boolean
    사용 중단
    기본값 false
    Description

    true로 설정하면 서비스가 AI 비전을 사용하여 객체의 실제 높이를 자동으로 추정하고 그에 따라 모델을 크기 조정합니다. 대신 전용 크기 조정 API를 사용하는 것을 권장합니다.

다음 경우에만 적용 auto_size = true
  • Name
    origin_at
    Type
    string
    사용 중단
    기본값 bottom
    Description

    원점의 위치입니다. 대신 전용 크기 조정 API를 사용하는 것을 권장합니다.

    사용 가능한 값: bottom, center.

  • Name
    convert_format_only
    Type
    boolean
    사용 중단
    Description

    true인 경우 서비스는 topology, resize_height, target_polycount와 같은 다른 입력을 무시하고 입력 모델 파일의 형식만 변경합니다. 대신 전용 변환 API를 사용하는 것을 권장합니다.

  • Name
    alpha_thumbnail
    Type
    boolean
    기본값 false
    Description

    true로 설정하면 작업이 추가로 미리보기의 투명 배경(RGBA) 버전을 렌더링하고 GET 응답에서 alpha_thumbnail_url로 반환합니다. 기존 thumbnail_url 필드는 변경되지 않습니다.

반환값

응답의 result 속성에는 새로 생성된 리메시 작업의 id가 포함됩니다.

실패 모드

  • Name
    400 - Bad Request
    Description

    요청을 수락할 수 없습니다. 일반적인 원인:

    • 누락된 파라미터: model_url 또는 input_task_id 중 하나를 제공해야 합니다.
    • 잘못된 입력 작업: input_task_id는 지원되는 모델의 성공한 작업을 참조해야 합니다.
    • 잘못된 모델 형식: model_url이 지원되지 않는 확장자의 파일을 가리킵니다.
    • 도달할 수 없는 URL: model_url을 다운로드할 수 없습니다.
    • 잘못된 topology: topology 파라미터가 잘못되었습니다.
    • 상호 배타적인 파라미터: auto_sizeresize_height를 둘 다 설정할 수 없습니다.
  • Name
    401 - Unauthorized
    Description

    인증에 실패했습니다. API 키를 확인하세요.

  • Name
    402 - Payment Required
    Description

    이 작업을 수행하기에 크레딧이 부족합니다.

  • Name
    429 - Too Many Requests
    Description

    속도 제한을 초과했습니다.

Request

POST
/openapi/v1/remesh
# Basic remesh with custom formats and resize
curl https://api.meshy.ai/openapi/v1/remesh \
-X POST \
-H "Authorization: Bearer ${YOUR_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
    "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578",
    "target_formats": ["glb", "fbx"],
    "topology": "quad",
    "target_polycount": 50000,
    "resize_height": 1.0,
    "origin_at": "bottom"
  }'

# Quad remesh with auto-size
curl https://api.meshy.ai/openapi/v1/remesh \
-X POST \
-H "Authorization: Bearer ${YOUR_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
    "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578",
    "target_formats": ["glb", "fbx"],
    "topology": "quad",
    "target_polycount": 50000,
    "auto_size": true
  }'

Response

{
  "result": "0193bfc5-ee4f-73f8-8525-44b398884ce9"
}

GET/openapi/v1/remesh/:id

리메시 작업 조회

이 엔드포인트는 ID로 리메시 작업을 조회합니다.

매개변수

  • Name
    id
    Type
    path
    Description

    조회할 리메시 작업의 ID입니다.

반환값

리메시 작업 객체입니다.

Request

GET
/openapi/v1/remesh/a43b5c6d-7e8f-901a-234b-567c890d1e2f
curl https://api.meshy.ai/openapi/v1/remesh/a43b5c6d-7e8f-901a-234b-567c890d1e2f \
-H "Authorization: Bearer ${YOUR_API_KEY}"

Response

{
  "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
  "type": "remesh",
  "model_urls": {
      "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***",
      "fbx": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.fbx?Expires=***",
      "obj": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.obj?Expires=***",
      "usdz": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.usdz?Expires=***",
      "blend": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.blend?Expires=***",
      "stl": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.stl?Expires=***"
},
  "progress": 100,
  "status": "SUCCEEDED",
  "created_at": 1699999999000,
  "started_at": 1700000000000,
  "finished_at": 1700000001000,
  "task_error": null,
}

DELETE/openapi/v1/remesh/:id

리메시 작업 삭제

이 엔드포인트는 관련된 모든 모델과 데이터를 포함하여 리메시 작업을 영구적으로 삭제합니다. 이 작업은 되돌릴 수 없습니다.

경로 매개변수

  • Name
    id
    Type
    path
    Description

    삭제할 리메시 작업의 ID입니다.

반환값

성공 시 200 OK를 반환합니다.

Request

DELETE
/openapi/v1/remesh/a43b5c6d-7e8f-901a-234b-567c890d1e2f
curl --request DELETE \
  --url https://api.meshy.ai/openapi/v1/remesh/a43b5c6d-7e8f-901a-234b-567c890d1e2f \
  -H "Authorization: Bearer ${YOUR_API_KEY}"

Response

// Returns 200 Ok on success.

GET/openapi/v1/remesh

리메시 작업 목록

이 엔드포인트를 사용하면 리메시 작업 목록을 가져올 수 있습니다.

매개변수

  • Name
    page_num
    Type
    integer
    기본값 1
    Description

    페이지네이션을 위한 페이지 번호입니다.

  • Name
    page_size
    Type
    integer
    기본값 10
    Description

    페이지 크기 제한입니다. 허용되는 최대값은 50개 항목입니다.

  • Name
    sort_by
    Type
    string
    Description

    정렬 기준 필드입니다.

    사용 가능한 값:

    • +created_at: 생성 시간을 기준으로 오름차순 정렬합니다.
    • -created_at: 생성 시간을 기준으로 내림차순 정렬합니다.

반환값

리메시 작업 객체의 페이지네이션된 목록을 반환합니다.

Request

GET
/openapi/v1/remesh
curl https://api.meshy.ai/openapi/v1/remesh?page_size=10 \
-H "Authorization: Bearer ${YOUR_API_KEY}"

Response

[
  {
    "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
    "type": "remesh",
    "model_urls": {
      "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***",
      "fbx": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.fbx?Expires=***",
      "obj": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.obj?Expires=***",
      "usdz": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.usdz?Expires=***",
      "blend": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.blend?Expires=***",
      "stl": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.stl?Expires=***"
    },
    "progress": 100,
    "status": "SUCCEEDED",
    "created_at": 1699999999000,
    "started_at": 1700000000000,
    "finished_at": 1700000001000,
    "task_error": null
  }
]

GET/openapi/v1/remesh/:id/stream

리메시 작업 스트리밍

이 엔드포인트는 Server-Sent Events (SSE)를 사용하여 리메시 작업의 실시간 업데이트를 스트리밍합니다.

매개변수

  • Name
    id
    Type
    path
    Description

    스트리밍할 리메시 작업의 고유 식별자입니다.

반환값

Server-Sent Events로 리메시 작업 객체의 스트림을 반환합니다.

PENDING 또는 IN_PROGRESS 작업의 경우 응답 스트림에는 필요한 progressstatus 필드만 포함됩니다.

Request

GET
/openapi/v1/remesh/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream
curl -N https://api.meshy.ai/openapi/v1/remesh/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream \
-H "Authorization: Bearer ${YOUR_API_KEY}"

Response Stream

// Error event example
event: error
data: {
  "status_code": 404,
  "message": "Task not found"
}

// Message event examples illustrate task progress.
// For PENDING or IN_PROGRESS tasks, the response stream will not include all fields.
event: message
data: {
  "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
  "progress": 0,
  "status": "PENDING"
}

event: message
data: {
  "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
  "type": "remesh",
  "model_urls": {
    "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***",
    "fbx": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.fbx?Expires=***",
    "obj": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.obj?Expires=***",
    "usdz": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.usdz?Expires=***",
    "blend": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.blend?Expires=***",
    "stl": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.stl?Expires=***"
  },
  "progress": 100,
  "status": "SUCCEEDED",
  "created_at": 1699999999000,
  "started_at": 1700000000000,
  "finished_at": 1700000001000,
  "task_error": null,
}

리메시 작업 객체

리메시 작업 객체는 Meshy가 기존 3D 모델을 리메시하고 다양한 형식으로 내보내는 데 사용하는 작업 단위를 나타냅니다. 이 객체에는 다음 속성이 있습니다:

속성

  • Name
    id
    Type
    string
    Description

    작업의 고유 식별자입니다. 구현 세부 사항으로 작업 id에 k-정렬 가능한 UUID를 사용하지만, id 형식에 대해 어떤 가정도 해서는 안 됩니다.

  • Name
    type
    Type
    string
    Description

    리메시 작업의 유형입니다. 값은 remesh입니다.

  • Name
    model_urls
    Type
    object
    Description

    Meshy에서 생성한 텍스처가 적용된 3D 모델 파일의 다운로드 가능한 URL입니다. 형식이 생성되지 않은 경우 빈 문자열을 반환하는 대신 해당 형식의 속성이 생략됩니다.

    • Name
      glb
      Type
      string
      Description

      GLB 파일의 다운로드 가능한 URL입니다.

    • Name
      fbx
      Type
      string
      Description

      FBX 파일의 다운로드 가능한 URL입니다.

    • Name
      obj
      Type
      string
      Description

      OBJ 파일의 다운로드 가능한 URL입니다.

    • Name
      usdz
      Type
      string
      Description

      USDZ 파일의 다운로드 가능한 URL입니다.

    • Name
      blend
      Type
      string
      Description

      Blender 파일의 다운로드 가능한 URL입니다.

    • Name
      stl
      Type
      string
      Description

      STL 파일의 다운로드 가능한 URL입니다.

    • Name
      3mf
      Type
      string
      Description

      3MF 파일의 다운로드 가능한 URL입니다. target_formats를 통해 3mf가 요청된 경우에만 존재합니다.

  • Name
    thumbnail_url
    Type
    string
    Description

    리메시된 모델에서 렌더링된 미리보기 이미지의 다운로드 가능한 URL입니다.

  • Name
    alpha_thumbnail_url
    Type
    string
    Description

    thumbnail_url의 투명 배경(RGBA) 버전에 대한 다운로드 가능한 URL입니다. 작업이 alpha_thumbnail: true로 생성되었고 투명 미리보기가 성공적으로 렌더링된 경우에만 존재하며, 그렇지 않으면 이 필드는 생략됩니다.

  • Name
    progress
    Type
    integer
    Description

    작업의 progress입니다. 작업이 아직 시작되지 않은 경우 이 속성은 0입니다. 작업이 성공하면 이 값은 100이 됩니다.

  • Name
    status
    Type
    string
    Description

    작업의 상태입니다. 가능한 값은 PENDING, IN_PROGRESS, SUCCEEDED, FAILED 중 하나입니다.

  • Name
    preceding_tasks
    Type
    integer
    Description

    선행 작업의 수입니다.

  • Name
    created_at
    Type
    timestamp
    Description

    작업이 생성된 시점의 타임스탬프이며, 밀리초 단위입니다.

  • Name
    started_at
    Type
    timestamp
    Description

    작업이 시작된 시점의 타임스탬프이며, 밀리초 단위입니다. 작업이 아직 시작되지 않은 경우 이 속성은 0입니다.

  • Name
    finished_at
    Type
    timestamp
    Description

    작업이 완료된 시점의 타임스탬프이며, 밀리초 단위입니다. 작업이 아직 완료되지 않은 경우 이 속성은 0입니다.

  • Name
    task_error
    Type
    object
    Description

    실패한 작업에 대한 오류 세부 정보입니다. 전체 task_error 객체 참조는 오류를 참조하세요.

  • Name
    consumed_credits
    Type
    integer
    Description

    이 작업에서 소비한 크레딧 수입니다. 작업 상태가 PENDING, IN_PROGRESS 또는 SUCCEEDED일 때 존재합니다. FAILED 작업의 경우 0을 반환합니다(실패 시 크레딧은 환불됩니다).

Example Remesh Task Object

{
  "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
  "type": "remesh",
  "model_urls": {
      "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***",
      "fbx": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.fbx?Expires=***",
      "obj": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.obj?Expires=***",
      "usdz": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.usdz?Expires=***",
      "blend": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.blend?Expires=***",
      "stl": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.stl?Expires=***"
  },
  "progress": 100,
  "status": "SUCCEEDED",
  "preceding_tasks": 0,
  "created_at": 1699999999000,
  "started_at": 1700000000000,
  "finished_at": 1700000001000,
  "task_error": {

    "message": ""

  },

  "consumed_credits": 5
}