{"openapi": "3.1.0", "info": {"title": "estateclip.ai API", "version": "1", "description": "Motion videos from real estate photos. Send your API key as `Authorization: Bearer ec_\u2026`. All texts in responses are English; act on `error.code`. Guides and examples: [api.estateclip.ai/docs/](/docs/)."}, "paths": {"/v1/health": {"get": {"operationId": "_core_api_health", "summary": "Service health", "parameters": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HealthOut"}}}}}, "description": "Reports that the API answers. Does not check the database or Modal.", "tags": ["health"]}}, "/v1/uploads": {"post": {"operationId": "generations_api_create_upload", "summary": "Upload a photo or an overlay", "parameters": [], "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UploadOut"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "413": {"description": "Request Entity Too Large", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "422": {"description": "Unprocessable Entity", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}, "description": "One JPEG, PNG or WebP photo of at most 50 MB as `multipart/form-data`, field `file`.\n\nPass the returned `id` in `images` of a generation within 7 days, or, for a PNG, as `overlay.url`. The type is\ntaken from the file's content, not from its name. Whether a photo is large enough for the chosen resolution is\nchecked per clip, an overlay's size before any clip is rendered.", "tags": ["uploads"], "requestBody": {"content": {"multipart/form-data": {"schema": {"properties": {"file": {"format": "binary", "title": "File", "type": "string"}}, "required": ["file"], "title": "FileParams", "type": "object"}}}, "required": true}, "security": [{"ApiKeyAuth": []}]}}, "/v1/generations": {"post": {"operationId": "generations_api_create_generation", "summary": "Create a generation", "parameters": [{"in": "header", "name": "Idempotency-Key", "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Idempotency-Key"}, "required": false}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GenerationOut"}}}}, "202": {"description": "Accepted", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GenerationOut"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "402": {"description": "Payment Required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "413": {"description": "Request Entity Too Large", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "422": {"description": "Unprocessable Entity", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "503": {"description": "Service Unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}, "description": "One clip per image, in the order of `images`. Answers 202 for a new generation.\n\nEach image is an upload ID or an HTTPS URL on port 443 pointing at a public address. Photos behind URLs\nare fetched before any clip starts (`stage` is `fetching`), at most 50 MB each, following up to three\nredirects; a photo that cannot be fetched or used fails its clip (`fetch_failed`, `image_too_large`,\n`invalid_image`). With `compose`, an `overlay` PNG of exactly `width` \u00d7 `height` pixels lies on the final at\n`x`, `y`, within the frame of the resolution; its `url` is an HTTPS URL or an upload ID, and it is checked before\nany clip renders (`invalid_overlay`).\n\nWith `compose`, the final is cut once every clip has ended (`stage` is `composing`) from the clips that\nsucceeded, in the order of `images`. It needs at least two of them; if it cannot be made, the generation still\ncompletes with its clips and names the reason in `compose_error`.\n\nWith a `webhook_url` (HTTPS on port 443, a public address), the end of the generation is announced there with a\nsigned POST, at least once; see the webhook guide.\n\nSend an `Idempotency-Key` so that a retried request cannot create (and bill) a second generation:\nthe same key with the same body answers 200 with the generation created first, the same key with\na different body answers 409.\n\nThe estimated charge (`charge.estimated_cents`, the price if every clip succeeds) is set aside from your balance\nat once; when the generation ends, it is charged for what was made and the rest is given back. A balance that does\nnot cover the estimate answers 402 `insufficient_balance` and creates nothing; the same `Idempotency-Key` can be\nsent again once you have added credit.", "tags": ["generations"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/GenerationIn"}}}, "required": true}, "security": [{"ApiKeyAuth": []}]}, "get": {"operationId": "generations_api_list_generations", "summary": "List generations", "parameters": [{"in": "query", "name": "status", "schema": {"anyOf": [{"$ref": "#/components/schemas/GenerationStatus"}, {"type": "null"}]}, "required": false}, {"in": "query", "name": "limit", "schema": {"default": 20, "maximum": 100, "minimum": 1, "title": "Limit", "type": "integer"}, "required": false}, {"in": "query", "name": "offset", "schema": {"default": 0, "maximum": 10000000, "minimum": 0, "title": "Offset", "type": "integer"}, "required": false}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GenerationListOut"}}}}, "422": {"description": "Unprocessable Entity", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}, "description": "The workspace's generations, newest first, `limit` per page from `offset` on.", "tags": ["generations"], "security": [{"ApiKeyAuth": []}]}}, "/v1/generations/{generation_id}": {"get": {"operationId": "generations_api_get_generation", "summary": "Get a generation", "parameters": [{"in": "path", "name": "generation_id", "schema": {"title": "Generation Id", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GenerationOut"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}, "description": "Status, progress and fresh download links in `outputs`: one per finished clip, and the final last\n(`kind` `final`, `image_index` null) once it is cut.", "tags": ["generations"], "security": [{"ApiKeyAuth": []}]}, "delete": {"operationId": "generations_api_delete_generation", "summary": "Delete a generation", "parameters": [{"in": "path", "name": "generation_id", "schema": {"title": "Generation Id", "type": "string"}, "required": true}], "responses": {"204": {"description": "No Content"}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}, "description": "Delete a generation that has completed or failed: its photos, clips and final, and the photo and overlay URLs.\nA generation that is still running answers 409 `generation_running`.\n\nAfterwards the generation answers 404 and leaves the list; a webhook not yet delivered is dropped. The files are\nusually gone within minutes, are removed once more about an hour after the generation ended, and expire after 7\ndays at the latest. An upload used by this generation, as a photo or as its overlay, is deleted with it unless\nanother generation still uses it.", "tags": ["generations"], "security": [{"ApiKeyAuth": []}]}}, "/v1/prices": {"get": {"operationId": "billing_api_get_prices", "summary": "Get prices", "parameters": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PricesOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}, "description": "What a generation created now costs this workspace, in euro cents per output second, with the workspace's\n`discount` already applied. A generation keeps the prices it was created with.\n\nThe charge is the output seconds times the rate of the resolution, plus `compose_cents_per_second` if the\ngeneration has a final and `music_cents_per_second` if it has music, rounded half up to whole cents once per\ngeneration. Rates are decimal text; they are `null` while no prices are set.", "tags": ["prices"], "security": [{"ApiKeyAuth": []}]}}, "/v1/balance": {"get": {"operationId": "billing_api_get_balance", "summary": "Get balance", "parameters": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BalanceOut"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "429": {"description": "Too Many Requests", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}, "description": "The workspace's balance in euro cents, as a new generation can use it: the estimated charge of every running\ngeneration is already set aside. A generation whose estimate is more than `available_cents` is refused with 402\n`insufficient_balance`. Use it to warn your users before the balance runs out.", "tags": ["balance"], "security": [{"ApiKeyAuth": []}]}}}, "components": {"schemas": {"HealthOut": {"properties": {"status": {"const": "ok", "title": "Status", "type": "string"}}, "required": ["status"], "title": "HealthOut", "type": "object"}, "UploadOut": {"properties": {"id": {"title": "Id", "type": "string"}, "content_type": {"title": "Content Type", "type": "string"}, "size_bytes": {"title": "Size Bytes", "type": "integer"}, "expires_at": {"format": "date-time", "title": "Expires At", "type": "string"}}, "required": ["id", "content_type", "size_bytes", "expires_at"], "title": "UploadOut", "type": "object"}, "ErrorDetailOut": {"properties": {"code": {"title": "Code", "type": "string"}, "message": {"title": "Message", "type": "string"}, "field": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Field"}}, "required": ["code", "message", "field"], "title": "ErrorDetailOut", "type": "object"}, "ErrorResponse": {"description": "What every error under /v1/ looks like.", "properties": {"error": {"$ref": "#/components/schemas/ErrorDetailOut"}}, "required": ["error"], "title": "ErrorResponse", "type": "object"}, "ChargeOut": {"properties": {"currency": {"const": "EUR", "title": "Currency", "type": "string"}, "estimated_cents": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Estimated Cents"}, "charged_cents": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Charged Cents"}}, "required": ["currency", "estimated_cents", "charged_cents"], "title": "ChargeOut", "type": "object"}, "ClipOut": {"properties": {"index": {"title": "Index", "type": "integer"}, "status": {"$ref": "#/components/schemas/GenerationStatus"}, "error": {"anyOf": [{"$ref": "#/components/schemas/ErrorOut"}, {"type": "null"}]}}, "required": ["index", "status", "error"], "title": "ClipOut", "type": "object"}, "ErrorOut": {"properties": {"code": {"title": "Code", "type": "string"}, "message": {"title": "Message", "type": "string"}}, "required": ["code", "message"], "title": "ErrorOut", "type": "object"}, "GenerationOut": {"properties": {"id": {"title": "Id", "type": "string"}, "status": {"$ref": "#/components/schemas/GenerationStatus"}, "stage": {"anyOf": [{"$ref": "#/components/schemas/Stage"}, {"type": "null"}]}, "resolution": {"$ref": "#/components/schemas/Resolution"}, "clip_seconds": {"title": "Clip Seconds", "type": "integer"}, "compose": {"title": "Compose", "type": "boolean"}, "transition": {"$ref": "#/components/schemas/Transition"}, "music": {"anyOf": [{"type": "boolean"}, {"$ref": "#/components/schemas/MusicFolder"}], "title": "Music"}, "overlay": {"anyOf": [{"$ref": "#/components/schemas/OverlayOut"}, {"type": "null"}]}, "progress": {"$ref": "#/components/schemas/ProgressOut"}, "clips": {"items": {"$ref": "#/components/schemas/ClipOut"}, "title": "Clips", "type": "array"}, "outputs": {"items": {"$ref": "#/components/schemas/OutputOut"}, "title": "Outputs", "type": "array"}, "output_seconds": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Output Seconds"}, "charge": {"$ref": "#/components/schemas/ChargeOut"}, "expires_at": {"format": "date-time", "title": "Expires At", "type": "string"}, "expired": {"title": "Expired", "type": "boolean"}, "error": {"anyOf": [{"$ref": "#/components/schemas/ErrorOut"}, {"type": "null"}]}, "compose_error": {"anyOf": [{"$ref": "#/components/schemas/ErrorOut"}, {"type": "null"}]}, "created_at": {"format": "date-time", "title": "Created At", "type": "string"}}, "required": ["id", "status", "stage", "resolution", "clip_seconds", "compose", "transition", "music", "overlay", "progress", "clips", "outputs", "output_seconds", "charge", "expires_at", "expired", "error", "compose_error", "created_at"], "title": "GenerationOut", "type": "object"}, "GenerationStatus": {"description": "The same four values for a generation and for each of its clips.", "enum": ["queued", "processing", "completed", "failed"], "title": "GenerationStatus", "type": "string"}, "MusicFolder": {"description": "The folders of the music library. A partner names one in `music` to get a random title from it.\n\nThe same names are the storage prefixes music/<folder>/. A new folder needs a member here and its titles\nuploaded with tools/music_library.py; the API refuses every other name.", "enum": ["alternative", "ambient", "blues", "classical", "electronic", "hip_hop", "pop", "rnb_soul", "rock", "soundtrack"], "title": "MusicFolder", "type": "string"}, "OutputOut": {"properties": {"kind": {"enum": ["clip", "final"], "title": "Kind", "type": "string"}, "url": {"title": "Url", "type": "string"}, "duration_seconds": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Duration Seconds"}, "resolution": {"$ref": "#/components/schemas/Resolution"}, "image_index": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Image Index"}}, "required": ["kind", "url", "duration_seconds", "resolution", "image_index"], "title": "OutputOut", "type": "object"}, "OverlayOut": {"properties": {"url": {"title": "Url", "type": "string"}, "width": {"title": "Width", "type": "integer"}, "height": {"title": "Height", "type": "integer"}, "x": {"title": "X", "type": "integer"}, "y": {"title": "Y", "type": "integer"}}, "required": ["url", "width", "height", "x", "y"], "title": "OverlayOut", "type": "object"}, "ProgressOut": {"properties": {"finished": {"title": "Finished", "type": "integer"}, "total": {"title": "Total", "type": "integer"}}, "required": ["finished", "total"], "title": "ProgressOut", "type": "object"}, "Resolution": {"enum": ["720p", "1080p"], "title": "Resolution", "type": "string"}, "Stage": {"description": "What runs while a generation is processing. Empty in every other status.", "enum": ["fetching", "rendering", "composing"], "title": "Stage", "type": "string"}, "Transition": {"description": "How the clips of a final follow each other. One value for the whole generation.", "enum": ["crossfade", "white_fade", "black_fade", "hard_cut"], "title": "Transition", "type": "string"}, "GenerationIn": {"additionalProperties": false, "description": "The body of POST /v1/generations. Unknown fields are rejected (extra=\"forbid\" is inherited).", "properties": {"resolution": {"$ref": "#/components/schemas/Resolution"}, "clip_seconds": {"default": 4, "maximum": 6, "minimum": 4, "title": "Clip Seconds", "type": "integer"}, "compose": {"default": false, "title": "Compose", "type": "boolean"}, "transition": {"allOf": [{"$ref": "#/components/schemas/Transition"}], "default": "crossfade"}, "music": {"anyOf": [{"type": "boolean"}, {"$ref": "#/components/schemas/MusicFolder"}], "default": false, "title": "Music"}, "overlay": {"anyOf": [{"$ref": "#/components/schemas/Overlay"}, {"type": "null"}]}, "images": {"items": {"type": "string"}, "title": "Images", "type": "array"}, "webhook_url": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Webhook Url"}}, "required": ["resolution", "images"], "title": "GenerationIn", "type": "object"}, "Overlay": {"additionalProperties": false, "description": "One PNG laid over the whole final, in pixels of the chosen resolution, measured from the top left.\n\n`url` is an HTTPS URL or the ID of an upload (`upl_\u2026`) of your workspace. The PNG must be exactly `width` \u00d7\n`height` pixels; it is checked before any clip is rendered.", "properties": {"url": {"title": "Url", "type": "string"}, "width": {"minimum": 1, "title": "Width", "type": "integer"}, "height": {"minimum": 1, "title": "Height", "type": "integer"}, "x": {"minimum": 0, "title": "X", "type": "integer"}, "y": {"minimum": 0, "title": "Y", "type": "integer"}}, "required": ["url", "width", "height", "x", "y"], "title": "Overlay", "type": "object"}, "GenerationListQuery": {"properties": {"status": {"anyOf": [{"$ref": "#/components/schemas/GenerationStatus"}, {"type": "null"}]}, "limit": {"default": 20, "maximum": 100, "minimum": 1, "title": "Limit", "type": "integer"}, "offset": {"default": 0, "maximum": 10000000, "minimum": 0, "title": "Offset", "type": "integer"}}, "title": "GenerationListQuery", "type": "object"}, "GenerationListOut": {"properties": {"items": {"items": {"$ref": "#/components/schemas/GenerationOut"}, "title": "Items", "type": "array"}, "count": {"title": "Count", "type": "integer"}}, "required": ["items", "count"], "title": "GenerationListOut", "type": "object"}, "PricesOut": {"properties": {"currency": {"const": "EUR", "title": "Currency", "type": "string"}, "discount": {"title": "Discount", "type": "integer"}, "resolutions": {"items": {"$ref": "#/components/schemas/ResolutionPriceOut"}, "title": "Resolutions", "type": "array"}, "compose_cents_per_second": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Compose Cents Per Second"}, "music_cents_per_second": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Music Cents Per Second"}}, "required": ["currency", "discount", "resolutions", "compose_cents_per_second", "music_cents_per_second"], "title": "PricesOut", "type": "object"}, "ResolutionPriceOut": {"properties": {"resolution": {"$ref": "#/components/schemas/Resolution"}, "cents_per_second": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Cents Per Second"}}, "required": ["resolution", "cents_per_second"], "title": "ResolutionPriceOut", "type": "object"}, "BalanceOut": {"properties": {"currency": {"const": "EUR", "title": "Currency", "type": "string"}, "available_cents": {"title": "Available Cents", "type": "integer"}}, "required": ["currency", "available_cents"], "title": "BalanceOut", "type": "object"}}, "securitySchemes": {"ApiKeyAuth": {"type": "http", "scheme": "bearer"}}}, "servers": []}