{"openapi":"3.1.0","info":{"title":"camerino API","version":"1","description":"Every image and video model behind one key and one credit balance. Prices are in credits, fixed per request and known before it runs; a failed generation is refunded in full."},"servers":[{"url":"https://getcamerino.com"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Generations"},{"name":"Account"},{"name":"Files"},{"name":"Styles"},{"name":"Webhooks"}],"paths":{"/api/v1/openapi.json":{"get":{"operationId":"getOpenApi","tags":["Account"],"summary":"This document","description":"Public: no key needed.","security":[],"responses":{"200":{"description":"The OpenAPI 3.1 document.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/images":{"post":{"operationId":"createImage","tags":["Generations"],"summary":"Generate an image","description":"Prices the request, charges the credits and queues the job; the answer comes at once with `status: pending`. Poll GET with the id, or register a webhook. A failed job is refunded in full.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string. Sending the same request again with the same key returns the same generation (200, header `Idempotent-Replayed: true`) and charges nothing more. The same key with a different request: `idempotency_key_reused` (422).","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageRequest"}}}},"responses":{"200":{"description":"Replay of a request already received with this Idempotency-Key. Nothing charged.","headers":{"Idempotent-Replayed":{"schema":{"type":"string","const":"true"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"202":{"description":"Created and queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"400":{"description":"Invalid request. Codes: `invalid_json`, `invalid_prompt`, `invalid_max_credits`, `invalid_webhook_url`, `invalid_references`, `invalid_style`, `invalid_parameters`, `wrong_task`, `not_available`, `webhook_not_configured`, `invalid_url`, `empty_file`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_json","invalid_prompt","invalid_max_credits","invalid_webhook_url","invalid_references","invalid_style","invalid_parameters","wrong_task","not_available","webhook_not_configured","invalid_url","empty_file"]}}}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"Not enough credits, or the key's monthly cap is reached. Codes: `insufficient_credits`, `key_monthly_cap`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["insufficient_credits","key_monthly_cap"]}}}}}]}}}},"404":{"description":"A style or reference that is not yours, or no longer exists. Codes: `style_not_found`, `reference_not_found`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["style_not_found","reference_not_found"]}}}}}]}}}},"413":{"description":"A reference given as a link is too large, or your files are full. Codes: `file_too_large`, `storage_full`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["file_too_large","storage_full"]}}}}}]}}}},"415":{"description":"A reference given as a link is not a PNG, JPEG or WebP image. Codes: `unsupported_type`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unsupported_type"]}}}}}]}}}},"422":{"description":"Above `max_credits`, or Idempotency-Key reused for a different request. Codes: `price_above_max`, `idempotency_key_reused`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["price_above_max","idempotency_key_reused"]}}}}}]}}}},"429":{"description":"Too many requests for this key, or one of your account's caps: credits per day, jobs in progress at once. Codes: `rate_limited`, `daily_credits`, `concurrent_jobs`.","headers":{"Retry-After":{"description":"Seconds to wait before trying again.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["rate_limited","daily_credits","concurrent_jobs"]}}}}}]}}}},"503":{"description":"Prices are not available right now, or the model is temporarily off. Codes: `no_price_list`, `model_paused`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["no_price_list","model_paused"]}}}}}]}}}}}}},"/api/v1/images/{id}":{"get":{"operationId":"getImage","tags":["Generations"],"summary":"Get an image","description":"Status and, when succeeded, signed links to the files. Only generations made as an image.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The generation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Not found, or not yours. Codes: `not_found`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}}}]}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/videos":{"post":{"operationId":"createVideo","tags":["Generations"],"summary":"Generate a video","description":"Prices the request, charges the credits and queues the job; the answer comes at once with `status: pending`. Poll GET with the id, or register a webhook. A failed job is refunded in full.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string. Sending the same request again with the same key returns the same generation (200, header `Idempotent-Replayed: true`) and charges nothing more. The same key with a different request: `idempotency_key_reused` (422).","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoRequest"}}}},"responses":{"200":{"description":"Replay of a request already received with this Idempotency-Key. Nothing charged.","headers":{"Idempotent-Replayed":{"schema":{"type":"string","const":"true"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"202":{"description":"Created and queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"400":{"description":"Invalid request. Codes: `invalid_json`, `invalid_prompt`, `invalid_max_credits`, `invalid_webhook_url`, `invalid_references`, `invalid_style`, `invalid_parameters`, `wrong_task`, `not_available`, `webhook_not_configured`, `invalid_url`, `empty_file`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_json","invalid_prompt","invalid_max_credits","invalid_webhook_url","invalid_references","invalid_style","invalid_parameters","wrong_task","not_available","webhook_not_configured","invalid_url","empty_file"]}}}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"Not enough credits, or the key's monthly cap is reached. Codes: `insufficient_credits`, `key_monthly_cap`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["insufficient_credits","key_monthly_cap"]}}}}}]}}}},"404":{"description":"A style or reference that is not yours, or no longer exists. Codes: `style_not_found`, `reference_not_found`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["style_not_found","reference_not_found"]}}}}}]}}}},"413":{"description":"A reference given as a link is too large, or your files are full. Codes: `file_too_large`, `storage_full`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["file_too_large","storage_full"]}}}}}]}}}},"415":{"description":"A reference given as a link is not a PNG, JPEG or WebP image. Codes: `unsupported_type`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unsupported_type"]}}}}}]}}}},"422":{"description":"Above `max_credits`, or Idempotency-Key reused for a different request. Codes: `price_above_max`, `idempotency_key_reused`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["price_above_max","idempotency_key_reused"]}}}}}]}}}},"429":{"description":"Too many requests for this key, or one of your account's caps: credits per day, jobs in progress at once. Codes: `rate_limited`, `daily_credits`, `concurrent_jobs`.","headers":{"Retry-After":{"description":"Seconds to wait before trying again.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["rate_limited","daily_credits","concurrent_jobs"]}}}}}]}}}},"503":{"description":"Prices are not available right now, or the model is temporarily off. Codes: `no_price_list`, `model_paused`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["no_price_list","model_paused"]}}}}}]}}}}}}},"/api/v1/videos/{id}":{"get":{"operationId":"getVideo","tags":["Generations"],"summary":"Get a video","description":"Status and, when succeeded, signed links to the files. Only generations made as a video.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The generation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Not found, or not yours. Codes: `not_found`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}}}]}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/gifs":{"post":{"operationId":"createGif","tags":["Generations"],"summary":"Generate an animated GIF","description":"Prices the request, charges the credits and queues the job; the answer comes at once with `status: pending`. Poll GET with the id, or register a webhook. A failed job is refunded in full.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string. Sending the same request again with the same key returns the same generation (200, header `Idempotent-Replayed: true`) and charges nothing more. The same key with a different request: `idempotency_key_reused` (422).","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GifRequest"}}}},"responses":{"200":{"description":"Replay of a request already received with this Idempotency-Key. Nothing charged.","headers":{"Idempotent-Replayed":{"schema":{"type":"string","const":"true"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"202":{"description":"Created and queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"400":{"description":"Invalid request. Codes: `invalid_json`, `invalid_prompt`, `invalid_max_credits`, `invalid_webhook_url`, `invalid_references`, `invalid_style`, `invalid_parameters`, `wrong_task`, `not_available`, `webhook_not_configured`, `invalid_url`, `empty_file`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_json","invalid_prompt","invalid_max_credits","invalid_webhook_url","invalid_references","invalid_style","invalid_parameters","wrong_task","not_available","webhook_not_configured","invalid_url","empty_file"]}}}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"Not enough credits, or the key's monthly cap is reached. Codes: `insufficient_credits`, `key_monthly_cap`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["insufficient_credits","key_monthly_cap"]}}}}}]}}}},"404":{"description":"A style or reference that is not yours, or no longer exists. Codes: `style_not_found`, `reference_not_found`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["style_not_found","reference_not_found"]}}}}}]}}}},"413":{"description":"A reference given as a link is too large, or your files are full. Codes: `file_too_large`, `storage_full`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["file_too_large","storage_full"]}}}}}]}}}},"415":{"description":"A reference given as a link is not a PNG, JPEG or WebP image. Codes: `unsupported_type`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unsupported_type"]}}}}}]}}}},"422":{"description":"Above `max_credits`, or Idempotency-Key reused for a different request. Codes: `price_above_max`, `idempotency_key_reused`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["price_above_max","idempotency_key_reused"]}}}}}]}}}},"429":{"description":"Too many requests for this key, or one of your account's caps: credits per day, jobs in progress at once. Codes: `rate_limited`, `daily_credits`, `concurrent_jobs`.","headers":{"Retry-After":{"description":"Seconds to wait before trying again.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["rate_limited","daily_credits","concurrent_jobs"]}}}}}]}}}},"503":{"description":"Prices are not available right now, or the model is temporarily off. Codes: `no_price_list`, `model_paused`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["no_price_list","model_paused"]}}}}}]}}}}}}},"/api/v1/gifs/{id}":{"get":{"operationId":"getGif","tags":["Generations"],"summary":"Get an animated GIF","description":"Status and, when succeeded, signed links to the files. Only generations made as an animated GIF.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The generation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Not found, or not yours. Codes: `not_found`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}}}]}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/svgs":{"post":{"operationId":"createSvg","tags":["Generations"],"summary":"Generate an SVG (vector)","description":"Prices the request, charges the credits and queues the job; the answer comes at once with `status: pending`. Poll GET with the id, or register a webhook. A failed job is refunded in full.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string. Sending the same request again with the same key returns the same generation (200, header `Idempotent-Replayed: true`) and charges nothing more. The same key with a different request: `idempotency_key_reused` (422).","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SvgRequest"}}}},"responses":{"200":{"description":"Replay of a request already received with this Idempotency-Key. Nothing charged.","headers":{"Idempotent-Replayed":{"schema":{"type":"string","const":"true"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"202":{"description":"Created and queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"400":{"description":"Invalid request. Codes: `invalid_json`, `invalid_prompt`, `invalid_max_credits`, `invalid_webhook_url`, `invalid_references`, `invalid_style`, `invalid_parameters`, `wrong_task`, `not_available`, `webhook_not_configured`, `invalid_url`, `empty_file`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_json","invalid_prompt","invalid_max_credits","invalid_webhook_url","invalid_references","invalid_style","invalid_parameters","wrong_task","not_available","webhook_not_configured","invalid_url","empty_file"]}}}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"Not enough credits, or the key's monthly cap is reached. Codes: `insufficient_credits`, `key_monthly_cap`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["insufficient_credits","key_monthly_cap"]}}}}}]}}}},"404":{"description":"A style or reference that is not yours, or no longer exists. Codes: `style_not_found`, `reference_not_found`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["style_not_found","reference_not_found"]}}}}}]}}}},"413":{"description":"A reference given as a link is too large, or your files are full. Codes: `file_too_large`, `storage_full`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["file_too_large","storage_full"]}}}}}]}}}},"415":{"description":"A reference given as a link is not a PNG, JPEG or WebP image. Codes: `unsupported_type`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unsupported_type"]}}}}}]}}}},"422":{"description":"Above `max_credits`, or Idempotency-Key reused for a different request. Codes: `price_above_max`, `idempotency_key_reused`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["price_above_max","idempotency_key_reused"]}}}}}]}}}},"429":{"description":"Too many requests for this key, or one of your account's caps: credits per day, jobs in progress at once. Codes: `rate_limited`, `daily_credits`, `concurrent_jobs`.","headers":{"Retry-After":{"description":"Seconds to wait before trying again.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["rate_limited","daily_credits","concurrent_jobs"]}}}}}]}}}},"503":{"description":"Prices are not available right now, or the model is temporarily off. Codes: `no_price_list`, `model_paused`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["no_price_list","model_paused"]}}}}}]}}}}}}},"/api/v1/svgs/{id}":{"get":{"operationId":"getSvg","tags":["Generations"],"summary":"Get an SVG (vector)","description":"Status and, when succeeded, signed links to the files. Only generations made as an SVG (vector).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The generation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Not found, or not yours. Codes: `not_found`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}}}]}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/generations":{"get":{"operationId":"listGenerations","tags":["Generations"],"summary":"List your generations","description":"Images, videos, GIFs and SVGs of every entrance (API, chat, Studio), newest first. To page, pass `next_cursor` as `cursor`; new generations never shift a page.","parameters":[{"name":"type","in":"query","schema":{"type":"string","enum":["image","video","gif","svg"]}},{"name":"status","in":"query","schema":{"type":"string","enum":["pending","processing","succeeded","failed"]}},{"name":"style","in":"query","description":"Id or name of one of your styles.","schema":{"type":"string"}},{"name":"created_after","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"created_before","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","description":"The `next_cursor` of the previous page.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"One page.","content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Generation"}},"next_cursor":{"type":["string","null"],"description":"null on the last page."}}}}}},"400":{"description":"Invalid filter. Codes: `invalid_type`, `invalid_status`, `invalid_date`, `invalid_limit`, `invalid_cursor`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_type","invalid_status","invalid_date","invalid_limit","invalid_cursor"]}}}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"No style of yours with this id or name. Codes: `style_not_found`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["style_not_found"]}}}}}]}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/estimate":{"post":{"operationId":"estimate","tags":["Generations"],"summary":"Price a request without running it","description":"Same body as POST /images, /videos, /gifs or /svgs plus `type`, same choice of model and same checks. Nothing is charged, downloaded or queued; the prompt is optional.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstimateRequest"}}}},"responses":{"200":{"description":"The price and your balance.","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["image","video","gif","svg"]},"model":{"type":"string"},"configuration":{"type":"string"},"credits":{"type":"integer"},"price_version":{"type":"integer"},"style":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}}},"balance":{"type":"integer"},"balance_after":{"type":"integer","description":"May be negative: then it would be refused."},"enough_credits":{"type":"boolean"}}}}}},"400":{"description":"Invalid request. Codes: `invalid_json`, `invalid_prompt`, `invalid_max_credits`, `invalid_webhook_url`, `invalid_references`, `invalid_style`, `invalid_parameters`, `wrong_task`, `not_available`, `invalid_type`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_json","invalid_prompt","invalid_max_credits","invalid_webhook_url","invalid_references","invalid_style","invalid_parameters","wrong_task","not_available","invalid_type"]}}}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"No style of yours with this id or name. Codes: `style_not_found`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["style_not_found"]}}}}}]}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"Prices are not available right now, or the model is temporarily off. Codes: `no_price_list`, `model_paused`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["no_price_list","model_paused"]}}}}}]}}}}}}},"/api/v1/models":{"get":{"operationId":"listModels","tags":["Account"],"summary":"Models on sale and their prices","responses":{"200":{"description":"Configurations on sale in the active price list.","content":{"application/json":{"schema":{"type":"object","properties":{"price_version":{"type":["integer","null"]},"models":{"type":"array","items":{"type":"object","properties":{"model":{"type":"string"},"configuration":{"type":"string"},"name":{"type":"string"},"task":{"type":"string","enum":["image","video","gif","svg"],"description":"What it makes; generate with POST /images, /videos, /gifs or /svgs. A model can have a configuration for more than one task."},"category":{"type":"string","enum":["image","video"],"description":"The kind of file: GIFs and SVGs are images."},"unit":{"type":"string","enum":["image","second"],"description":"A video costs `credits_per_unit` × `duration`."},"credits_per_unit":{"type":"integer"},"aspect_ratios":{"type":"array","items":{"type":"string"}},"references":{"type":"object","properties":{"images":{"type":"integer","description":"Most reference images; 0 means none."},"first_last_frame":{"type":"boolean"}}}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/account":{"get":{"operationId":"getAccount","tags":["Account"],"summary":"Your credit balance","responses":{"200":{"description":"Balance in credits.","content":{"application/json":{"schema":{"type":"object","properties":{"credits":{"type":"integer"},"by_type":{"type":"object","additionalProperties":{"type":"integer"},"description":"Credits by kind of lot (`plan`, `topup`, `gift`, …)."}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/defaults":{"get":{"operationId":"getDefaults","tags":["Account"],"summary":"Models used when a request names none","responses":{"200":{"description":"Your defaults in force.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Defaults"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"updateDefaults","tags":["Account"],"summary":"Change your defaults","description":"A task left out is unchanged; `null` restores camerino's default. Nothing is saved if any part is invalid. Only image and video defaults can be changed: GIF and SVG have one model each.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"image":{"type":["object","null"],"additionalProperties":true,"description":"Request options with `model`, as in POST /api/v1/images or /videos (no prompt)."},"video":{"type":["object","null"],"additionalProperties":true,"description":"Request options with `model`, as in POST /api/v1/images or /videos (no prompt)."}}}}}},"responses":{"200":{"description":"Your defaults in force.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Defaults"}}}},"400":{"description":"Invalid defaults. Codes: `invalid_json`, `invalid_parameters`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_json","invalid_parameters"]}}}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/uploads":{"post":{"operationId":"createUpload","tags":["Files"],"summary":"Upload a reference image","description":"PNG, JPEG or WebP (read from the file's bytes), at most 50 MB. Send the raw bytes, or a multipart form with the file in `file`. Use the id as `references: [{ \"upload_id\": … }]`.","requestBody":{"required":true,"content":{"image/png":{"schema":{"type":"string","contentMediaType":"image/png"}},"image/jpeg":{"schema":{"type":"string","contentMediaType":"image/jpeg"}},"image/webp":{"schema":{"type":"string","contentMediaType":"image/webp"}},"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream"}}}}}},"responses":{"201":{"description":"Stored.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"}}}},"400":{"description":"Nothing usable in the body. Codes: `missing_file`, `invalid_body`, `empty_file`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["missing_file","invalid_body","empty_file"]}}}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"413":{"description":"File too large, or your files are full. Codes: `file_too_large`, `storage_full`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["file_too_large","storage_full"]}}}}}]}}}},"415":{"description":"Not a PNG, JPEG or WebP image. Codes: `unsupported_type`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unsupported_type"]}}}}}]}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/uploads/{id}":{"get":{"operationId":"getUpload","tags":["Files"],"summary":"Get an upload","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The upload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Not found, not yours, or expired. Codes: `not_found`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}}}]}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/styles":{"get":{"operationId":"listStyles","tags":["Styles"],"summary":"List your styles","responses":{"200":{"description":"Your styles, oldest first.","content":{"application/json":{"schema":{"type":"object","properties":{"styles":{"type":"array","items":{"$ref":"#/components/schemas/Style"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"createStyle","tags":["Styles"],"summary":"Create a style","description":"At most 50 styles. Use it with `style` in a request.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"additionalProperties":false,"description":"A new style.","properties":{"name":{"type":"string","minLength":1,"maxLength":60,"description":"Unique among your styles (case ignored); cannot look like an id."},"description":{"type":"string","maxLength":1000,"description":"What the results should look like; added to every prompt that uses the style."},"palette":{"type":"array","maxItems":8,"items":{"type":"string","maxLength":40},"description":"Colors, e.g. `\"#FFB020\"` or `\"warm amber\"`."},"references":{"type":"array","maxItems":8,"items":{"$ref":"#/components/schemas/Reference"},"description":"Images to follow; added to requests as far as the chosen model takes them."},"image":{"type":["object","null"],"additionalProperties":true,"description":"Image model and options used when a request names no model."},"video":{"type":["object","null"],"additionalProperties":true,"description":"Video model and options used when a request names no model."}}}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Style"}}}},"400":{"description":"Invalid style. Codes: `invalid_json`, `invalid_style`, `too_many_references`, `invalid_references`, `invalid_url`, `empty_file`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_json","invalid_style","too_many_references","invalid_references","invalid_url","empty_file"]}}}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"A reference not found. Codes: `reference_not_found`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["reference_not_found"]}}}}}]}}}},"409":{"description":"Name already used, or too many styles. Codes: `style_exists`, `too_many_styles`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["style_exists","too_many_styles"]}}}}}]}}}},"413":{"description":"A reference given as a link is too large, or your files are full. Codes: `file_too_large`, `storage_full`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["file_too_large","storage_full"]}}}}}]}}}},"415":{"description":"A reference given as a link is not a PNG, JPEG or WebP image. Codes: `unsupported_type`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unsupported_type"]}}}}}]}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/styles/{id}":{"get":{"operationId":"getStyle","tags":["Styles"],"summary":"Get a style","parameters":[{"name":"id","in":"path","required":true,"description":"The style's id, or its name (URL-encoded, case ignored).","schema":{"type":"string"}}],"responses":{"200":{"description":"The style.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Style"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"No style of yours with this id or name. Codes: `style_not_found`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["style_not_found"]}}}}}]}}}},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"updateStyle","tags":["Styles"],"summary":"Change a style","parameters":[{"name":"id","in":"path","required":true,"description":"The style's id, or its name (URL-encoded, case ignored).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"description":"Only the fields given change.","properties":{"name":{"type":"string","minLength":1,"maxLength":60,"description":"Unique among your styles (case ignored); cannot look like an id."},"description":{"type":"string","maxLength":1000,"description":"What the results should look like; added to every prompt that uses the style."},"palette":{"type":"array","maxItems":8,"items":{"type":"string","maxLength":40},"description":"Colors, e.g. `\"#FFB020\"` or `\"warm amber\"`."},"references":{"type":"array","maxItems":8,"items":{"$ref":"#/components/schemas/Reference"},"description":"Images to follow; added to requests as far as the chosen model takes them."},"image":{"type":["object","null"],"additionalProperties":true,"description":"Image model and options used when a request names no model."},"video":{"type":["object","null"],"additionalProperties":true,"description":"Video model and options used when a request names no model."}}}}}},"responses":{"200":{"description":"The style after the change.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Style"}}}},"400":{"description":"Invalid style. Codes: `invalid_json`, `invalid_style`, `too_many_references`, `invalid_references`, `invalid_url`, `empty_file`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_json","invalid_style","too_many_references","invalid_references","invalid_url","empty_file"]}}}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"No style of yours with this id or name, or a reference not found. Codes: `style_not_found`, `reference_not_found`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["style_not_found","reference_not_found"]}}}}}]}}}},"409":{"description":"Name already used, or too many styles. Codes: `style_exists`, `too_many_styles`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["style_exists","too_many_styles"]}}}}}]}}}},"413":{"description":"A reference given as a link is too large, or your files are full. Codes: `file_too_large`, `storage_full`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["file_too_large","storage_full"]}}}}}]}}}},"415":{"description":"A reference given as a link is not a PNG, JPEG or WebP image. Codes: `unsupported_type`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unsupported_type"]}}}}}]}}}},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"operationId":"deleteStyle","tags":["Styles"],"summary":"Delete a style","description":"Generations made with it keep it in their record.","parameters":[{"name":"id","in":"path","required":true,"description":"The style's id, or its name (URL-encoded, case ignored).","schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"No style of yours with this id or name. Codes: `style_not_found`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["style_not_found"]}}}}}]}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/webhook":{"get":{"operationId":"getWebhook","tags":["Webhooks"],"summary":"Your webhook","responses":{"200":{"description":"The registered endpoint (secret hidden).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"No webhook registered. Codes: `not_found`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}}}]}}}},"429":{"$ref":"#/components/responses/RateLimited"}}},"put":{"operationId":"setWebhook","tags":["Webhooks"],"summary":"Register or change your webhook","description":"One endpoint per account. The secret is created the first time and kept on later changes unless `rotate_secret` is true. Notifications still waiting move to the new address.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","maxLength":2000,"description":"https, standard port, no credentials, a public address."},"rotate_secret":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"The endpoint, with the secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"description":"Invalid body. Codes: `invalid_json`, `invalid_webhook_url`, `invalid_parameters`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_json","invalid_webhook_url","invalid_parameters"]}}}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"operationId":"deleteWebhook","tags":["Webhooks"],"summary":"Remove your webhook","description":"Notifications still waiting are dropped.","responses":{"204":{"description":"Removed."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"No webhook registered. Codes: `not_found`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}}}]}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/webhook/deliveries":{"get":{"operationId":"listWebhookDeliveries","tags":["Webhooks"],"summary":"Recent notifications","description":"The last 50, newest first, with the outcome of each.","responses":{"200":{"description":"Deliveries.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}}},"webhooks":{"generation.succeeded":{"post":{"operationId":"onGenerationSucceeded","tags":["Webhooks"],"summary":"`generation.succeeded`","description":"Sent when a generation created through the API succeeds, to the request's `webhook_url` or else your registered webhook. Answer 2xx within 10 seconds; redirects are not followed. Otherwise it is retried after 1, 5 and 15 minutes, 1, 3 and 6 hours, then every 6 hours, for 24 hours. Verify the signature before trusting the body.","parameters":[{"name":"camerino-signature","in":"header","required":true,"description":"`t=<unix seconds>,v1=<hex>`, where hex is HMAC-SHA256 with your webhook secret of the string `<t>.<raw body>`. Compare in constant time and reject old timestamps.","schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"}},{"name":"camerino-delivery","in":"header","required":true,"description":"Delivery id, the same on every retry.","schema":{"type":"string","format":"uuid"}},{"name":"camerino-event","in":"header","required":true,"schema":{"type":"string","const":"generation.succeeded"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Any 2xx marks the notification delivered."}}}},"generation.failed":{"post":{"operationId":"onGenerationFailed","tags":["Webhooks"],"summary":"`generation.failed`","description":"Sent when a generation created through the API fails (its credits are already refunded), to the request's `webhook_url` or else your registered webhook. Answer 2xx within 10 seconds; redirects are not followed. Otherwise it is retried after 1, 5 and 15 minutes, 1, 3 and 6 hours, then every 6 hours, for 24 hours. Verify the signature before trusting the body.","parameters":[{"name":"camerino-signature","in":"header","required":true,"description":"`t=<unix seconds>,v1=<hex>`, where hex is HMAC-SHA256 with your webhook secret of the string `<t>.<raw body>`. Compare in constant time and reject old timestamps.","schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"}},{"name":"camerino-delivery","in":"header","required":true,"description":"Delivery id, the same on every retry.","schema":{"type":"string","format":"uuid"}},{"name":"camerino-event","in":"header","required":true,"schema":{"type":"string","const":"generation.failed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Any 2xx marks the notification delivered."}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"cmr_live_…","description":"An API key from your account (`Authorization: Bearer cmr_live_…`). Each key allows 60 requests per minute and may have a monthly credit cap (up to 1,000,000)."}},"responses":{"Unauthorized":{"description":"Missing, malformed, invalid or revoked API key. Codes: `unauthorized`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]}}}}}]}}}},"RateLimited":{"description":"More than 60 requests in a minute with this key. `details.limit` is the limit. Codes: `rate_limited`.","headers":{"Retry-After":{"description":"Seconds to wait before trying again.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["rate_limited"]}}}}}]}}}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Stable, machine-readable. Branch on this, not on the message."},"message":{"type":"string","description":"For people; may change."},"details":{"description":"Optional extra data, e.g. `{ limit }` for rate limits, `{ available, required }` for missing credits, `{ credits, max_credits }` for `price_above_max`, or the list of invalid fields for `invalid_parameters`."}}}}},"Reference":{"type":"object","description":"A file to use as reference. Give exactly one of `job_id` (one of your finished images), `upload_id` (one of your uploads) or `url` (a public https image, copied into your files first). Without `role`: on images every reference is an image to follow; on videos a single reference is the first frame and several are reference images.","properties":{"job_id":{"type":"string","format":"uuid","description":"Id of one of your finished images."},"output":{"type":"integer","minimum":0,"default":0,"description":"Which output of `job_id` (only with `job_id`)."},"upload_id":{"type":"string","format":"uuid","description":"Id returned by POST /api/v1/uploads."},"url":{"type":"string","format":"uri","maxLength":2000,"pattern":"^https://"},"role":{"type":"string","enum":["image","first_frame","last_frame"]}},"additionalProperties":false,"oneOf":[{"required":["job_id"]},{"required":["upload_id"]},{"required":["url"]}]},"ImageRequest":{"type":"object","required":["prompt"],"description":"The prompt plus the options of one model. Every option that changes the price is explicit and required by its model (see GET /api/v1/models): unknown or missing options are refused with `invalid_parameters`. Without `model`, the style's model is used, then your defaults (GET /api/v1/defaults), then camerino's.","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000,"description":"What to generate, in any language."},"model":{"type":"string","examples":["flux-schnell","grok-imagine","seedream-5-lite","nano-banana-2.1","gpt-image-2","nano-banana-2","nano-banana-pro","gpt-image-2.6"],"description":"A model that makes an image (`task` in GET /api/v1/models); another one is refused with `wrong_task`. Default when no style or default names one: `nano-banana-2`."},"resolution":{"type":"string","description":"Required by Nano Banana models, e.g. `1k`, `2k`, `4k`."},"quality":{"type":"string","description":"Required by GPT Image 2, e.g. `medium`."},"size":{"type":"string","description":"Required by GPT Image 2, e.g. `1024x1024`."},"aspect_ratio":{"type":"string","enum":["4:3","3:4","16:9","9:16","1:1","3:2","2:3","4:5","5:4","21:9"],"description":"Format; which ones a model offers is in GET /api/v1/models. It never changes the price."},"references":{"type":"array","maxItems":14,"items":{"$ref":"#/components/schemas/Reference"},"description":"Reference images, or first and last frame of a video. They never change the price."},"style":{"type":"string","maxLength":100,"description":"Id or name of one of your styles."},"max_credits":{"type":"integer","minimum":1,"description":"Refuse the request with `price_above_max` (422) if it would cost more than this. Nothing is charged."},"webhook_url":{"type":"string","format":"uri","maxLength":2000,"description":"Notify this https address instead of your registered webhook. You need a registered webhook anyway: its secret signs the notification."}}},"VideoRequest":{"type":"object","required":["prompt"],"description":"The prompt plus the options of one model. Every option that changes the price is explicit and required by its model (see GET /api/v1/models): unknown or missing options are refused with `invalid_parameters`. Without `model`, the style's model is used, then your defaults (GET /api/v1/defaults), then camerino's.","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000,"description":"What to generate, in any language."},"model":{"type":"string","examples":["minimax-h3-lite","minimax-h3","kling-2.6","kling-4.0","kling-3.0","seedance-2.0","seedance-2.5"],"description":"A model that makes a video (`task` in GET /api/v1/models); another one is refused with `wrong_task`. Default when no style or default names one: `kling-2.6`."},"resolution":{"type":"string","description":"Required by most video models, e.g. `720p`."},"duration":{"type":"integer","description":"Length in seconds; always required for videos. Allowed range per model in GET /api/v1/models."},"audio":{"type":"boolean","description":"Required as `true` by Kling 2.6 and Kling 3.0."},"aspect_ratio":{"type":"string","enum":["4:3","3:4","16:9","9:16","1:1","3:2","2:3","4:5","5:4","21:9"],"description":"Format; which ones a model offers is in GET /api/v1/models. It never changes the price."},"references":{"type":"array","maxItems":14,"items":{"$ref":"#/components/schemas/Reference"},"description":"Reference images, or first and last frame of a video. They never change the price."},"style":{"type":"string","maxLength":100,"description":"Id or name of one of your styles."},"max_credits":{"type":"integer","minimum":1,"description":"Refuse the request with `price_above_max` (422) if it would cost more than this. Nothing is charged."},"webhook_url":{"type":"string","format":"uri","maxLength":2000,"description":"Notify this https address instead of your registered webhook. You need a registered webhook anyway: its secret signs the notification."}}},"GifRequest":{"type":"object","required":["prompt"],"description":"The prompt plus the options of one model. Every option that changes the price is explicit and required by its model (see GET /api/v1/models): unknown or missing options are refused with `invalid_parameters`. Without `model`, the style's model is used, then your defaults (GET /api/v1/defaults), then camerino's.","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000,"description":"What to generate, in any language."},"model":{"type":"string","examples":["gpt-image-2.6"],"description":"A model that makes an animated GIF (`task` in GET /api/v1/models); another one is refused with `wrong_task`. Default when no style or default names one: `gpt-image-2.6`."},"size":{"type":"string","enum":["512","720"],"default":"512","description":"`512`: 512×512 pixels, 12 frames. `720`: 720×720, 16 frames. 100 ms a frame, looping. Each has its own price."},"style":{"type":"string","maxLength":100,"description":"Id or name of one of your styles."},"max_credits":{"type":"integer","minimum":1,"description":"Refuse the request with `price_above_max` (422) if it would cost more than this. Nothing is charged."},"webhook_url":{"type":"string","format":"uri","maxLength":2000,"description":"Notify this https address instead of your registered webhook. You need a registered webhook anyway: its secret signs the notification."}}},"SvgRequest":{"type":"object","required":["prompt"],"description":"The prompt plus the options of one model. Every option that changes the price is explicit and required by its model (see GET /api/v1/models): unknown or missing options are refused with `invalid_parameters`. Without `model`, the style's model is used, then your defaults (GET /api/v1/defaults), then camerino's.","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000,"description":"What to generate, in any language."},"model":{"type":"string","examples":["recraft-svg"],"description":"A model that makes an SVG (vector) (`task` in GET /api/v1/models); another one is refused with `wrong_task`. Default when no style or default names one: `recraft-svg`."},"aspect_ratio":{"type":"string","enum":["4:3","3:4","16:9","9:16","1:1","3:2","2:3","4:5","5:4","21:9"],"description":"Format; which ones a model offers is in GET /api/v1/models. It never changes the price."},"style":{"type":"string","maxLength":100,"description":"Id or name of one of your styles."},"max_credits":{"type":"integer","minimum":1,"description":"Refuse the request with `price_above_max` (422) if it would cost more than this. Nothing is charged."},"webhook_url":{"type":"string","format":"uri","maxLength":2000,"description":"Notify this https address instead of your registered webhook. You need a registered webhook anyway: its secret signs the notification."}}},"EstimateRequest":{"type":"object","required":["type"],"description":"The body of POST /images, /videos, /gifs or /svgs plus `type`. The options are those of the task in `type`.","properties":{"type":{"type":"string","enum":["image","video","gif","svg"]},"prompt":{"type":"string","minLength":1,"maxLength":4000,"description":"Optional for an estimate."},"model":{"type":"string","description":"A model of the task in `type`."},"resolution":{"type":"string","description":"As in POST /images or /videos for this model."},"quality":{"type":"string","description":"Required by GPT Image 2, e.g. `medium`."},"size":{"type":"string","description":"As in POST /images or /gifs for this model."},"aspect_ratio":{"type":"string","enum":["4:3","3:4","16:9","9:16","1:1","3:2","2:3","4:5","5:4","21:9"],"description":"Format; which ones a model offers is in GET /api/v1/models. It never changes the price."},"references":{"type":"array","maxItems":14,"items":{"$ref":"#/components/schemas/Reference"},"description":"Reference images, or first and last frame of a video. They never change the price."},"style":{"type":"string","maxLength":100,"description":"Id or name of one of your styles."},"max_credits":{"type":"integer","minimum":1,"description":"Refuse the request with `price_above_max` (422) if it would cost more than this. Nothing is charged."},"webhook_url":{"type":"string","format":"uri","maxLength":2000,"description":"Notify this https address instead of your registered webhook. You need a registered webhook anyway: its secret signs the notification."},"duration":{"type":"integer","description":"Length in seconds; always required for videos. Allowed range per model in GET /api/v1/models."},"audio":{"type":"boolean","description":"Required as `true` by Kling 2.6 and Kling 3.0."}}},"Generation":{"type":"object","required":["id","type","status","model","configuration","credits","price_version","created_at"],"properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["image","video","gif","svg"],"description":"The task. GIFs are `.gif` files, SVGs `.svg` files."},"status":{"type":"string","enum":["pending","processing","succeeded","failed"]},"model":{"type":"string"},"configuration":{"type":"string","description":"The priced configuration, e.g. `nano-banana-2/1k`."},"credits":{"type":"integer","description":"Credits charged when the job was created."},"price_version":{"type":"integer","description":"Version of the price list used."},"created_at":{"type":"string","format":"date-time"},"style":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"description":"The style used, as it was named when the job was created."},"final_prompt":{"type":"string","description":"The prompt sent to the model, when a style changed it."},"outputs":{"type":"array","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"}}},"description":"Only when `succeeded`. Signed links: fetch the job again for fresh ones."},"outputs_expire_in_seconds":{"type":"integer","const":3600},"error":{"type":"object","description":"Only when `failed`.","properties":{"code":{"type":"string","enum":["rejected","generation_failed"]},"message":{"type":"string"}}},"refunded":{"type":"boolean","const":true,"description":"Only when `failed`: every credit was given back."}}},"Upload":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":["string","null"]},"content_type":{"type":"string","enum":["image/png","image/jpeg","image/webp"]},"size_bytes":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time","description":"30 days after upload by default; kept as long as a style uses it."}}},"Style":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"palette":{"type":"array","items":{"type":"string"}},"references":{"type":"array","items":{"type":"object"},"description":"Where each reference came from: `{ upload_id }`, `{ job_id, output }` or `{ url }`."},"image":{"type":["object","null"],"additionalProperties":true,"description":"Request options with `model`, as in POST /api/v1/images or /videos (no prompt)."},"video":{"type":["object","null"],"additionalProperties":true,"description":"Request options with `model`, as in POST /api/v1/images or /videos (no prompt)."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"Defaults":{"type":"object","properties":{"image":{"type":"object","properties":{"options":{"type":"object","additionalProperties":true},"source":{"type":"string","enum":["user","camerino"],"description":"`camerino` when you set none, or yours is no longer valid or on sale."}}},"video":{"type":"object","properties":{"options":{"type":"object","additionalProperties":true},"source":{"type":"string","enum":["user","camerino"],"description":"`camerino` when you set none, or yours is no longer valid or on sale."}}},"gif":{"type":"object","properties":{"options":{"type":"object","additionalProperties":true},"source":{"type":"string","enum":["user","camerino"],"description":"`camerino` when you set none, or yours is no longer valid or on sale."}}},"svg":{"type":"object","properties":{"options":{"type":"object","additionalProperties":true},"source":{"type":"string","enum":["user","camerino"],"description":"`camerino` when you set none, or yours is no longer valid or on sale."}}}}},"WebhookEndpoint":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"secret":{"type":"string","pattern":"^whsec_","description":"Only in the answer to PUT: keep it to verify signatures."},"secret_hint":{"type":"string","description":"The first characters of the secret (GET)."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Also sent as the `camerino-delivery` header."},"event":{"type":"string","enum":["generation.succeeded","generation.failed"]},"generation_id":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"status":{"type":"string","enum":["pending","delivered","failed"]},"attempts":{"type":"integer"},"last_status_code":{"type":["integer","null"]},"last_error":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"delivered_at":{"type":["string","null"],"format":"date-time"},"next_attempt_at":{"type":["string","null"],"format":"date-time"}}},"WebhookEvent":{"type":"object","required":["id","event","created_at","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Delivery id: the same on every retry, use it to deduplicate."},"event":{"type":"string","enum":["generation.succeeded","generation.failed"]},"created_at":{"type":"string","format":"date-time"},"data":{"$ref":"#/components/schemas/Generation","description":"The generation, as GET /api/v1/images/{id} shows it."}}}}}}