Single-generation jobs
Pricing: all features
Single generations are plain asynchronous batch calls: create a request, poll its status, fetch the result. There is no agent in the loop, so a job renders exactly the parameters you send, on the same render queues as the website. Each job is charged to your credits when it is created, refunded automatically if it fails or is cancelled, and listed in your History on www.happypony.io.
Endpoints (quick reference)
Base URL: https://api.happypony.io. Every request needs Authorization: Bearer hp_….
| Method | Path | Purpose |
|---|---|---|
POST |
/api/v1/jobs/text-to-image |
Create a text-to-image request |
POST |
/api/v1/jobs/text-to-video |
Create a text-to-video request |
POST |
/api/v1/jobs/image-to-video |
Create an image-to-video request |
POST |
/api/v1/jobs/reference-to-video |
Create a reference-to-video request |
POST |
/api/v1/jobs/image-edit |
Create an image-edit request |
POST |
/api/v1/jobs/multi-angle |
Create a multi-angle request |
POST |
/api/v1/jobs/face-swap |
Create a face-swap request |
POST |
/api/v1/jobs/human-portrait |
Create a human-portrait request |
POST |
/api/v1/jobs/voice-design |
Create a voice-design request |
POST |
/api/v1/jobs/character-swap |
Create a character-swap request |
POST |
/api/v1/jobs/background-replace |
Create a background-replace request |
POST |
/api/v1/jobs/uploads |
Upload a local image, video or audio file |
POST |
/api/v1/jobs/enrich-prompt |
Enrich a video prompt without rendering |
GET |
/api/v1/jobs/:requestId/status |
Check status |
GET |
/api/v1/jobs/:requestId |
Fetch the result |
PUT |
/api/v1/jobs/:requestId/cancel |
Cancel a queued request |
Request lifecycle
POSTthe request body to the feature's endpoint. The answer is202with arequest_idand thestatus_url,response_urlandcancel_urlto use next. The credits are taken now.GETthestatus_urlevery 3–10 s untilstatusisCOMPLETED,FAILEDorCANCELLED. There are no webhooks.GETtheresponse_urlfor the result: presigned download URLs plus the parameters the job ran with.
status |
Meaning |
|---|---|
IN_QUEUE |
Waiting for a worker. queue_position and eta_seconds when known. Can be cancelled. |
IN_PROGRESS |
A worker is rendering it. eta_seconds when known. |
COMPLETED |
Done. Fetch the result. |
FAILED |
It did not finish. error says why; the credits are refunded. |
CANCELLED |
Cancelled by you while queued; the credits are refunded. |
Adult content and nsfw. Every create endpoint except uploads and enrich-prompt takes an optional boolean nsfw. The content check runs on every job either way and still refuses anything involving minors (422 content_rejected, reason: "minor").
nsfw |
What happens |
|---|---|
| left out (default) | The content check looks at the prompt and images and picks the model: explicit content is detected automatically and rendered on the adult-content model, everything else on the general one. |
true |
Always render on the adult-content model. Same as Optimize for NSFW on the website. |
false |
Always render on the general model. |
Any other value is 400 invalid_request. On a site that does not allow adult content, nsfw: true is 400 invalid_request and explicit content is refused with 422 content_rejected, reason: "explicit"; leave nsfw out there. Nano Banana models are third-party and ignore nsfw.
Create response
Every create endpoint answers 202 Accepted with the same shape:
{
"request_id": "48213",
"type": "text-to-image",
"status": "IN_QUEUE",
"credits": 4,
"status_url": "https://api.happypony.io/api/v1/jobs/48213/status",
"response_url": "https://api.happypony.io/api/v1/jobs/48213",
"cancel_url": "https://api.happypony.io/api/v1/jobs/48213/cancel"
}
| Field | Type | Description |
|---|---|---|
request_id |
string | Your handle for the job. Use it in the status, result and cancel paths. |
type |
string | text-to-image, text-to-video, image-to-video, reference-to-video, image-edit, multi-angle, face-swap, human-portrait, voice-design or character-swap. |
status |
string | Always IN_QUEUE here. |
credits |
integer | What the job costs, already taken from your balance. Rarely missing, when the charge could not be read back at once; the status response always has it. |
status_url |
string | Poll this for progress. |
response_url |
string | Fetch the result here. |
cancel_url |
string | PUT here to cancel while IN_QUEUE. |
Status response
GET /api/v1/jobs/:requestId/status
curl https://api.happypony.io/api/v1/jobs/48213/status -H "Authorization: Bearer $HP_KEY"
{
"request_id": "48213",
"type": "text-to-image",
"status": "IN_QUEUE",
"created_at": "2026-10-05T10:00:00.000Z",
"completed_at": null,
"credits": 4,
"queue_position": 2,
"eta_seconds": 20,
"status_url": "https://api.happypony.io/api/v1/jobs/48213/status",
"response_url": "https://api.happypony.io/api/v1/jobs/48213",
"cancel_url": "https://api.happypony.io/api/v1/jobs/48213/cancel"
}
| Field | Type | Description |
|---|---|---|
request_id |
string | As in the create response. |
type |
string | The feature. |
status |
string | See Request lifecycle. |
created_at |
string | ISO 8601 time the job was created. |
completed_at |
string | null | ISO 8601 time it finished; null until then. |
credits |
integer | What the job cost. |
queue_position |
integer | Only while IN_QUEUE, when known. 0 is next. |
eta_seconds |
integer | Only while IN_QUEUE or IN_PROGRESS, when known: estimated seconds to completion. |
error |
string | Only when FAILED: why. |
error_code, reason |
string | Only when FAILED because the content check refused a video job after it was accepted (see Errors): error_code is content_rejected and reason is minor or explicit, as on the 422. |
credits_refunded |
boolean | Only when FAILED or CANCELLED: true when the job had a price (those credits are refunded), false for a job that cost nothing. |
status_url, response_url, cancel_url |
string | As in the create response. |
Result response
GET /api/v1/jobs/:requestId. It answers in any state; the files are there once status is COMPLETED.
curl https://api.happypony.io/api/v1/jobs/48213 -H "Authorization: Bearer $HP_KEY"
All the status fields except queue_position and eta_seconds, plus:
| Field | Type | Description |
|---|---|---|
images |
object[] | Image features. One { "url", "format" } per output image; empty until COMPLETED. |
videos |
object[] | text-to-video, image-to-video, reference-to-video and character-swap only, in place of images. One { "url", "format" }; empty until COMPLETED. |
audio |
object[] | voice-design only, in place of images. One { "url", "format" } (mp3) per take; empty until COMPLETED. |
images[].url / videos[].url |
string | Presigned download link, valid for expires_in seconds (72 hours). Only the link expires, not the file: fetch the job again at any time for a fresh one. null in the rare case the link could not be signed; fetch again. |
images[].format / videos[].format |
string | File type: png, jpg, webp, mp4, … |
expires_in |
integer | Only when there are files: link lifetime in seconds (259200). |
parameters |
object | The settings the job ran with, in the request's field names. Per feature below. |
files, dry_run, mask_preview, mask_stats |
Character swap only, see its result. Background replace has stats in place of mask_stats. |
Cancel a request
PUT /api/v1/jobs/:requestId/cancel
curl -X PUT https://api.happypony.io/api/v1/jobs/48213/cancel -H "Authorization: Bearer $HP_KEY"
{ "request_id": "48213", "status": "CANCELLED", "credits_refunded": true }
Only a job still IN_QUEUE can be cancelled; its credits are refunded. Once a worker has picked it up, or the job has already completed or failed, the answer is 409 not_cancellable with the job's status (IN_PROGRESS when the queue refused because rendering had started) and the job finishes normally. Cancelling a job that is already cancelled returns 200 again, with request_id and status only.
Image inputs
Every image field takes a URL:
- an
https://URL on a public host (default port, no credentials), at most 3 redirects; jpg,pngorwebp, at most 20 MB;- or the
urlreturned byPOST /api/v1/jobs/uploadsfor a file on your disk.
Images are downloaded and copied into your private storage when the request is created, so a link only has to work until then; the download must finish within 30 s (45 s for audio, 120 s for video). A URL that can't be used is rejected at once with 400 invalid_media (see Errors) and nothing is charged.
image-to-video and reference-to-video are the exception, so that they answer quickly: the create call only checks each URL (its form, and that the host is public: 400 invalid_media with code invalid_url, blocked or unreachable) and the job reads your URL when it renders. Keep the link working until the job has finished. A file that cannot be downloaded, or is of the wrong type or too large, fails the job (FAILED, credits refunded) instead of the create call.
Upload an image
POST /api/v1/jobs/uploads (multipart/form-data)
| Form field | Required | Description |
|---|---|---|
file |
yes | The file: an image (at most 20 MB), or a video (200 MB) or audio clip (30 MB) for reference to video and character swap. |
kind |
no | image, video or audio. Inferred from the content type (or the extension) when left out or not one of the three. |
curl -X POST https://api.happypony.io/api/v1/jobs/uploads \
-H "Authorization: Bearer $HP_KEY" -F file=@me.png
Response 201:
{ "url": "https://…signed…", "kind": "image", "expires_in": 259200 }
Pass url in any image field (or a reference field of the same kind) within expires_in seconds (72 hours).
A missing or malformed file part is 400 invalid_request; a file of another type or over its size cap is 400 invalid_media with field: "file" and code bad_type or too_large; 502 media_failed means storage refused it, retry.
Errors
Errors are JSON with an error code and a human-readable message; some add fields:
{
"error": "invalid_request",
"message": "duration must be a whole number of seconds from 5 to 15 for short_edge 768 and aspect_ratio 16:9",
"details": ["duration must be a whole number of seconds from 5 to 15 for short_edge 768 and aspect_ratio 16:9"]
}
| Status | error |
When | Extra fields |
|---|---|---|---|
| 400 | invalid_request |
Bad JSON, unknown field, missing or out-of-range value. Values are never silently replaced by defaults. | details: every problem (absent for bad JSON and upload errors) |
| 400 | invalid_media |
An image URL or upload can't be used. | field (e.g. image_urls[1]), code: invalid_url, blocked, unreachable, http_error, bad_type, too_large |
| 401 | unauthorized |
Missing, wrong or revoked API key. | |
| 402 | insufficient_credits |
Balance below the job's price. | required, available |
| 404 | not_found |
No such job, or it is not yours. | |
| 409 | not_cancellable |
Cancel on a job that is already running or finished. | status |
| 422 | content_rejected |
The content check refused the prompt or images. Nothing is charged. The video endpoints (text-to-video, image-to-video, reference-to-video) run the check after the create call has answered 202: there a refusal is the job ending FAILED with error_code: "content_rejected" and the same reason in its status, and the credits are refunded. |
reason: minor or explicit |
| 502 | gateway_submit_failed |
The job could not be queued, or no price is configured for it. Nothing is charged (or the charge is refunded); retry. | |
| 502 | media_failed |
An image could not be stored. Nothing is charged; retry. |