lowpoly는 2026. 10. 30.에 지원 종료됩니다. 3D 생성 모델 meshy-7은 2026. 12. 31.에 지원 종료됩니다. 텍스처 모델로는 계속 사용할 수 있습니다. 요청 오류를 피하려면 해당 날짜 전에 모델을 전환하세요. 모든 지원 중단 보기

빠른 시작

API 키를 생성하는 것으로 시작하세요

이 가이드의 모든 요청에는 API 키가 필요합니다. 키를 생성하는 데는 몇 초밖에 걸리지 않습니다.

API 키 생성하기

네 단계로 Meshy API v2를 사용해 첫 번째 3D 모델을 만들어 보세요. API 키를 발급받고, 작업을 생성하고, Tasks 라우트로 진행 상황을 추적한 다음, 결과물을 다운로드하면 됩니다.


1API 키 발급받기

Developer Platform의 API Keys 페이지에서 API 키를 생성하세요. 해당 화면을 벗어나면 키를 다시 볼 수 없으므로 안전한 곳에 보관하세요. 모든 요청에서 Authorization 헤더에 Bearer 토큰으로 전송하세요. 인증을 참고하세요.

API 키를 생성하고 관리하려면 유료 플랜이 필요합니다. Free 플랜에서는 자신만의 키를 생성할 수 없으며, Playground는 테스트용으로 내장된 키를 사용합니다.

Developer Platform에서 API Keys 페이지를 열고 키를 생성하세요

키를 코드에 붙여넣는 대신 환경 변수에 저장하세요. 터미널에서 다음을 실행하세요:

Export your key

export MESHY_API_KEY="<your-api-key>"

JavaScript 예제는 Node.js 18 이상에 내장된 fetch를 사용합니다. Python 예제는 requests (pip install requests)를 사용합니다.


2이미지로 3D 작업 생성하기

이미지로 3D로 이미지를 전송합니다. 텍스트 prompt나 여러 장의 사진으로 시작하려면 대신 텍스트로 3D 또는 멀티 이미지로 3D를 사용하세요. 여기서부터는 모든 엔드포인트가 동일하게 동작합니다.

다음 예제들은 모두 이 사진을 사용하며, texture_model이 선택하는 Meshy 7로 모델에 텍스처를 입힙니다. 다른 이미지를 사용해 보려면 image_url을 변경하세요. 다른 텍스처 모델을 선택하려면 텍스처 모델을 참고하세요.

Sample fantasy character illustration used as the Image to 3D input in this guide
Sample input

Request

POST
/openapi/v2/image-to-3d
curl https://api.meshy.ai/openapi/v2/image-to-3d \
  -X POST \
  -H "Authorization: Bearer ${MESHY_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "https://docs.meshy.ai/images/api/quick-start/source-photo.webp",
    "texture_model": "meshy-7"
  }'

응답은 작업 객체와 함께 202 Accepted로 반환됩니다. 다음 모든 단계에서 필요하므로 id를 보관해 두세요. Location 헤더는 작업을 조회할 경로를 제공합니다.

Response: 202 Accepted

{
  "id": "018a210d-8ba4-705c-b111-1f1776f7f578",
  "type": "image-to-3d",
  "status": "PENDING",
  "progress": 0,
  "created_at": 1791846275575,
  "started_at": null,
  "finished_at": null,
  "expires_at": null,
  "preceding_tasks": 1,
  "consumed_credits": 30,
  "task_error": null,
  "input": {
    "image_url": "https://docs.meshy.ai/images/api/quick-start/source-photo.webp",
    "texture_model": "meshy-7"
  },
  "output": null
}

3작업이 완료될 때까지 가져오기

작업은 백그라운드에서 실행되며 보통 약 2분 정도 걸립니다. status가 SUCCEEDED, FAILED, CANCELED 중 하나가 될 때까지 /openapi/v2/tasks/<task_id>에서 가져오세요. 요청 사이에는 Retry-After 헤더에 명시된 초만큼 기다리세요.

이 동일한 라우트는 모든 엔드포인트의 작업에 대해 동작합니다. 일반적인 처리 시간과 포기하기 전에 얼마나 기다려야 하는지는 처리 시간과 얼마나 기다려야 하는지를 참고하세요.

Request

GET
/openapi/v2/tasks/:id
curl https://api.meshy.ai/openapi/v2/tasks/<task_id> \
  -H "Authorization: Bearer ${MESHY_API_KEY}"

