{"openapi":"3.1.0","info":{"title":"Ditiny Public AI Images API","description":"Server-to-server AI image jobs. Keep API keys on your backend. Use Idempotency-Key for creation; poll every 5–10 seconds. Private outputs require auth; fee confirmation may arrive after output. Availability requires AI_PUBLIC_API_ENABLED and the R3 wallet-hold release.","version":"1.0.0"},"paths":{"/api/v1/ai/prompt-templates":{"get":{"tags":["Public AI Images"],"summary":"List shared and your personal prompt templates","operationId":"prompts_api_v1_ai_prompt_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptTemplateListDTO"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request Entity Too Large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported Media Type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]},{"DitinyAPIKey":[]}]},"post":{"tags":["Public AI Images"],"summary":"Save a personal prompt or administrator-owned shared prompt","operationId":"create_prompt_template_api_v1_ai_prompt_templates_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptTemplateCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptTemplateDTO"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request Entity Too Large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported Media Type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]},{"DitinyAPIKey":[]}]}},"/api/v1/ai/prompts":{"get":{"tags":["Public AI Images"],"summary":"Read shared and personal saved prompts without generating images","operationId":"prompts_api_v1_ai_prompts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptTemplateListDTO"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request Entity Too Large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported Media Type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]},{"DitinyAPIKey":[]}]}},"/api/v1/ai/prompt-templates/{template_id}":{"patch":{"tags":["Public AI Images"],"summary":"Edit a template with an expected version","operationId":"edit_prompt_template_api_v1_ai_prompt_templates__template_id__patch","security":[{"HTTPBearer":[]},{"DitinyAPIKey":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Template Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptTemplatePatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptTemplateDTO"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payment Required"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Request Entity Too Large"},"415":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unsupported Media Type"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too Many Requests"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Service Unavailable"}}},"delete":{"tags":["Public AI Images"],"summary":"Remove a template without changing historical jobs","operationId":"remove_prompt_template_api_v1_ai_prompt_templates__template_id__delete","security":[{"HTTPBearer":[]},{"DitinyAPIKey":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Template Id"}},{"name":"version","in":"query","required":true,"schema":{"type":"integer","minimum":1,"title":"Version"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payment Required"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Request Entity Too Large"},"415":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unsupported Media Type"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too Many Requests"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Service Unavailable"}}}},"/api/v1/ai/models":{"get":{"tags":["Public AI Images"],"summary":"List available image models","operationId":"models_api_v1_ai_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelsResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request Entity Too Large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported Media Type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]},{"DitinyAPIKey":[]}]}},"/api/v1/ai/jobs":{"post":{"tags":["Public AI Images"],"summary":"Queue a paid image job","operationId":"create_job_api_v1_ai_jobs_post","security":[{"HTTPBearer":[]},{"DitinyAPIKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_.:-]+$","title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobCreate"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payment Required"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Request Entity Too Large"},"415":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unsupported Media Type"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too Many Requests"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Service Unavailable"}}},"get":{"tags":["Public AI Images"],"summary":"List your jobs","operationId":"jobs_api_v1_ai_jobs_get","security":[{"HTTPBearer":[]},{"DitinyAPIKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":30,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","maximum":1000000,"minimum":0,"default":0,"title":"Offset"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["queued","preparing","running","saving","succeeded","failed","needs_review","cancelled"],"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobsResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payment Required"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Request Entity Too Large"},"415":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unsupported Media Type"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too Many Requests"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Service Unavailable"}}}},"/api/v1/ai/jobs/{job_id}":{"get":{"tags":["Public AI Images"],"summary":"Read progress, result and confirmed fee","operationId":"job_api_v1_ai_jobs__job_id__get","security":[{"HTTPBearer":[]},{"DitinyAPIKey":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payment Required"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Request Entity Too Large"},"415":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unsupported Media Type"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too Many Requests"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Service Unavailable"}}}},"/api/v1/ai/jobs/{job_id}/cancel":{"post":{"tags":["Public AI Images"],"summary":"Cancel before provider submission","operationId":"cancel_api_v1_ai_jobs__job_id__cancel_post","security":[{"HTTPBearer":[]},{"DitinyAPIKey":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payment Required"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Request Entity Too Large"},"415":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unsupported Media Type"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too Many Requests"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Service Unavailable"}}}},"/api/v1/ai/jobs/{job_id}/refresh-fee":{"post":{"tags":["Public AI Images"],"summary":"Look up a fee without generating another image","operationId":"refresh_fee_api_v1_ai_jobs__job_id__refresh_fee_post","security":[{"HTTPBearer":[]},{"DitinyAPIKey":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payment Required"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Request Entity Too Large"},"415":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unsupported Media Type"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too Many Requests"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Service Unavailable"}}}},"/api/v1/ai/jobs/{job_id}/output":{"get":{"tags":["Public AI Images"],"summary":"Stream owned original output with auth; no thumbnail wait","operationId":"output_api_v1_ai_jobs__job_id__output_get","security":[{"HTTPBearer":[]},{"DitinyAPIKey":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Job Id"}},{"name":"download","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Download"}}],"responses":{"200":{"description":"Successful Response","content":{"image/png":{},"image/jpeg":{},"image/webp":{}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payment Required"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Request Entity Too Large"},"415":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unsupported Media Type"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too Many Requests"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Service Unavailable"}}},"head":{"tags":["Public AI Images"],"summary":"Read owned output headers without downloading","operationId":"head_ai_output_v1","security":[{"HTTPBearer":[]},{"DitinyAPIKey":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Job Id"}},{"name":"download","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Download"}}],"responses":{"200":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payment Required"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Request Entity Too Large"},"415":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unsupported Media Type"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too Many Requests"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Service Unavailable"}}}},"/api/v1/ai/sources":{"post":{"tags":["Public AI Images"],"summary":"Import a public HTTPS image into your private library","operationId":"import_source_api_v1_ai_sources_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/URLSource"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Source"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request Entity Too Large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported Media Type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]},{"DitinyAPIKey":[]}]}},"/api/v1/ai/site-images":{"post":{"tags":["Public AI Images"],"summary":"Discover image candidates on a public page","operationId":"site_images_api_v1_ai_site_images_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/URLSource"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteImages"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request Entity Too Large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported Media Type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]},{"DitinyAPIKey":[]}]}},"/api/v1/ai/sources/{file_key}/transform":{"post":{"tags":["Public AI Images"],"summary":"Save a private rotated/cropped reference (4 MP input, 2048px output)","operationId":"transform_api_v1_ai_sources__file_key__transform_post","security":[{"HTTPBearer":[]},{"DitinyAPIKey":[]}],"parameters":[{"name":"file_key","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"File Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transform"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Source"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payment Required"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Request Entity Too Large"},"415":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unsupported Media Type"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too Many Requests"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Service Unavailable"}}}},"/api/v1/wallet":{"get":{"tags":["Public AI Images"],"summary":"Read your USD wallet","operationId":"own_wallet_api_v1_wallet_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Wallet"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request Entity Too Large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported Media Type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]},{"DitinyAPIKey":[]}]}},"/api/v1/wallet/transactions":{"get":{"tags":["Public AI Images"],"summary":"Read your wallet ledger","operationId":"transactions_api_v1_wallet_transactions_get","security":[{"HTTPBearer":[]},{"DitinyAPIKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":30,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","maximum":1000000,"minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transactions"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payment Required"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Request Entity Too Large"},"415":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unsupported Media Type"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too Many Requests"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Service Unavailable"}}}},"/api/v1/ai/webhook":{"get":{"tags":["Public AI Images"],"summary":"Read your shared webhook configuration","operationId":"own_ai_webhook_api_v1_ai_webhook_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSettingResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request Entity Too Large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported Media Type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]},{"DitinyAPIKey":[]}]},"put":{"tags":["Public AI Images"],"summary":"Configure your shared webhook and opt in to AI events","operationId":"configure_ai_webhook_api_v1_ai_webhook_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSettingRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSettingResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request Entity Too Large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported Media Type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]},{"DitinyAPIKey":[]}]}},"/api/v1/ai/webhook/deliveries":{"get":{"tags":["Public AI Images"],"summary":"Read your AI webhook delivery history","operationId":"ai_webhook_history_api_v1_ai_webhook_deliveries_get","security":[{"HTTPBearer":[]},{"DitinyAPIKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":30,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","maximum":1000000,"minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AIWebhookHistory"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payment Required"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Request Entity Too Large"},"415":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unsupported Media Type"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too Many Requests"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Service Unavailable"}}}}},"components":{"schemas":{"AIWebhookHistory":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AIWebhookHistoryItem"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["items","has_more"],"title":"AIWebhookHistory"},"AIWebhookHistoryItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"event":{"type":"string","title":"Event"},"job_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Job Id"},"status":{"type":"string","title":"Status"},"attempts":{"type":"integer","title":"Attempts"},"last_http_status":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Http Status"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"next_attempt_at":{"type":"string","format":"date-time","title":"Next Attempt At"},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished At"}},"type":"object","required":["id","event","job_id","status","attempts","last_http_status","last_error","created_at","next_attempt_at","finished_at"],"title":"AIWebhookHistoryItem"},"BillingConfig":{"properties":{"max_cost_usd":{"anyOf":[{"type":"number","maximum":1000000.0,"exclusiveMinimum":0.0},{"type":"string"},{"type":"null"}],"title":"Max Cost Usd","description":"Admission wallet hold ceiling; does not cap the actual provider charge"}},"additionalProperties":false,"type":"object","title":"BillingConfig"},"Crop":{"properties":{"left":{"type":"number","exclusiveMaximum":1.0,"minimum":0.0,"title":"Left","default":0},"top":{"type":"number","exclusiveMaximum":1.0,"minimum":0.0,"title":"Top","default":0},"width":{"type":"number","maximum":1.0,"exclusiveMinimum":0.0,"title":"Width"},"height":{"type":"number","maximum":1.0,"exclusiveMinimum":0.0,"title":"Height"}},"additionalProperties":false,"type":"object","required":["width","height"],"title":"Crop"},"Error":{"properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}},"type":"object","required":["error"],"title":"Error"},"ErrorDetail":{"properties":{"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id"},"retryable":{"type":"boolean","title":"Retryable"},"details":{"anyOf":[{"items":{"$ref":"#/components/schemas/ValidationIssue"},"type":"array"},{"type":"null"}],"title":"Details"}},"type":"object","required":["code","message","retryable"],"title":"ErrorDetail"},"ExecutionConfig":{"properties":{"target":{"type":"string","enum":["cloud","local","pool"],"title":"Target","default":"cloud"}},"additionalProperties":false,"type":"object","title":"ExecutionConfig"},"Fee":{"properties":{"currency":{"type":"string","title":"Currency","default":"USD"},"status":{"type":"string","title":"Status"},"actual_cost_usd":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actual Cost Usd"},"charged_usd":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Charged Usd"},"provider_confirmed":{"type":"boolean","title":"Provider Confirmed","default":false},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"provider_request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Request Id"},"duration_ms":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Duration Ms"},"http_status":{"anyOf":[{"type":"integer","maximum":599.0,"minimum":100.0},{"type":"null"}],"title":"Http Status"}},"type":"object","required":["status"],"title":"Fee"},"GenerationParams":{"properties":{"seed":{"anyOf":[{"type":"integer","maximum":4294967295.0,"minimum":0.0},{"type":"null"}],"title":"Seed"},"negative_prompt":{"anyOf":[{"type":"string","maxLength":4000,"minLength":1},{"type":"null"}],"title":"Negative Prompt"},"mask_file_key":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Mask File Key"},"provider_options":{"type":"object","title":"Provider Options"}},"additionalProperties":false,"type":"object","title":"GenerationParams"},"Job":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"source_file_key":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Source File Key"},"model_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Model Id"},"model_name":{"type":"string","title":"Model Name"},"operation":{"type":"string","title":"Operation"},"prompt":{"type":"string","title":"Prompt"},"resolution":{"type":"string","title":"Resolution"},"parent_job_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Job Id"},"status":{"type":"string","title":"Status"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"reservation_usd":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reservation Usd"},"progress":{"$ref":"#/components/schemas/Progress"},"fee":{"$ref":"#/components/schemas/Fee"},"usage":{"$ref":"#/components/schemas/Usage"},"output":{"anyOf":[{"$ref":"#/components/schemas/Output"},{"type":"null"}]},"outputs":{"items":{"$ref":"#/components/schemas/Output"},"type":"array","title":"Outputs"},"effective_config":{"type":"object","title":"Effective Config"},"prompt_snapshot":{"type":"object","title":"Prompt Snapshot"},"client_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Reference"},"metadata":{"additionalProperties":{"type":"string"},"type":"object","title":"Metadata"}},"type":"object","required":["id","source_file_key","model_id","model_name","operation","prompt","resolution","parent_job_id","status","error","reservation_usd","progress","fee","output"],"title":"Job"},"JobCreate":{"properties":{"parent_job_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Job Id"},"source_file_key":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Source File Key"},"model_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Model Id"},"operation":{"type":"string","enum":["generate","extract","redesign","remockup","flatten"],"title":"Operation"},"prompt":{"anyOf":[{"type":"string","maxLength":4000,"minLength":1},{"type":"null"}],"title":"Prompt"},"resolution":{"type":"string","enum":["1K","2K"],"title":"Resolution","default":"1K"},"output":{"$ref":"#/components/schemas/OutputConfig"},"client_reference":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Client Reference"},"metadata":{"additionalProperties":{"type":"string"},"type":"object","title":"Metadata"},"prompt_template_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Prompt Template Id"},"prompt_template_version":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Prompt Template Version"},"variables":{"additionalProperties":{"type":"string"},"type":"object","title":"Variables"},"num_outputs":{"type":"integer","const":1,"title":"Num Outputs","default":1},"references":{"items":{"$ref":"#/components/schemas/ReferenceConfig"},"type":"array","maxItems":16,"title":"References"},"size":{"$ref":"#/components/schemas/SizeConfig"},"postprocess":{"anyOf":[{"$ref":"#/components/schemas/PostprocessConfig"},{"type":"null"}]},"generation":{"$ref":"#/components/schemas/GenerationParams"},"execution":{"$ref":"#/components/schemas/ExecutionConfig"},"billing":{"$ref":"#/components/schemas/BillingConfig"}},"additionalProperties":false,"type":"object","required":["model_id","operation"],"title":"JobCreate"},"JobsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/Job"},"type":"array","title":"Items"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["items","limit","offset","has_more"],"title":"JobsResponse"},"ModelsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PublicModel"},"type":"array","title":"Items"},"max_source_bytes":{"type":"integer","title":"Max Source Bytes"},"output_shape":{"type":"string","title":"Output Shape","description":"Legacy default output shape; supported native size modes are listed in each model capabilities","default":"square"}},"type":"object","required":["items","max_source_bytes"],"title":"ModelsResponse"},"Output":{"properties":{"file_key":{"type":"string","format":"uuid","title":"File Key"},"filename":{"type":"string","title":"Filename"},"url":{"type":"string","title":"Url"},"requires_auth":{"type":"boolean","title":"Requires Auth","description":"Authentication requirement of url; public_url and download_url never require authentication","default":true},"is_public":{"type":"boolean","title":"Is Public","default":false},"public_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Public Url","description":"Permanent inline original link while output remains public and undeleted"},"download_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download Url","description":"Permanent attachment original link while output remains public and undeleted"}},"type":"object","required":["file_key","filename","url"],"title":"Output"},"OutputConfig":{"properties":{"visibility":{"type":"string","enum":["public","private"],"title":"Visibility","default":"public"},"background":{"type":"string","enum":["auto","transparent","opaque"],"title":"Background","default":"auto"},"format":{"type":"string","enum":["auto","png","webp","jpeg"],"title":"Format","default":"auto"}},"additionalProperties":false,"type":"object","title":"OutputConfig"},"PostprocessConfig":{"properties":{"resize":{"$ref":"#/components/schemas/ResizeConfig"}},"additionalProperties":false,"type":"object","required":["resize"],"title":"PostprocessConfig"},"Progress":{"properties":{"stage":{"type":"string","title":"Stage"},"percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Percent"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"preparing_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Preparing At"},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Submitted At"},"saving_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Saving At"},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished At"}},"type":"object","required":["stage","created_at"],"title":"Progress"},"PromptTemplateCreate":{"properties":{"name":{"type":"string","maxLength":150,"minLength":1,"title":"Name"},"operation":{"type":"string","enum":["generate","extract","redesign","remockup","flatten"],"title":"Operation"},"prompt":{"type":"string","maxLength":4000,"minLength":1,"title":"Prompt"},"requested_images":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Requested Images","default":1},"scope":{"type":"string","enum":["global","personal"],"title":"Scope","default":"personal"}},"additionalProperties":false,"type":"object","required":["name","operation","prompt"],"title":"PromptTemplateCreate"},"PromptTemplateDTO":{"properties":{"id":{"type":"string","title":"Id"},"version":{"type":"integer","title":"Version"},"operation":{"type":"string","enum":["generate","extract","redesign","remockup","flatten"],"title":"Operation"},"name":{"type":"string","title":"Name"},"prompt":{"type":"string","title":"Prompt"},"requested_images":{"type":"integer","title":"Requested Images"},"sha256":{"type":"string","title":"Sha256"},"scope":{"type":"string","enum":["global","personal"],"title":"Scope"},"editable":{"type":"boolean","title":"Editable"}},"type":"object","required":["id","version","operation","name","prompt","requested_images","sha256","scope","editable"],"title":"PromptTemplateDTO"},"PromptTemplateListDTO":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PromptTemplateDTO"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"PromptTemplateListDTO"},"PromptTemplatePatch":{"properties":{"version":{"type":"integer","minimum":1.0,"title":"Version"},"name":{"anyOf":[{"type":"string","maxLength":150,"minLength":1},{"type":"null"}],"title":"Name"},"operation":{"anyOf":[{"type":"string","enum":["generate","extract","redesign","remockup","flatten"]},{"type":"null"}],"title":"Operation"},"prompt":{"anyOf":[{"type":"string","maxLength":4000,"minLength":1},{"type":"null"}],"title":"Prompt"},"requested_images":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":1.0},{"type":"null"}],"title":"Requested Images"}},"additionalProperties":false,"type":"object","required":["version"],"title":"PromptTemplatePatch"},"PublicModel":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"provider":{"type":"string","title":"Provider"},"provider_name":{"type":"string","title":"Provider Name"},"resolutions":{"items":{"type":"string"},"type":"array","title":"Resolutions"},"wallet_holds_usd":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Wallet Holds Usd"},"capabilities":{"type":"object","title":"Capabilities"},"operations":{"items":{"type":"string"},"type":"array","title":"Operations","default":["generate","extract","redesign","remockup","flatten"]},"reservation_usd":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reservation Usd"}},"type":"object","required":["id","name","provider","provider_name","resolutions"],"title":"PublicModel"},"ReferenceConfig":{"properties":{"file_key":{"type":"string","format":"uuid","title":"File Key"}},"additionalProperties":false,"type":"object","required":["file_key"],"title":"ReferenceConfig"},"ResizeConfig":{"properties":{"width":{"type":"integer","maximum":4500.0,"minimum":1.0,"title":"Width"},"height":{"type":"integer","maximum":5400.0,"minimum":1.0,"title":"Height"}},"additionalProperties":false,"type":"object","required":["width","height"],"title":"ResizeConfig"},"SiteImage":{"properties":{"url":{"type":"string","title":"Url"},"label":{"type":"string","title":"Label"}},"type":"object","required":["url","label"],"title":"SiteImage"},"SiteImages":{"properties":{"images":{"items":{"$ref":"#/components/schemas/SiteImage"},"type":"array","title":"Images"}},"type":"object","required":["images"],"title":"SiteImages"},"SizeConfig":{"properties":{"mode":{"type":"string","enum":["square","original_ratio","aspect_ratio","custom"],"title":"Mode","default":"square"},"aspect_ratio":{"anyOf":[{"type":"string","pattern":"^[1-9][0-9]?:[1-9][0-9]?$"},{"type":"null"}],"title":"Aspect Ratio"},"width":{"anyOf":[{"type":"integer","maximum":4500.0,"minimum":64.0},{"type":"null"}],"title":"Width"},"height":{"anyOf":[{"type":"integer","maximum":5400.0,"minimum":64.0},{"type":"null"}],"title":"Height"}},"additionalProperties":false,"type":"object","title":"SizeConfig"},"Source":{"properties":{"file_key":{"type":"string","format":"uuid","title":"File Key"},"filename":{"type":"string","title":"Filename"},"mime_type":{"type":"string","title":"Mime Type"},"size_bytes":{"type":"integer","title":"Size Bytes"},"is_public":{"type":"boolean","title":"Is Public","default":false}},"type":"object","required":["file_key","filename","mime_type","size_bytes"],"title":"Source"},"Transaction":{"properties":{"id":{"type":"integer","title":"Id"},"kind":{"type":"string","title":"Kind"},"amount_usd":{"type":"string","title":"Amount Usd"},"job_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Job Id"},"source":{"type":"string","title":"Source"},"reason":{"type":"string","title":"Reason"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","kind","amount_usd","job_id","source","reason","reference","created_at"],"title":"Transaction"},"Transactions":{"properties":{"items":{"items":{"$ref":"#/components/schemas/Transaction"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"Transactions"},"Transform":{"properties":{"rotation_degrees":{"type":"number","maximum":180.0,"minimum":-180.0,"title":"Rotation Degrees","default":0},"crop":{"anyOf":[{"$ref":"#/components/schemas/Crop"},{"type":"null"}]}},"additionalProperties":false,"type":"object","title":"Transform"},"URLSource":{"properties":{"url":{"type":"string","maxLength":4096,"minLength":8,"title":"Url"}},"additionalProperties":false,"type":"object","required":["url"],"title":"URLSource"},"Usage":{"properties":{"input_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Input Tokens"},"output_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Output Tokens"},"total_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Tokens"},"cached_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cached Tokens"},"reasoning_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reasoning Tokens"},"image_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Image Tokens"},"input_image_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Input Image Tokens"},"output_image_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Output Image Tokens"},"images":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Images"},"provider_metrics":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"integer"},{"type":"string"}]},"type":"object"},{"type":"null"}],"title":"Provider Metrics"}},"type":"object","title":"Usage"},"ValidationIssue":{"properties":{"field":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Field"},"message":{"type":"string","title":"Message"}},"type":"object","required":["field","message"],"title":"ValidationIssue"},"Wallet":{"properties":{"currency":{"type":"string","title":"Currency"},"balance_usd":{"type":"string","title":"Balance Usd"},"total_topups_usd":{"type":"string","title":"Total Topups Usd"},"total_spent_usd":{"type":"string","title":"Total Spent Usd"},"pending_calls":{"type":"integer","title":"Pending Calls"},"held_usd":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Held Usd"},"available_usd":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Available Usd"},"overrun":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Overrun"}},"type":"object","required":["currency","balance_usd","total_topups_usd","total_spent_usd","pending_calls"],"title":"Wallet"},"WebhookSettingRequest":{"properties":{"ai_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ai Enabled"},"url":{"type":"string","maxLength":1000,"title":"Url"},"enabled":{"type":"boolean","title":"Enabled","default":true},"bearer_token":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Bearer Token"},"rotate_secret":{"type":"boolean","title":"Rotate Secret","default":false}},"type":"object","required":["url"],"title":"WebhookSettingRequest"},"WebhookSettingResponse":{"properties":{"ai_enabled":{"type":"boolean","title":"Ai Enabled","default":false},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"enabled":{"type":"boolean","title":"Enabled"},"has_secret":{"type":"boolean","title":"Has Secret"},"has_bearer_token":{"type":"boolean","title":"Has Bearer Token"},"signing_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signing Secret"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["url","enabled","has_secret","has_bearer_token"],"title":"WebhookSettingResponse"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"},"DitinyAPIKey":{"type":"apiKey","in":"header","name":"X-API-Key"}}},"servers":[{"url":"https://i.ditiny.com"}]}