Getting started
Create a sandbox key and run your first job from this page.
Live keys spend prepaid API credits. The request shape does not change when you switch from sk_test_ to sk_live_.
See Guides for complete examples.
Authenticated endpoints take a Bearer secret. Sandbox keys start with sk_test_. Live keys start with sk_live_.
Authorization: Bearer sk_test_your_sandbox_keyUse https://api.goonify.ai. Create and poll jobs on /api/v2.
https://api.goonify.aiSandbox keys are free. They validate your request and return example completed results without spending credits.
Use a sandbox key to test webhooks, polling, and errors. Use a live key for production jobs.
Use the official Python or TypeScript SDK instead of writing HTTP by hand. Both wrap models, jobs, files, characters, polling, and webhook verification.
Install from the Goonify repository. Sandbox keys (sk_test_) return example media. Live keys (sk_live_) spend prepaid credits.
pip install "goonify @ git+https://github.com/Goonify/goonify.git#subdirectory=sdks/python"
npm install github:Goonify/goonify#main:sdks/typescriptclient.run(model, input) creates a job and waits until it completes. Failed and cancelled jobs raise GoonifyError with the public error.code.
from goonify import Goonify
client = Goonify() # GOONIFY_API_KEY
job = client.run(
"goonify/flux2",
input={"prompt": "a woman standing in a sunlit studio, photorealistic"},
)
print(job.output.url)import { Goonify } from '@goonify/sdk'
const client = new Goonify() // GOONIFY_API_KEY
const job = await client.run('goonify/flux2', {
input: { prompt: 'a woman standing in a sunlit studio, photorealistic' },
})
console.log(job.output?.url)Recent changes to the Goonify API.
Browse by task. Text to image, image to image, and image to video are the base models. Image presets, video presets, and tools are separate lists. Pass one of these ids to POST /v2/jobs.
Each card shows the public id, list price, and required inputs. Create a job with POST /v2/jobs.
GET /v2/models/{id}/schema is the input contract. POST /v2/models/{id}/estimate returns the same price create will charge, plus the current queue wait.
GET /v2/models?task= filters one list: t2i, i2i, t2v, i2v, image-preset, video-preset, or tool. Volume rates and refunds are on the pricing page.
GET /v2/models returns models, presets, and tools together. counts.models, counts.presets, and counts.tools are the true sizes. The length of data is the catalog size, not the model count.
0 live models
OpenAPIText to image. POST /v2/jobs or POST /v2/t2i with input.prompt. Flux 2, Pony, Krea 2, Illustrious, and Z-Image do not take a photo. Seedream can take reference photos on the same model. Every model for this task is listed below with its price.
Poll GET /v2/jobs/{id} until status is completed, then download output.url. Optional seed and negative_prompt are supported on the studio image models. Sandbox keys are free and return an example result.
{
"model": "goonify/flux2",
"input": {
"prompt": "a woman standing in a sunlit studio, photorealistic"
}
}0 models
OpenAPIImage to image is Flux 2 and Seedream. POST /v2/jobs or POST /v2/i2i. Flux 2 needs goonify/flux2, input.prompt, and input.image_url, at the Flux 2 text to image price. Seedream takes input.prompt plus input.image_url or input.reference_images. The hold depends on the Seedream model and the size.
POST /v2/i2i accepts the same body as POST /v2/jobs. Image presets are a different list. Flux 2 presets take a photo or a character. Pony, Krea 2, and Illustrious take a character.
{
"model": "goonify/flux2",
"input": {
"prompt": "a woman standing in a sunlit studio, photorealistic",
"image_url": "https://cdn.goonify.ai/examples/input.jpg"
}
}0 models
OpenAPIText to video. POST /v2/jobs. Every model for this task is listed below with what to send and the price.
Wan 3.0 is priced per second of the new clip, plus the length of any reference video. The reference is not attached to the result. 480p is $0.125, 720p is $0.25, and 1080p is $0.50. A 5 second 1080p clip is $2.50. Wan 3.0 Prime is faster: 480p is $0.17, 720p is $0.35, and 1080p is $0.70 per second. Duration is 2 to 30 seconds, or -1 to let the model choose. Sound on or off is the same price. Failed jobs are refunded. You can set ratio, seed, and prompt_extend. Keyframe photos and reference media cannot be combined. Seedance lists a 5 second clip. A longer clip costs more. The finished job is billed from the tokens the clip used, and never more than the hold for that length. Sound does not change that rate. A failed Seedance job is refunded.
{
"model": "goonify/wan-3.0",
"input": {
"prompt": "a woman standing in a sunlit studio, photorealistic",
"resolution": "720p",
"duration": 5
}
}A photo with no prompt is on Image to video. That page lists every image-to-video model.
0 models
OpenAPIImage to video. POST /v2/jobs or POST /v2/i2v. Every model for this task is listed below with what to send and the price.
POST /v2/i2v accepts the same body as POST /v2/jobs. Video presets are styled looks on their own page.
{
"model": "goonify/wan22",
"input": {
"image_url": "https://cdn.goonify.ai/examples/input.jpg"
}
}0 models
OpenAPIImage presets return a styled photo. Pass input.model to pick Flux 2, Pony, Krea 2, or Illustrious. The default is Flux 2. Flux 2 takes input.image_url or input.character. Pony, Krea 2, and Illustrious take input.character. Do not send input.prompt. Six couple presets also require input.image_url_2.
On Flux 2, leave pose_ready false unless the person in the photo is already in the pose. Set it to true only when they already are. Other image models ignore pose_ready. Create with POST /v2/jobs or POST /v2/i2i and a goonify/presets id.
Flux 2 edits the photo. Leave pose_ready false unless the person is already in the pose. Set it to true only when they already are.
No presets in this group.
Loading presets…
Video presets take a photo and return a styled clip. Send input.image_url. Do not send input.prompt.
Wan 3.0 presets are priced by length and resolution. 720p is $0.25 a second. Lengths are 10, 15, and 30 seconds. A 10 second 720p preset is $2.50. Other video presets stay a flat price. Leave pose_ready false unless the person in the photo is already in the pose. Set it to true only when they already are. Create with POST /v2/jobs or POST /v2/i2v.
Loading presets…
Tools are separate from image models, video models, and presets.
Every tool is listed below with what it accepts. POST /v2/jobs. Faceswap also has POST /v2/faceswap. Enhance also has POST /v2/upscale.
{
"model": "goonify/faceswap",
"input": {
"image_url": "https://cdn.goonify.ai/examples/input.jpg",
"face_image_url": "https://cdn.goonify.ai/examples/input.jpg"
}
}0 models
OpenAPICreate a job with POST /v2/jobs. Pass model and input. Each guide lists every model for that task and what it accepts.
Aliases POST /v2/t2i, /v2/i2i, /v2/i2v, /v2/faceswap, and /v2/upscale accept the same body. Poll GET /v2/jobs/{id} or wait for the webhook. webhook_url and callback_url are the same callback.
Queued jobs include estimated_wait_seconds. POST /v2/jobs/{id}/cancel refunds a queued job. Processing jobs cannot be cancelled.
{
"model": "goonify/presets/missionary",
"input": {
"image_url": "https://cdn.goonify.ai/examples/input.jpg"
}
}If you cannot host an image, POST /v2/files. Send a multipart file field, or JSON with a public url. The response url works as image_url, face_image_url, or video_url for 24 hours.
GET /v2/files/{id} returns a freshly signed CDN link. Expired files return 404.
{
"url": "https://cdn.goonify.ai/examples/input.jpg"
}Create a character with goonify/create-character, then pass input.character on later jobs. Required fields are name, family (realistic or anime), and ethnicity.
Poll GET /v2/characters/{id} until status is ready. Then POST /v2/jobs with a preset or video model and input.character. Do not send image_url in the same request.
List your characters with GET /v2/characters. Delete one with DELETE /v2/characters/{id}. Generate a new preview with POST /v2/characters/{id}/regenerate. Regenerating charges the same create-character price.
Optional model picks the engine. Realistic accepts goonify/krea2 (Krea 2, the default), goonify/zit (Z-Image), goonify/flux2, and goonify/pony. Anime accepts goonify/illustrious, which is also the default. Leave model out to use that default. Regenerating without model keeps the engine you created with. The price stays $0.10.
{
"model": "goonify/create-character",
"input": {
"name": "Ava",
"family": "realistic",
"ethnicity": "white",
"model": "goonify/flux2",
"appearance": {
"hair_style": "long",
"hair_color": "blonde",
"eye_color": "blue"
}
}
}{
"model": "goonify/presets/missionary",
"input": {
"character": "char_42"
}
}GET /api/v2/models
Returns the live catalog. counts.models, counts.presets, and counts.tools are the true sizes. The length of data is not the model count. Filter with kind or task. No authentication required.
kindstringOptional
foundation, preset, or tool.
modalitystringOptional
image or video.
taskstringOptional
t2i, i2i, t2v, i2v, image-preset, video-preset, or tool. Image presets are not included in t2i. Video presets are not included in i2v.
statusstringOptional
Only live catalog rows are returned.
POST /api/v2/jobs
Queue a job for any live model id from GET /v2/models. Text to image needs a prompt. Image to image, video, presets, faceswap, and enhance need the matching input URLs or a character id. Create character needs name, family, and ethnicity. Sandbox keys return an example result without spending credits.
AuthorizationstringRequired
Bearer sk_test_… or sk_live_…
Idempotency-KeystringOptional
Optional unique key so retries do not create a second job.
modelstringRequired
Public model id from GET /v2/models. Examples: goonify/flux2, goonify/wan22, goonify/presets/missionary, goonify/create-character, goonify/faceswap, goonify/enhance.
inputobjectRequired
Generation input. Use prompt for text to image. Add image_url or character for image to image, video, and presets. Create character uses name, family, and ethnicity. Faceswap also needs face_image_url. Dual-image presets need image_url_2.
webhook_urlstringOptional
HTTPS URL called when the job completes or fails.
GET /api/v2/models/{model_id}
Returns one catalog model card: public id, price, modality, and input requirements.
model_idstringRequired
Public model id, for example goonify/flux2.
GET /api/v2/models/{model_id}/schema
JSON Schema for the input object POST /v2/jobs accepts for this model.
model_idstringRequired
Public model id, for example goonify/flux2.
POST /api/v2/models/{model_id}/estimate
Returns the USD cost and current queue wait. Does not create a job or deduct credits.
model_idstringRequired
Public model id, for example goonify/flux2.
GET /api/v2/jobs/{id}
Poll any v2 job. Completed jobs include output.url on the CDN. Accepts gen_18402 or the numeric id.
AuthorizationstringRequired
Bearer sk_test_… or sk_live_…
idstringRequired
Job id from POST /v2/jobs, for example gen_18402.
GET /api/v2/jobs
List your jobs, newest first. Filter by status and page with starting_after.
AuthorizationstringRequired
Bearer sk_test_… or sk_live_…
statusstringOptional
queued, processing, completed, failed, or cancelled.
limitintegerOptional
Number of jobs to return. Default 20, maximum 100.
starting_afterstringOptional
Public job id to page after, for example gen_18402.
POST /api/v2/jobs/{id}/cancel
Cancel a queued job and refund credits. Jobs that are already processing cannot be cancelled.
AuthorizationstringRequired
Bearer sk_test_… or sk_live_…
idstringRequired
Job id from POST /v2/jobs, for example gen_18402.
POST /api/v2/files
Host an image or video for 24 hours and get a CDN URL you can pass as image_url, face_image_url, or video_url. Send multipart field file, or JSON with a public url.
AuthorizationstringRequired
Bearer sk_test_… or sk_live_…
urlstringOptional
Public HTTPS image or video URL to ingest. Omit when uploading multipart file.
GET /api/v2/files/{id}
Returns file metadata and a freshly signed CDN URL. Expired files return 404.
AuthorizationstringRequired
Bearer sk_test_… or sk_live_…
idstringRequired
File id from POST /v2/files, for example file_4f2c1a9e0b3d4e5f6a7b8c9d0e1f2a3b.
POST /api/v2/characters
Create a reusable character. Returns a job. Poll GET /v2/characters/{id} until status is ready, then pass input.character on a later job.
AuthorizationstringRequired
Bearer sk_test_… or sk_live_…
Idempotency-KeystringOptional
Optional unique key so retries do not create a second job.
namestringRequired
Display name, 2 to 80 characters.
familystringRequired
realistic or anime.
ethnicitystringRequired
asian, black, white, latina, arab, indian, elf, alien, demon, or custom.
appearanceobjectOptional
Optional hair, eyes, body, and similar appearance fields.
promptstringOptional
Optional extra appearance notes.
modelstringOptional
Optional Create engine. Realistic: goonify/krea2 (default), goonify/zit, goonify/flux2, goonify/pony. Anime: goonify/illustrious (default).
webhook_urlstringOptional
HTTPS URL called when the preview job completes or fails.
GET /api/v2/characters/{character_id}
Returns the character status and preview_url when ready. Pass the same id as input.character on POST /v2/jobs.
AuthorizationstringRequired
Bearer sk_test_… or sk_live_…
character_idstringRequired
Public character id, for example char_42.
GET /api/v2/characters
List characters you own, newest first. Includes drafts still generating. Page with starting_after.
AuthorizationstringRequired
Bearer sk_test_… or sk_live_…
limitintegerOptional
Number of characters to return. Default 20, maximum 100.
starting_afterstringOptional
Public character id to page after, for example char_42.
POST /api/v2/characters/{character_id}/regenerate
Queue a new preview for an existing character. Reuses the stored name, family, ethnicity, appearance, and model unless you override them. Charges the same create-character price.
AuthorizationstringRequired
Bearer sk_test_… or sk_live_…
Idempotency-KeystringOptional
Optional unique key so retries do not create a second job.
character_idstringRequired
Public character id, for example char_42.
namestringOptional
Optional new display name, 2 to 80 characters.
familystringOptional
Optional new family: realistic or anime.
ethnicitystringOptional
Optional new ethnicity. Same values as create.
appearanceobjectOptional
Optional appearance overrides merged onto the existing character.
promptstringOptional
Optional extra appearance notes.
modelstringOptional
Optional new Create engine. Leave it out to keep the engine used at create. It must match the family.
webhook_urlstringOptional
HTTPS URL called when the preview job completes or fails.
DELETE /api/v2/characters/{character_id}
Permanently delete a character you own, including its preview.
AuthorizationstringRequired
Bearer sk_test_… or sk_live_…
character_idstringRequired
Public character id, for example char_42.
GET /api/v1/usage/summary
Credits balance plus today, week, and month job counts for the authenticated key.
AuthorizationstringRequired
Bearer sk_test_… or sk_live_…
GET /api/v1/usage/history
Recent job spend for the authenticated key.
AuthorizationstringRequired
Bearer sk_test_… or sk_live_…
Pass webhook_url on create. We POST the same JSON as GET /v2/jobs/{id}: id, object, status, model, input, output.url, error, and cost. Failed jobs include a stable error object.
{
"id": "gen_18402",
"object": "job",
"status": "completed",
"model": "goonify/flux2",
"input": {
"prompt": "a woman standing in a sunlit studio, photorealistic"
},
"output": {
"url": "https://cdn.goonify.ai/results/18402/result.webp"
},
"error": null,
"cost": {
"usd": 0.06
}
}Every delivery includes X-Goonify-Signature: t=<unix_seconds>,v1=<hex>. The signed payload is timestamp + "." + raw body with HMAC-SHA256 and your dashboard signing secret. Reject timestamps older than 5 minutes.
import hmac, hashlib, time
def verify_goonify_webhook(payload: bytes, header: str, secret: str, tolerance=300):
parts = dict(p.split("=", 1) for p in header.split(","))
timestamp = int(parts["t"])
expected = hmac.new(
secret.encode(),
f"{timestamp}.".encode() + payload,
hashlib.sha256,
).hexdigest()
if not hmac.compare_digest(expected, parts["v1"]):
raise ValueError("invalid signature")
if abs(time.time() - timestamp) > tolerance:
raise ValueError("timestamp too old")HTTP 2xx is success. Failed attempts retry after 1 second, 10 seconds, 60 seconds, 10 minutes, and 1 hour. Delivery history is on the developer dashboard.
The official SDKs expose verify_webhook in Python and verifyWebhookAsync in TypeScript.
Send Idempotency-Key on create endpoints so network retries do not double-charge. Keys are scoped to your API key and stored for 24 hours. Use a UUID per logical job.
A completed job returns output.url. That link is a viewable image or video.
The job response does not include encryption metadata. Download output.url. Never log or share your secret key.
Error responses include error.code, a short message, and a retryable flag.
| Code | Meaning |
|---|---|
| 400 | Invalid request body or URL |
| 401 | Invalid or missing API key |
| 402 | Insufficient credits |
| 403 | Account banned or job belongs to another key |
| 404 | Job not found |
| 409 | Idempotency conflict or request already in progress |
| 429 | Rate limit exceeded |
| 500 | Internal error |
Limits are per API key, per minute. Sandbox keys have higher limits.
| Endpoint | Live | Sandbox |
|---|---|---|
| POST /v2/jobs | 100 / min | 300 / min |
| POST /v2/t2i, /i2i, /i2v, /faceswap, /upscale | 100 / min | 300 / min |
| POST /v2/jobs/{id}/cancel | 100 / min | 300 / min |
| POST /v2/characters | 100 / min | 300 / min |
| POST /v2/characters/{id}/regenerate | 100 / min | 300 / min |
| GET /v2/characters | 100 / min | 300 / min |
| GET /v2/characters/{id} | 600 / min | 1000 / min |
| POST /v2/files | 60 / min | 120 / min |
| GET /v2/jobs/{id} | 600 / min | 1000 / min |
| GET /v2/jobs | 100 / min | 300 / min |
| GET /v2/models | 300 / min | 1000 / min |
| GET /usage/* | 300 / min | 500 / min |