Getting Your API Key and First Setup
Before you can make your first API call, you need two things: an API key and the client library installed. Let's get both set up.
Creating Your API Key
Your API key is like a password that identifies your account when making API requests. Here's how to get one:
- Log in to your PrintPal account at https://printpal.io
- Navigate to the API Keys page at https://printpal.io/api-keys
- Click "Create New API Key"
- Give it a descriptive name (like "my-first-key" or "batch-processing")
- Copy the key that appears - it will start with
pp_live_
Important: Treat your API key like a password. Don't share it publicly, don't commit it to a public code repository, and don't paste it into chat messages. Anyone with your key can use your credits.
Installing the Client Library
Open your terminal and install the library for your language:
Python:
1 | |
JavaScript/TypeScript:
1 | |
That's it. The libraries have minimal dependencies and install quickly.
Setting Your API Key
The recommended way to provide your API key is through an environment variable. This keeps it out of your code:
macOS/Linux (terminal):
1 | |
Windows (Command Prompt):
1 | |
Windows (PowerShell):
1 | |
When the environment variable is set, the client library will pick it up automatically. You can also pass the key directly in your code (useful for testing, but less secure for production):
Python:
1 2 3 | |
JavaScript/TypeScript:
1 2 3 | |
Your First Connection Test
Let's verify everything is working by checking your credit balance and the API health. This is a great "hello world" for the API.
Python:
1 2 3 4 5 6 7 8 9 10 11 12 | |
JavaScript/TypeScript:
1 2 3 4 5 6 7 8 9 10 11 12 | |
If you see your credit balance and username printed, everything is connected and working. If you get an AuthenticationError, double-check that your API key is correct and that the environment variable is set.
Understanding Credits and Pricing
Every 3D generation costs credits. The cost depends on the quality level you choose:
| Quality | Resolution | Credits | Estimated Time | Texture Support |
|---|---|---|---|---|
| default | 256 cubed | 4 | ~20 seconds | No |
| high | 384 cubed | 6 | ~30 seconds | No |
| ultra | 512 cubed | 8 | ~60 seconds | No |
| super | 768 cubed | 20 | ~3 minutes | No |
| super_texture | 768 cubed | 40 | ~6 minutes | Yes (GLB, OBJ) |
| superplus | 1024 cubed | 30 | ~4 minutes | No |
| superplus_texture | 1024 cubed | 50 | ~12 minutes | Yes (GLB, OBJ) |
You can also fetch this information programmatically:
Python:
1 2 3 | |
JavaScript/TypeScript:
1 2 3 4 | |
You can purchase additional credits at https://printpal.io/buy-credits.
Rate Limits
The API has rate limits to ensure fair usage:
- 50 requests per minute per API key
- 10,000 requests per day per account
- 5 concurrent generations maximum
For most use cases, these limits are more than sufficient. If you hit a rate limit, the API returns a 429 status code with a Retry-After header, and the client library raises a RateLimitError with the retry delay.