Tutorial
Meshy-7.1 Multi-Image to 3D via the HiAPI API: curl and Python Tutorial
On this page
What the endpoint does and when to use it
meshy-7.1/multi-image-to-3d turns a set of reference images into a 3D asset. Instead of inferring geometry from a single photo, you supply multiple views of the same subject, and the model reconciles them into one consistent mesh. More viewpoints mean fewer guesses about the parts a single camera angle never saw.
That distinction matters for pipeline design. If your input is a single product shot and the back of the object is unimportant, a single-image route is usually enough. Reach for multi-image when:
- You have a small set of photos covering different sides of a physical object, and you need the hidden surfaces to be plausible rather than invented.
- Your source material is a turnaround or turntable capture, so views are already mutually consistent.
- You are building an asset pipeline where downstream steps (rigging, texturing, collision setup) depend on correct overall proportions, not just a convincing front silhouette.
The trade-off is input discipline. The model assumes your images depict the same object from different angles. Mixed subjects, inconsistent lighting, or wildly different framing will degrade the result more than a single weaker image would. Treat image curation as part of the integration, not an afterthought.
On HiAPI, this endpoint is reached through one unified interface with a consistent request and response envelope across models, so the calling pattern you learn here carries over to other generation endpoints.
Prerequisites and request shape
Before writing code, confirm you have three things in place.
First, an API key issued by HiAPI. Every request authenticates with it, and it should live in an environment variable rather than in source control. Second, a set of reference images reachable by the API—either as URLs or as encoded image data, depending on what the endpoint accepts. Third, a working curl and, for the Python section, a recent Python 3 with the requests library available.
Every request to this endpoint shares the same anatomy:
- Endpoint path identifying the model and task, here
meshy-7.1/multi-image-to-3d. - Auth header carrying your bearer token.
- Content-Type set to
application/jsonfor a JSON body. - Payload containing your image inputs plus any generation parameters you want to set.
- Optional idempotency or callback fields, if you want deduplicated submission or asynchronous notification rather than polling.
The payload is the only part that varies meaningfully between calls. Keep the image list explicit and ordered; do not rely on the server to sort or deduplicate your inputs. If you are assembling images from user uploads, validate them (format, dimensions, non-empty body) before you build the request, so failures surface in your own logs rather than as opaque API errors.
A working curl request
The smallest useful call sends your images and lets the endpoint apply its defaults. Replace the placeholder values with your own key and image URLs.
export HIAPI_API_KEY="your-api-key-here"
curl -X POST "https://api.hiapi.ai/v1/models/meshy-7.1/multi-image-to-3d" \
-H "Authorization: Bearer $HIAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"images": [
"https://your-bucket.example.com/chair-front.jpg",
"https://your-bucket.example.com/chair-side.jpg",
"https://your-bucket.example.com/chair-back.jpg"
]
}'
A few habits worth adopting from the first call:
- Keep the key in an environment variable as shown, so the command is safe to paste into a terminal history or a shared runbook.
- Submit all views in one request. Splitting them across calls defeats the purpose of the multi-image route.
- Add parameters explicitly once you know what you need, rather than copying an oversized payload from a tutorial. Start minimal, then grow the body.
- Log the response body verbatim on the first few runs. You want to see the real shape of the reply before you write parsing code against it.
If your images live locally rather than in object storage, upload them to a location the API can read first, then reference those URLs. Inline transfer is possible in some configurations, but hosted references keep the request small and make retries cheap.
The same request in Python
The Python client below mirrors the curl call and adds the pieces you need in an application: environment-based credentials, a timeout, and explicit error handling.
import os
import requests
API_KEY = os.environ["HIAPI_API_KEY"]
ENDPOINT = "https://api.hiapi.ai/v1/models/meshy-7.1/multi-image-to-3d"
def generate_3d(image_urls, timeout=120):
payload = {"images": image_urls}
response = requests.post(
ENDPOINT,
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
},
json=payload,
timeout=timeout,
)
if response.status_code >= 400:
raise RuntimeError(
f"generation failed [{response.status_code}]: {response.text}"
)
return response.json()
if __name__ == "__main__":
result = generate_3d([
"https://your-bucket.example.com/chair-front.jpg",
"https://your-bucket.example.com/chair-side.jpg",
"https://your-bucket.example.com/chair-back.jpg",
])
print(result)
Notes on adapting this for real use:
- Always set a timeout. Generation requests can take a while; without a timeout your worker can hang indefinitely.
- Raise on 4xx and 5xx, but treat them differently. A 4xx usually means your payload or auth is wrong and retrying unchanged will fail again. A 5xx is a candidate for bounded retry with backoff.
- Keep the payload builder separate from the transport call, so you can unit-test payload construction without hitting the network.
- Return the parsed JSON, not the raw response, so downstream code depends on a stable structure rather than an HTTP object.
This function is the natural seam for the rest of your pipeline: everything above it deals with images and jobs, everything below it deals with the generated asset.
Reading the response and handling output
The response tells you whether the job was accepted and how to retrieve the result. On the first successful call, capture the whole body and read it carefully rather than assuming field names. Typical fields you should identify:
- A job or task identifier, which you store so you can look up or retry the job later.
- A status field, indicating whether the result is ready or still processing.
- The generated asset reference, such as a URL to the mesh or a downloadable file, once the job completes.
Persist the identifier alongside your own request record. If the response is asynchronous—status shows the job is still running—do not block a web request waiting for it. Hand the identifier to a queue or scheduled task and fetch the result when it is ready, using the same authenticated interface.
Once you have the asset URL, treat it as ephemeral until proven otherwise: download it promptly, store it in your own bucket, and record the checksum. Generate assets are the expensive part of this flow; losing them to an expired link is an avoidable cost. For downstream steps, validate the mesh loads before placing it in a catalogue or handing it to a renderer.
Troubleshooting common failures
Most integration problems fall into a small number of buckets. Work through them in order.
Authentication and routing errors. A 401 or 403 almost always means a missing, malformed, or revoked key. Check that the header reads Authorization: Bearer <key> with a single space, and that the environment variable is actually exported in the shell or process running the code. A 404 usually means a typo in the endpoint path or model identifier—compare it character by character with the model page.
Payload validation errors. A 400 typically points at the images list: empty, wrong type, or containing entries the server cannot fetch. Confirm each URL is publicly reachable from the API's perspective (not behind a private network or expiring signed link), and that the list contains the views you intended. Reduce to a single known-good image to isolate whether one bad entry is poisoning the request.
Unusable or low-quality output. If the call succeeds but the mesh is wrong, the problem is usually the input set. Check that all images show the same object, from genuinely different angles, with consistent orientation. Remove duplicates and near-duplicates—they add no information and can confuse reconstruction. Very low-resolution images are also a common culprit.
Timeouts and retries. Distinguish between your client timeout and a remote processing delay. If your client gives up while the job is still running, retrying can create duplicate jobs and duplicate charges, since generation is billed by the work performed. Retry only after confirming the original job's status, and cap retries with exponential backoff.
Silent field mismatches. If your parser breaks on a successful response, print the raw body. Do not code against assumed field names; the actual schema is the source of truth.
Where to go next
You now have a request you can run, a Python function you can drop into a service, and a debugging checklist for the failures that actually occur. The next step is to move the call behind your own job queue, store assets durably, and add observability around latency and failure rates before you put it in front of users.
For the full parameter list and current capabilities, see the meshy-7.1/multi-image-to-3d model page. Start with one well-curated image set end to end, then scale the pipeline once the result is predictable.
Related articles
View all articles →-
Tutorial
Meshy-6 Text-to-3D in Practice: 5 High-Value Application Scenarios and Integration Essentials
-
Tutorial
meshy-6/image-to-3d in practice: 5 high-value use cases and key implementation points
From one image to a usable 3D asset: a cross-cutting view of cost, quality, and engineering integration
-
Tutorial
ltx-2.5-fast/audio-to-video in Practice: 5 Practical Audio-Driven Video Scenarios
A scenario-selection and implementation checklist for developers, from API integration to cost estimation