빠른 시작

먼저 API 키를 생성하세요

이 가이드의 모든 요청에는 API 키가 필요합니다. 키 생성은 몇 초면 충분합니다.

API 키 생성하기

Meshy REST API를 사용해 첫 3D 모델을 만드는 네 단계입니다.


1API 키 발급받기

Developer Platform의 API Keys 페이지에서 API 키를 생성하세요. 이 화면을 벗어나면 다시 확인할 수 없으니 안전한 곳에 보관해야 합니다. 모든 요청은 Authorization 헤더에 Bearer 토큰을 담아 인증합니다 — 인증 문서를 참고하세요.

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


2첫 번째 Image-to-3D 요청 보내기

키를 export한 다음 이미지로 3D로 첫 번째 작업을 생성하세요. 텍스트 prompt나 여러 장의 사진으로 작업하고 싶으신가요? 텍스트로 3D 또는 멀티 이미지로 3D를 참고하세요.

Export your key

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

아래의 모든 예시는 이 사진을 사용합니다 — 다른 것을 시도하려면 image_url을 원하는 이미지로 바꾸세요.

이 가이드에서 Image to 3D 입력으로 사용되는 판타지 캐릭터 예시 일러스트
입력 예시

Request

POST
/openapi/v1/image-to-3d
curl https://api.meshy.ai/openapi/v1/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"
  }'

3작업 상태 확인하기

요청을 보내면 즉시 작업 ID가 반환됩니다. status가 SUCCEEDED가 될 때까지 같은 엔드포인트를 폴링하세요 — 아래 <task_id>를 2단계에서 반환받은 ID로 바꾸세요.

Request

GET
/openapi/v1/image-to-3d/:id
curl https://api.meshy.ai/openapi/v1/image-to-3d/<task_id> \
  -H "Authorization: Bearer ${MESHY_API_KEY}"

Response — SUCCEEDED

{
  "id": "018a210d-8ba4-705c-b111-1f1776f7f578",
  "status": "SUCCEEDED",
  "progress": 100,
  "model_urls": {
    "glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.glb?Expires=***",
    "fbx": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.fbx?Expires=***"
  },
  "thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***",
  "task_error": {
    "message": ""
  }
}

4모델 다운로드하기

위 응답의 model_urls에서 모델을 가져오세요. 각 포맷(GLB, FBX, OBJ, USDZ, STL)은 서명되고 유효기간이 있는 URL입니다 — 명령줄 대신 브라우저 주소창에 URL을 직접 붙여넣어 다운로드할 수도 있습니다.

Download

model_urls.glb
curl -L "<model_urls.glb from the response above>" -o model.glb
샘플 판타지 캐릭터 사진으로부터 생성된 3D 모델 결과
결과물

전체 과정 한 번에 처리하기

생성, 폴링, 다운로드까지 한 번에 처리하는 스크립트를 원하시나요?

Full script

import axios from 'axios';
import fs from 'fs';

const headers = { Authorization: `Bearer ${process.env.MESHY_API_KEY}` };
const imageUrl = 'https://docs.meshy.ai/images/api/quick-start/source-photo.webp';

// 1. Create the task
const { data: created } = await axios.post(
  'https://api.meshy.ai/openapi/v1/image-to-3d',
  { image_url: imageUrl },
  { headers },
);
const taskId = created.result;

// 2. Poll until it finishes
let task;
while (true) {
  const { data } = await axios.get(`https://api.meshy.ai/openapi/v1/image-to-3d/${taskId}`, { headers });
  task = data;
  if (task.status === 'SUCCEEDED' || task.status === 'FAILED') break;
  await new Promise((resolve) => setTimeout(resolve, 5000));
}

// 3. Download the result (only if the task succeeded)
if (task.status !== 'SUCCEEDED') {
  throw new Error(`Task ${task.status}: ${task.task_error?.message || 'unknown error'}`);
}
const { data: model } = await axios.get(task.model_urls.glb, { responseType: 'arraybuffer' });
fs.writeFileSync('model.glb', model);
console.log('Saved model.glb');

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


다음 단계

  • UI가 더 편하신가요? Developer Platform을 열어 Playground에서 요청을 실행하고, 사용량과 요청 로그를 추적하며, webhook을 관리해보세요.
  • 모든 엔드포인트에 대한 전체 API 레퍼런스를 살펴보세요.
  • 프로덕션에 적용하기 전에 요금, 속도 제한, 오류를 확인하세요.
  • 업데이트와 버그 수정 내역은 변경 로그에서 확인하세요.
  • 의견이 있거나 문제를 겪고 계신가요? Discord 커뮤니티에 참여해 주세요 — 여러분의 의견을 기다립니다!