API Reference
API reference
Every endpoint, in one place.
Base URL: https://app.piernode.com
Every endpoint takes Authorization: Bearer pn_... except the two
public ones. See
Authentication.
A machine-readable OpenAPI document for everything below is served at
https://app.piernode.com/api/spec.json,
with a browsable version at
/api/docs.
Generation
| Method | Path | Description |
|---|---|---|
POST | /api/v1/images/generations | Text to image |
POST | /api/v1/images/transformations | Image to image |
POST | /api/v1/videos/generations | Text to video |
POST | /api/v1/videos/transformations | Image to video |
The two transformation endpoints also accept effectId in place of a prompt —
see effects.
All four return a task immediately and reserve the cost. Poll for the result.
All four accept an optional Idempotency-Key header, which makes a submission
safe to retry — see idempotency. It is
not accepted anywhere else, because nowhere else spends money.
Public
No key, no account.
| Method | Path | Description |
|---|---|---|
GET | /api/v1/pricing | Current rates. See pricing. |
GET | /api/v1/effects | The effect catalogue. ?surface=image or ?surface=video narrows it. |
Tasks
| Method | Path | Description |
|---|---|---|
GET | /api/v1/tasks/\{taskId\} | Poll a task. Not billed. |
POST | /api/v1/tasks/\{taskId\}/cancel | Cancel a queued task. |
Uploads
| Method | Path | Description |
|---|---|---|
POST | /api/v1/uploads | Reserve an upload, get a URL to PUT to. |
POST | /api/v1/uploads/\{assetId\}/complete | Verify the bytes and make the upload usable. |
GET | /api/v1/uploads/\{assetId\} | Read an upload's state. |
Not billed. See Uploading an image.
Account
| Method | Path | Description |
|---|---|---|
GET | /api/v1/me | Your account id, balance and currency. |
curl https://app.piernode.com/api/v1/me \
-H "Authorization: Bearer $PIERNODE_API_KEY"{
"id": "the-account-id",
"balance": "100.000000",
"currency": "USD"
}Conventions
Shared by every endpoint:
- Request bodies are JSON, limited to 64 KB. Unknown fields are ignored.
- Amounts are exact decimal strings, never floating-point numbers.
- Timestamps are ISO 8601 in UTC.
- Ids are opaque strings. Task ids are 24 lowercase alphanumeric characters and upload ids are 32 hex characters today, but treat both as opaque text of up to 64 characters rather than parsing or sizing to the current format.
- Enum values are lowercase (
720p,hd,16:9). - Errors carry a status code, a stable
code, a human-readable message and arequestId— see Errors. - Every response carries an
X-Request-Idheader. Send your own to have it echoed back, so your logs and ours line up. - A generation answered from an
Idempotency-KeycarriesIdempotency-Replayed: true. - Generation requests are limited to 60 per minute per account, across all four generation endpoints.