{"openapi":"3.1.0","info":{"title":"Affogato API","description":"Generate images, video and audio with every model Affogato serves, from\nyour own code or your agents.\n\n**Authentication.** Send your key as `Authorization: Bearer afg_…`. Keys\nare created on the Developers page of your Affogato account and are\navailable on paid plans. Never ship a key in client-side code.\n\n**Credits.** Every generation is priced in the same credits your plan\nincludes. `POST /v1/generations/estimate` quotes a request without\ncharging; `POST /v1/generations` charges up front and refunds in full if\nthe generation fails or is cancelled.\n\n**Async.** A generation starts as `queued`, moves to `processing`, and\nends `succeeded`, `failed` or `cancelled`. Poll `GET /v1/generations/{id}`,\npass `?wait=25` to long-poll, or set `webhook_url` to receive a signed\nStandard-Webhooks POST when it finishes.\n\n**Files.** Upload inputs with `POST /v1/files` (or `/v1/files/from-url`)\nand pass the file id in the model's input slots (`inputs` on\n`GET /v1/models/{id}`). Outputs are files too.\n\n**Errors.** `{\"error\": {\"code\": \"...\", \"message\": \"...\"}}` with a\nmachine-readable `code`; 429s carry `Retry-After`.\n","contact":{"name":"Affogato","url":"https://affogato.ai/developers"},"version":"2026-11-01"},"servers":[{"url":"https://staging.api.affogato.ai/v1","description":"staging"}],"paths":{"/models":{"get":{"tags":["models"],"summary":"List models","operationId":"list_models_route_models_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"feature","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Feature slug, e.g. `image-generation`","title":"Feature"},"description":"Feature slug, e.g. `image-generation`"},{"name":"output_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(image|video|audio)$"},{"type":"null"}],"title":"Output Type"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"description":"Substring match on id or name","title":"Q"},"description":"Substring match on id or name"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models/{model_id}":{"get":{"tags":["models"],"summary":"Get a model","operationId":"get_model_route_models__model_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model_id","in":"path","required":true,"schema":{"type":"string","title":"Model Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/generations/estimate":{"post":{"tags":["generations"],"summary":"Estimate the credit price of a generation","description":"Validates the input exactly as `POST /v1/generations` would and\nreturns the credits it would charge, without charging. A 400 here is\nthe same 400 the real call would return.","operationId":"estimate_generation_generations_estimate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationEstimateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/generations":{"post":{"tags":["generations"],"summary":"Create a generation","description":"Charges the estimated credits up front (refunded in full if the\ngeneration fails or is cancelled), queues the job and returns it as\n`queued`. Poll `GET /v1/generations/{id}`, pass `wait`, or set\n`webhook_url`.","operationId":"create_generation_generations_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"wait","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":60,"minimum":0},{"type":"null"}],"description":"Seconds to wait for completion before responding (capped server-side)","title":"Wait"},"description":"Seconds to wait for completion before responding (capped server-side)"},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"description":"Replay-safe create","title":"Idempotency-Key"},"description":"Replay-safe create"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["generations"],"summary":"List generations","description":"Newest first. Unlike the app, failed and cancelled generations are\nincluded. Scoped to this API key unless `all_keys=true`.","operationId":"list_generations_generations_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(queued|processing|succeeded|failed|cancelled)$"},{"type":"null"}],"title":"Status"}},{"name":"model","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Model"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`next_cursor` from the previous page","title":"Cursor"},"description":"`next_cursor` from the previous page"},{"name":"all_keys","in":"query","required":false,"schema":{"type":"boolean","description":"Include generations made with other keys","default":false,"title":"All Keys"},"description":"Include generations made with other keys"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/generations/{generation_id}":{"get":{"tags":["generations"],"summary":"Get a generation","operationId":"get_generation_generations__generation_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"generation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Generation Id"}},{"name":"wait","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":60,"minimum":0},{"type":"null"}],"description":"Long-poll: seconds to wait for a terminal status","title":"Wait"},"description":"Long-poll: seconds to wait for a terminal status"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/generations/{generation_id}/cancel":{"post":{"tags":["generations"],"summary":"Cancel a generation","description":"Cancels a queued generation and refunds it. A generation already\nrendering at the provider may not be cancellable (409).","operationId":"cancel_generation_generations__generation_id__cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"generation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Generation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/files":{"post":{"tags":["files"],"summary":"Upload a file","description":"Multipart upload. Limits: images 20 MB, audio 50 MB, video 200 MB.","operationId":"upload_file_files_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_file_files_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["files"],"summary":"List files","operationId":"list_files_files_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(upload|generation)$"},{"type":"null"}],"title":"Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Opaque offset cursor from the previous page","title":"Cursor"},"description":"Opaque offset cursor from the previous page"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/files/from-url":{"post":{"tags":["files"],"summary":"Import a file by URL","description":"Fetches a public http(s) URL server-side and stores it.","operationId":"import_file_from_url_files_from_url_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileFromUrlRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/files/{file_id}":{"get":{"tags":["files"],"summary":"Get a file","operationId":"get_file_files__file_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"File Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["files"],"summary":"Delete a file","description":"Removes the file from your library. The stored bytes are cleaned up\nby storage lifecycle; the URL is not revoked immediately.","operationId":"delete_file_files__file_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"File Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/account":{"get":{"tags":["account"],"summary":"Account, credits and limits","operationId":"get_account_account_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountOut"}}}}},"security":[{"HTTPBearer":[]}]}},"/usage":{"get":{"tags":["account"],"summary":"Credit ledger for API spend","description":"Every charge and refund attributed to API generations, newest\nfirst. `amount` is signed: negative = charge, positive = refund.","operationId":"get_usage_usage_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO-8601 start (inclusive)","title":"From"},"description":"ISO-8601 start (inclusive)"},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO-8601 end (exclusive)","title":"To"},"description":"ISO-8601 end (exclusive)"},{"name":"all_keys","in":"query","required":false,"schema":{"type":"boolean","description":"Include spend from other keys of the org","default":false,"title":"All Keys"},"description":"Include spend from other keys of the org"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`next_cursor` from the previous page","title":"Cursor"},"description":"`next_cursor` from the previous page"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/prompts/enhance":{"post":{"tags":["prompts"],"summary":"Enhance a prompt","operationId":"enhance_prompt_prompts_enhance_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptEnhanceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptEnhanceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/webhooks":{"get":{"tags":["webhooks"],"summary":"List endpoints","operationId":"list_endpoints_webhooks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/WebhookEndpointOut"},"type":"array","title":"Response List Endpoints Webhooks Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["webhooks"],"summary":"Add an endpoint","description":"Events: `generation.succeeded`, `generation.failed`,\n`generation.cancelled` (default: all three). Applies to generations\ncreated through the API.","operationId":"create_endpoint_webhooks_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/webhooks/secret":{"get":{"tags":["webhooks"],"summary":"Signing secret","description":"The `whsec_…` secret every webhook from this organization is\nsigned with (Standard Webhooks headers).","operationId":"get_secret_webhooks_secret_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSecretOut"}}}}},"security":[{"HTTPBearer":[]}]}},"/webhooks/secret/rotate":{"post":{"tags":["webhooks"],"summary":"Rotate the secret","operationId":"rotate_secret_webhooks_secret_rotate_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSecretOut"}}}}},"security":[{"HTTPBearer":[]}]}},"/webhooks/deliveries":{"get":{"tags":["webhooks"],"summary":"Delivery log","operationId":"list_deliveries_webhooks_deliveries_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"generation_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Generation Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDeliveryOut"},"title":"Response List Deliveries Webhooks Deliveries Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/test":{"post":{"tags":["webhooks"],"summary":"Send a signed test event to a URL","operationId":"test_webhook_webhooks_test_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Test Webhook Webhooks Test Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/webhooks/{endpoint_id}":{"get":{"tags":["webhooks"],"summary":"Get an endpoint","operationId":"get_endpoint_webhooks__endpoint_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["webhooks"],"summary":"Update an endpoint","operationId":"update_endpoint_webhooks__endpoint_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["webhooks"],"summary":"Delete an endpoint","operationId":"delete_endpoint_webhooks__endpoint_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studios/voices":{"get":{"tags":["studios"],"summary":"Library voices for text-to-speech","operationId":"voices_studios_voices_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Voices Studios Voices Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/studios/headshot/styles":{"get":{"tags":["studios"],"summary":"Curated headshot styles","operationId":"headshot_styles_studios_headshot_styles_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Headshot Styles Studios Headshot Styles Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/studios/talking-head/sets":{"get":{"tags":["studios"],"summary":"Curated talking-head sets","operationId":"talking_head_sets_studios_talking_head_sets_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Talking Head Sets Studios Talking Head Sets Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/studios/product/templates":{"get":{"tags":["studios"],"summary":"Product ad scene templates","operationId":"product_templates_studios_product_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Product Templates Studios Product Templates Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/studios/characters":{"get":{"tags":["studios"],"summary":"Your saved characters","operationId":"characters_studios_characters_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Characters Studios Characters Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/studios/lipsync":{"post":{"tags":["studios"],"summary":"Lipsync a video to audio","operationId":"lipsync_studios_lipsync_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"wait","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":60,"minimum":0},{"type":"null"}],"description":"Seconds to wait before responding (capped)","title":"Wait"},"description":"Seconds to wait before responding (capped)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LipsyncRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studios/text-to-speech":{"post":{"tags":["studios"],"summary":"Text to speech","operationId":"text_to_speech_studios_text_to_speech_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"wait","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":60,"minimum":0},{"type":"null"}],"description":"Seconds to wait before responding (capped)","title":"Wait"},"description":"Seconds to wait before responding (capped)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextToSpeechRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studios/talking-head/keyframe":{"post":{"tags":["studios"],"summary":"Talking head: keyframe","description":"Step 1 of a talking head: place the person on a set. Then\n`/text-to-speech` for the script and `/talking-head/video` to animate.","operationId":"talking_head_keyframe_studios_talking_head_keyframe_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"wait","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":60,"minimum":0},{"type":"null"}],"description":"Seconds to wait before responding (capped)","title":"Wait"},"description":"Seconds to wait before responding (capped)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TalkingHeadKeyframeRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studios/talking-head/video":{"post":{"tags":["studios"],"summary":"Talking head: animate","operationId":"talking_head_video_studios_talking_head_video_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"wait","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":60,"minimum":0},{"type":"null"}],"description":"Seconds to wait before responding (capped)","title":"Wait"},"description":"Seconds to wait before responding (capped)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TalkingHeadVideoRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studios/headshot":{"post":{"tags":["studios"],"summary":"Professional headshot","operationId":"headshot_studios_headshot_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"wait","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":60,"minimum":0},{"type":"null"}],"description":"Seconds to wait before responding (capped)","title":"Wait"},"description":"Seconds to wait before responding (capped)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeadshotRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studios/cast-swap":{"post":{"tags":["studios"],"summary":"Cast swap (Videozypher)","description":"Replace the people (or objects) in a 4–30 s clip with the people in\nyour photos. Up to 4 subjects, 9 photos in total.","operationId":"cast_swap_studios_cast_swap_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"wait","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":60,"minimum":0},{"type":"null"}],"description":"Seconds to wait before responding (capped)","title":"Wait"},"description":"Seconds to wait before responding (capped)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CastSwapRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studios/try-on":{"post":{"tags":["studios"],"summary":"Fashion try-on","operationId":"try_on_studios_try_on_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"wait","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":60,"minimum":0},{"type":"null"}],"description":"Seconds to wait before responding (capped)","title":"Wait"},"description":"Seconds to wait before responding (capped)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TryOnRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studios/product-shot":{"post":{"tags":["studios"],"summary":"Product ad photo","operationId":"product_shot_studios_product_shot_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"wait","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":60,"minimum":0},{"type":"null"}],"description":"Seconds to wait before responding (capped)","title":"Wait"},"description":"Seconds to wait before responding (capped)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductShotRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AccountOut":{"properties":{"object":{"type":"string","const":"account","title":"Object","default":"account"},"organization":{"additionalProperties":true,"type":"object","title":"Organization"},"subscription":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Subscription"},"credits":{"additionalProperties":true,"type":"object","title":"Credits"},"api_key":{"additionalProperties":true,"type":"object","title":"Api Key"},"limits":{"additionalProperties":true,"type":"object","title":"Limits"}},"type":"object","required":["organization","subscription","credits","api_key","limits"],"title":"AccountOut"},"Body_upload_file_files_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"image, video (mp4/mov/webm) or audio"},"filename":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Filename"}},"type":"object","required":["file"],"title":"Body_upload_file_files_post"},"CastSwapRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Webhook Url"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"source_video_file":{"type":"string","title":"Source Video File"},"subjects":{"items":{"$ref":"#/components/schemas/CastSwapSubject"},"type":"array","maxItems":4,"minItems":1,"title":"Subjects"},"notes":{"type":"string","maxLength":2000,"title":"Notes","default":""},"resolution":{"type":"string","enum":["480p","720p","1080p"],"title":"Resolution","default":"720p"},"keep_original_sound":{"type":"boolean","title":"Keep Original Sound","default":true}},"type":"object","required":["source_video_file","subjects"],"title":"CastSwapRequest"},"CastSwapSubject":{"properties":{"photos":{"items":{"type":"string"},"type":"array","maxItems":4,"minItems":1,"title":"Photos"},"kind":{"type":"string","enum":["person","object"],"title":"Kind","default":"person"},"label":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Label"},"slot":{"anyOf":[{"type":"string","enum":["left","center","right","main","custom"]},{"type":"null"}],"title":"Slot"},"placement":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Placement"}},"type":"object","required":["photos"],"title":"CastSwapSubject"},"FileFromUrlRequest":{"properties":{"url":{"type":"string","maxLength":2048,"title":"Url"},"filename":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Filename"}},"type":"object","required":["url"],"title":"FileFromUrlRequest"},"FileListOut":{"properties":{"object":{"type":"string","const":"list","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/FileOut"},"type":"array","title":"Data"},"has_more":{"type":"boolean","title":"Has More"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["data","has_more"],"title":"FileListOut"},"FileOut":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","const":"file","title":"Object","default":"file"},"type":{"type":"string","enum":["upload","generation"],"title":"Type"},"status":{"type":"string","title":"Status"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"thumbnail_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thumbnail Url"},"mime_type":{"type":"string","title":"Mime Type"},"size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size Bytes"},"width":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Width"},"height":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Height"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"generation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generation Id"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","type","status","mime_type","created_at"],"title":"FileOut"},"GenerationCreateRequest":{"properties":{"model":{"type":"string","title":"Model","description":"Model id from `GET /v1/models`"},"input":{"additionalProperties":true,"type":"object","title":"Input","description":"Model-specific input: `prompt`, parameters, and file ids in input slots"},"webhook_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Webhook Url","description":"Public https URL to POST the terminal event to (signed, Standard Webhooks)"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Free-form client data (≤ 16 keys, string values ≤ 500 chars), echoed back"}},"type":"object","required":["model"],"title":"GenerationCreateRequest"},"GenerationErrorOut":{"properties":{"code":{"type":"string","title":"Code"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["code"],"title":"GenerationErrorOut"},"GenerationEstimateOut":{"properties":{"object":{"type":"string","const":"estimate","title":"Object","default":"estimate"},"model":{"type":"string","title":"Model"},"credits":{"type":"integer","title":"Credits"},"credits_min":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credits Min"},"credits_max":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credits Max"},"validated_input":{"additionalProperties":true,"type":"object","title":"Validated Input"}},"type":"object","required":["model","credits","validated_input"],"title":"GenerationEstimateOut"},"GenerationListOut":{"properties":{"object":{"type":"string","const":"list","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/GenerationOut"},"type":"array","title":"Data"},"has_more":{"type":"boolean","title":"Has More"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["data","has_more"],"title":"GenerationListOut"},"GenerationOut":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","const":"generation","title":"Object","default":"generation"},"status":{"type":"string","enum":["queued","processing","succeeded","failed","cancelled"],"title":"Status"},"model":{"type":"string","title":"Model"},"input":{"additionalProperties":true,"type":"object","title":"Input"},"outputs":{"items":{"$ref":"#/components/schemas/GenerationOutputOut"},"type":"array","title":"Outputs"},"credits_charged":{"type":"integer","title":"Credits Charged"},"credits_refunded":{"type":"integer","title":"Credits Refunded"},"error":{"anyOf":[{"$ref":"#/components/schemas/GenerationErrorOut"},{"type":"null"}]},"progress_percent":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Progress Percent"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url"},"api_key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key Id"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"submitted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Submitted At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"urls":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Urls"}},"type":"object","required":["id","status","model","input","outputs","credits_charged","credits_refunded","metadata"],"title":"GenerationOut"},"GenerationOutputOut":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","title":"Status"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"thumbnail_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thumbnail Url"},"mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mime Type"},"size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size Bytes"},"width":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Width"},"height":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Height"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"}},"type":"object","required":["id","status"],"title":"GenerationOutputOut"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HeadshotRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Webhook Url"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"face_file":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Face File"},"character_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Character Id"},"style_item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Style Item Id","description":"From /v1/studios/headshot/styles"},"controls":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Controls","description":"framing/background/wardrobe/lighting/expression/retouch"},"notes":{"type":"string","maxLength":2000,"title":"Notes","default":""},"aspect":{"type":"string","enum":["3:4","1:1","4:3"],"title":"Aspect","default":"3:4"}},"type":"object","title":"HeadshotRequest"},"LipsyncRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Webhook Url"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"video_file":{"type":"string","title":"Video File","description":"File id of the video (mp4/mov/webm)"},"audio_file":{"type":"string","title":"Audio File","description":"File id of the audio track"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","description":"A lipsync model id; default sync-lipsync-v3"},"length_mode":{"anyOf":[{"type":"string","enum":["cut_off","loop","bounce","silence","remap"]},{"type":"null"}],"title":"Length Mode"},"speaker":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Speaker","description":"{frame, x, y}: pixel of the speaker's face in the source video"}},"type":"object","required":["video_file","audio_file"],"title":"LipsyncRequest"},"ModelCapabilitiesOut":{"properties":{"accepts_prompt":{"type":"boolean","title":"Accepts Prompt","default":true},"supported_aspects":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Supported Aspects"},"supported_durations":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Supported Durations"},"max_prompt_length":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Prompt Length"},"max_outputs":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Outputs"},"supports_characters":{"type":"boolean","title":"Supports Characters","default":false}},"type":"object","title":"ModelCapabilitiesOut"},"ModelInputSlotOut":{"properties":{"kind":{"type":"string","enum":["image","video","audio","file"],"title":"Kind"},"multiple":{"type":"boolean","title":"Multiple","default":false}},"type":"object","required":["kind"],"title":"ModelInputSlotOut","description":"An asset slot: pass a file id from `POST /v1/files` (or the id of a\nprevious generation's output) in this input key."},"ModelListOut":{"properties":{"object":{"type":"string","const":"list","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/ModelSummaryOut"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"ModelListOut"},"ModelOut":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","const":"model","title":"Object","default":"model"},"name":{"type":"string","title":"Name"},"provider":{"type":"string","title":"Provider"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"output_type":{"type":"string","enum":["image","video","audio"],"title":"Output Type"},"features":{"items":{"type":"string"},"type":"array","title":"Features"},"photo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Photo Url"},"pricing":{"additionalProperties":true,"type":"object","title":"Pricing"},"price_range":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Price Range"},"is_featured":{"type":"boolean","title":"Is Featured","default":false},"parameters":{"additionalProperties":{"$ref":"#/components/schemas/ModelParameterOut"},"type":"object","title":"Parameters"},"inputs":{"additionalProperties":{"$ref":"#/components/schemas/ModelInputSlotOut"},"type":"object","title":"Inputs"},"capabilities":{"$ref":"#/components/schemas/ModelCapabilitiesOut"},"tier_pricing":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Tier Pricing"},"example_request":{"additionalProperties":true,"type":"object","title":"Example Request"}},"type":"object","required":["id","name","provider","output_type","features","pricing","parameters","inputs","capabilities","example_request"],"title":"ModelOut"},"ModelParameterOut":{"properties":{"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"enum":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Enum"},"min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min"},"max":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max"},"default":{"title":"Default"},"required":{"type":"boolean","title":"Required","default":false},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"affects_price":{"type":"boolean","title":"Affects Price","default":false}},"type":"object","title":"ModelParameterOut"},"ModelSummaryOut":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","const":"model","title":"Object","default":"model"},"name":{"type":"string","title":"Name"},"provider":{"type":"string","title":"Provider"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"output_type":{"type":"string","enum":["image","video","audio"],"title":"Output Type"},"features":{"items":{"type":"string"},"type":"array","title":"Features"},"photo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Photo Url"},"pricing":{"additionalProperties":true,"type":"object","title":"Pricing"},"price_range":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Price Range"},"is_featured":{"type":"boolean","title":"Is Featured","default":false}},"type":"object","required":["id","name","provider","output_type","features","pricing"],"title":"ModelSummaryOut"},"ProductShotRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Webhook Url"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"product_file":{"type":"string","title":"Product File"},"template_key":{"type":"string","title":"Template Key","description":"From /v1/studios/product/templates"},"brief":{"type":"string","maxLength":2000,"title":"Brief","default":""},"aspect":{"type":"string","enum":["1:1","4:5","9:16","16:9"],"title":"Aspect","default":"1:1"},"num_images":{"type":"integer","maximum":4.0,"minimum":1.0,"title":"Num Images","default":1}},"type":"object","required":["product_file","template_key"],"title":"ProductShotRequest"},"PromptEnhanceOut":{"properties":{"object":{"type":"string","const":"prompt","title":"Object","default":"prompt"},"prompt":{"type":"string","title":"Prompt"},"original":{"type":"string","title":"Original"}},"type":"object","required":["prompt","original"],"title":"PromptEnhanceOut"},"PromptEnhanceRequest":{"properties":{"prompt":{"type":"string","maxLength":8000,"minLength":1,"title":"Prompt"},"kind":{"type":"string","enum":["image","video"],"title":"Kind","default":"image"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","description":"Optional model id to tailor the rewrite"}},"type":"object","required":["prompt"],"title":"PromptEnhanceRequest"},"TalkingHeadKeyframeRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Webhook Url"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"face_file":{"type":"string","title":"Face File"},"set_item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Set Item Id","description":"From /v1/studios/talking-head/sets"},"set_file":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Set File","description":"Or your own background image file id"},"framing":{"type":"string","enum":["close_up","waist_up","wide"],"title":"Framing","default":"waist_up"},"format":{"type":"string","enum":["landscape","portrait"],"title":"Format","default":"landscape"},"notes":{"type":"string","maxLength":2000,"title":"Notes","default":""},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"}},"type":"object","required":["face_file"],"title":"TalkingHeadKeyframeRequest"},"TalkingHeadVideoRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Webhook Url"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"keyframe_file":{"type":"string","title":"Keyframe File"},"speech_file":{"type":"string","title":"Speech File"},"engine":{"type":"string","enum":["kling-ai-avatar-v2","omnihuman-15"],"title":"Engine","default":"kling-ai-avatar-v2"},"motion_prompt":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Motion Prompt"}},"type":"object","required":["keyframe_file","speech_file"],"title":"TalkingHeadVideoRequest"},"TextToSpeechRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Webhook Url"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"text":{"type":"string","maxLength":5000,"minLength":1,"title":"Text"},"voice":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice","description":"A `voice` value from /v1/studios/voices"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"}},"type":"object","required":["text"],"title":"TextToSpeechRequest"},"TryOnRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Webhook Url"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"garment_files":{"items":{"type":"string"},"type":"array","maxItems":4,"minItems":1,"title":"Garment Files"},"person_file":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Person File"},"notes":{"type":"string","maxLength":2000,"title":"Notes","default":""},"gender":{"type":"string","enum":["","Female","Male","Non-binary"],"title":"Gender","default":""},"age":{"type":"string","enum":["","20s","30s","40s","50s","60s+"],"title":"Age","default":""},"build":{"type":"string","maxLength":200,"title":"Build","default":""},"ethnicity":{"type":"string","title":"Ethnicity","default":""},"aspect":{"type":"string","enum":["3:4","1:1","4:3","9:16","16:9"],"title":"Aspect","default":"3:4"}},"type":"object","required":["garment_files"],"title":"TryOnRequest"},"UsageOut":{"properties":{"object":{"type":"string","const":"list","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/UsageRowOut"},"type":"array","title":"Data"},"has_more":{"type":"boolean","title":"Has More"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"totals":{"additionalProperties":true,"type":"object","title":"Totals"}},"type":"object","required":["data","has_more","totals"],"title":"UsageOut"},"UsageRowOut":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","title":"Created At"},"amount":{"type":"integer","title":"Amount"},"reason":{"type":"string","title":"Reason"},"generation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generation Id"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"api_key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key Id"}},"type":"object","required":["id","created_at","amount","reason"],"title":"UsageRowOut"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WebhookDeliveryOut":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","const":"webhook_delivery","title":"Object","default":"webhook_delivery"},"event_type":{"type":"string","title":"Event Type"},"generation_id":{"type":"string","title":"Generation Id"},"target_url":{"type":"string","title":"Target Url"},"endpoint_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Endpoint Id"},"attempts":{"type":"integer","title":"Attempts"},"last_status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Status Code"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"delivered_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivered At"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","event_type","generation_id","target_url","attempts","created_at"],"title":"WebhookDeliveryOut"},"WebhookEndpointCreate":{"properties":{"url":{"type":"string","maxLength":2048,"title":"Url"},"events":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Events"},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Description"}},"type":"object","required":["url"],"title":"WebhookEndpointCreate"},"WebhookEndpointOut":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","const":"webhook_endpoint","title":"Object","default":"webhook_endpoint"},"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","url","events","is_active","created_at"],"title":"WebhookEndpointOut"},"WebhookEndpointUpdate":{"properties":{"url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Url"},"events":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Events"},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Description"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"WebhookEndpointUpdate"},"WebhookSecretOut":{"properties":{"object":{"type":"string","const":"webhook_secret","title":"Object","default":"webhook_secret"},"secret":{"type":"string","title":"Secret"}},"type":"object","required":["secret"],"title":"WebhookSecretOut"},"WebhookTestRequest":{"properties":{"url":{"type":"string","maxLength":2048,"title":"Url"}},"type":"object","required":["url"],"title":"WebhookTestRequest"}},"securitySchemes":{"HTTPBearer":{"type":"http","description":"Affogato API key (`afg_…`)","scheme":"bearer"}}}}