Response: SUCCEEDED

{
  "id": "018a210d-8ba4-705c-b111-1f1776f7f578",
  "type": "image-to-3d",
  "status": "SUCCEEDED",
  "progress": 100,
  "created_at": 1791846275575,
  "started_at": 1791846275578,
  "finished_at": 1791846334536,
  "expires_at": 1792105534536,
  "preceding_tasks": 0,
  "consumed_credits": 30,
  "task_error": null,
  "input": {
    "image_url": "https://docs.meshy.ai/images/api/quick-start/source-photo.webp",
    "texture_model": "meshy-7"
  },
  "output": {
    "model_urls": {
      "glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.glb?Expires=***"
    },
    "thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***",
    "thumbnail_urls": null,
    "texture_urls": [
      {
        "base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***",
        "metallic": null,
        "roughness": null,
        "normal": null,
        "metallic_roughness": null,
        "emission": null
      }
    ]
  }
}

작업이 실패하면 status가 FAILED가 되며, task_error에 그 이유가 표시됩니다. 입력을 수정하거나 다른 작업을 생성하세요. 오류를 참고하세요.


4모델 다운로드

파일은 output에 있습니다. output.model_urls.glb는 expires_at까지 유효한 서명된 URL입니다. 브라우저에 붙여 넣어 파일을 다운로드할 수도 있습니다.

이미지로 3D는 작업을 생성할 때 target_formats에 다른 형식을 지정하지 않는 한 GLB 파일만 반환합니다.

Download

output.model_urls.glb
curl -L "<output.model_urls.glb from the response above>" -o model.glb
The resulting 3D model generated from the sample fantasy character photo
Your result

전체 코드

이 스크립트는 작업을 생성하고, 완료될 때까지 기다린 후 모델을 다운로드합니다.

Full script

import { writeFile } from "node:fs/promises";

const API = "https://api.meshy.ai/openapi/v2";
const headers = {
  Authorization: `Bearer ${process.env.MESHY_API_KEY}`,
  "Content-Type": "application/json",
};

async function call(path, init = {}) {
  const res = await fetch(`${API}${path}`, {
    ...init,
    headers,
    signal: AbortSignal.timeout(init.method === "POST" ? 60_000 : 30_000),
  });
  if (!res.ok) throw new Error(`${res.status}: ${(await res.json()).message}`);
  return { body: await res.json(), retryAfter: Number(res.headers.get("retry-after")) || 5 };
}

// 1. Create the task
let { body: task, retryAfter } = await call("/image-to-3d", {
  method: "POST",
  body: JSON.stringify({
    image_url: "https://docs.meshy.ai/images/api/quick-start/source-photo.webp",
    texture_model: "meshy-7",
  }),
});

// 2. Get the task until it finishes, for up to 60 minutes
const deadline = task.created_at + 60 * 60 * 1000;
while (!["SUCCEEDED", "FAILED", "CANCELED"].includes(task.status)) {
  if (Date.now() > deadline) {
    // The task is still running. Check it again later with the same ID instead of creating a new one.
    throw new Error(`Task ${task.id} is still ${task.status}; check it again later`);
  }
  await new Promise((resolve) => setTimeout(resolve, retryAfter * 1000));
  ({ body: task, retryAfter } = await call(`/tasks/${task.id}`));
}

// 3. Download the model (only if the task succeeded)
if (task.status !== "SUCCEEDED") {
  throw new Error(`Task ${task.status}: ${task.task_error?.message ?? "unknown error"}`);
}
const file = await fetch(task.output.model_urls.glb);
await writeFile("model.glb", Buffer.from(await file.arrayBuffer()));
console.log("Saved model.glb");

일반적인 워크플로우 살펴보기


다음 단계

  • 모든 엔드포인트가 공유하는 태스크 객체와 Tasks 라우트에 대해 알아보세요.
  • API v2 개요에서 모든 엔드포인트를 살펴보세요.
  • 프로덕션에 적용하기 전에 요금, 속도 제한, 오류를 확인하세요.
  • UI를 선호하시나요? Developer Platform에서 Playground로 요청을 실행하고, 사용량과 요청 로그를 추적하며, Webhooks를 관리할 수 있습니다.
  • Cookbook에서 단계별 레시피를 따라 해보고, Developer Blog에서 튜토리얼을 읽어보세요.
  • 피드백이나 문제가 있으신가요? Meshy Discord 커뮤니티에 참여하세요.