Advanced Usage and Integration Patterns
Now that you've mastered the basics and batch processing, let's look at some advanced patterns that become important when you're integrating the PrintPal API into real applications.
Async Workflows: Submit Now, Download Later
In a web application or background job system, you often don't want to block a request while waiting for a generation to complete. Instead, you submit the generation, save the UID, and check back later.
Python:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |
This is the pattern you'd use in a web backend: the user's request submits the generation, your response includes the UID, and the frontend polls for status using AJAX or websockets.
Format Inference from File Extension
A nice convenience feature of the Python client is that generate_and_download can infer the output format from the file extension you specify:
1 2 3 4 | |
You can still override this by explicitly passing a format parameter, but for most cases the extension-based inference is the cleanest approach.
Super Resolution: Getting the Best Quality
For the highest quality models, the super and superplus quality levels use a separate, more powerful generation engine. Here are some things to know:
Super resolution requires an image - You cannot use text prompts with super or superplus quality. If you need high-quality text-to-3D, generate with ultra quality first, or generate an image from your text prompt separately and then pass that image to the super resolution API.
Texture support is limited to GLB and OBJ - When using super_texture or superplus_texture, only GLB and OBJ formats are available. OBJ with textures returns as a ZIP archive containing the .obj file, .mtl material file, and texture images.
Longer timeouts - Super resolution takes 3-12 minutes depending on the tier. The client library automatically sets appropriate timeouts based on the quality level, but you can override them:
1 2 3 4 5 6 7 8 | |
Using the Generate-from-Buffer Pattern (JavaScript)
In a web application, you might receive an image as a buffer (from a file upload, for example) rather than a file on disk. The JavaScript client supports this directly:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
Integration Patterns
Here are some common ways developers integrate the PrintPal API into larger systems:
Web Application Backend - Accept image uploads from users, submit to PrintPal API, store the generation UID in your database, and serve the completed model to users when ready.
Cron Job / Scheduled Task - Run a batch script on a schedule (e.g., nightly) that processes new images from a folder, S3 bucket, or database queue.
Webhook-Style - Submit generations, save the UIDs, and periodically poll all pending UIDs to check for completions. Process completed models as they come in.
CI/CD Pipeline - Automatically generate 3D model previews as part of a build or deployment process.
API Endpoints Reference
For developers who want to call the REST API directly (without the client libraries), here are the core endpoints:
| Endpoint | Method | Auth | Description |
|---|---|---|---|
| /api/health | GET | No | Check API health status |
| /api/pricing | GET | No | Get pricing information |
| /api/credits | GET | Yes | Get credit balance |
| /api/usage | GET | Yes | Get usage statistics |
| /api/generate | POST | Yes | Submit a generation (image or text) |
| /api/generate/{uid}/status | GET | Yes | Check generation status |
| /api/generate/{uid}/download | GET | Yes | Get download URL for completed model |
Authentication is done via the X-API-Key header:
1 | |
Full API documentation is available at https://printpal.io/api/documentation.
What's Next?
You now have a solid foundation for working with the PrintPal API. You can:
- Generate 3D models from images and text programmatically
- Handle every error type gracefully
- Process entire folders of images in parallel
- Integrate the API into web apps, scripts, and automation pipelines
- Choose the right quality and format for any use case
- Monitor your credit usage and stay within rate limits
The best way to learn more is to build something. Pick a project - a batch converter, a web tool, an automated pipeline - and start coding. The API documentation at https://printpal.io/api/documentation is always there when you need the details.
Useful Links
API Documentation - https://printpal.io/api/documentation
Get Your API Key - https://printpal.io/api-keys
Buy Credits - https://printpal.io/buy-credits
Python SDK on PyPI - https://pypi.org/project/printpal/
JavaScript SDK on npm - https://www.npmjs.com/package/printpal
Python SDK on GitHub - https://github.com/printpal-io/printpal-python
JavaScript SDK on GitHub - https://github.com/printpal-io/printpal-js
Happy building!