{"openapi":"3.0.0","paths":{"/api/v1/user/me":{"get":{"operationId":"UserController_getUser","parameters":[],"responses":{"200":{"description":"Current user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseDto"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorResponseDto"}}}},"404":{"description":"User not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundErrorResponseDto"}}}},"500":{"description":"Internal Server Error - Server error occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorResponseDto"}}}}},"security":[{"apiKey":[]}],"summary":"Request to get current user","tags":["Account Management"]}},"/api/v1/generation/estimate":{"post":{"operationId":"GenerationController_estimateGenerationCost","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGenerationRequestDto"}}}},"responses":{"200":{"description":"User-specific generation price in cents","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationCostEstimateDto"}}}}},"security":[{"apiKey":[]}],"summary":"Estimate the exact balance charge for a generation request","tags":["Generations"]}},"/api/v1/generation/create":{"post":{"operationId":"GenerationController_createGeneration","parameters":[],"requestBody":{"required":true,"description":"Input data for creating new generation. The input structure depends on the selected model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGenerationRequestDto"}}}},"responses":{"200":{"description":"Success - Request completed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGenerationResponseDto"}}}},"400":{"description":"Bad Request - Invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestErrorResponseDto"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorResponseDto"}}}},"402":{"description":"Payment Required - Insufficient account balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredErrorResponseDto"}}}},"500":{"description":"Internal Server Error - Server error occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorResponseDto"}}}}},"security":[{"apiKey":[]}],"summary":"Create generation request based on model. Returns immediately with a taskId","tags":["Generations"]}},"/api/v1/cost":{"get":{"operationId":"CostController_getAllUserPrices","parameters":[],"responses":{"200":{"description":"Returns all prices grouped by model"}},"summary":"Get all prices by model","tags":["Costs"]}},"/api/v1/cost/{model}":{"get":{"operationId":"CostController_getUserPricesByModel","parameters":[{"name":"model","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Returns prices for specific model"}},"summary":"Get prices for specific model","tags":["Costs"]}},"/api/v1/task/status/{taskId}":{"get":{"description":"Query the execution status of image and video generation tasks and retrieve results when complete","operationId":"TaskController_getTaskStatus","parameters":[{"name":"taskId","required":true,"in":"path","description":"Unique task identifier returned from the submit endpoint","schema":{"example":"task-unified-1757165031-uyujaw3d","type":"string"}}],"responses":{"200":{"description":"Task status retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskStatusResponseDto"}}}},"401":{"description":"Unauthorized - Check your API key"},"404":{"description":"Task not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundErrorResponseDto"},"examples":{"taskNotFound":{"value":{"code":404,"error":{"message":"Task not found","type":"NotFound","code":"task_not_found"}}}}}}}},"security":[{"apiKey":[]}],"summary":"Get task status","tags":["Task Management"]}},"/api/v1/catalog":{"get":{"description":"Models with display metadata, price table and the input parameter schema derived from each model's DTO.","operationId":"CatalogController_getCatalog","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CatalogModelDto"}}}}}},"summary":"Get the public model catalog","tags":["Catalog"]}},"/api/v1/catalog/{id}":{"get":{"operationId":"CatalogController_getModel","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogModelDto"}}}},"404":{"description":"Model not found"}},"summary":"Get one catalog entry by model id","tags":["Catalog"]}},"/api/v1/stats":{"get":{"operationId":"StatsController_getStats","parameters":[{"name":"range","required":false,"in":"query","description":"Preset period; use `custom` together with from/to","schema":{"default":"today","type":"string","enum":["today","7d","30d","custom"]}},{"name":"from","required":false,"in":"query","description":"Start of a custom period (ISO 8601 calendar date)","schema":{"type":"string"}},{"name":"to","required":false,"in":"query","description":"End of a custom period (ISO 8601 calendar date)","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsResponseDto"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorResponseDto"}}}}},"security":[{"apiKey":[]}],"summary":"Usage and spend statistics for the current user","tags":["Account Management"]}},"/api/v1/chat/completions":{"post":{"operationId":"LlmController_createChatCompletion","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequestDto"}}}},"responses":{"200":{"description":"Chat completion. When `stream` is true the response is a `text/event-stream` of deltas.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionResponseDto"}}}},"400":{"description":"Bad Request - unknown model or invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestErrorResponseDto"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorResponseDto"}}}},"402":{"description":"Payment Required - Insufficient account balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredErrorResponseDto"}}}},"500":{"description":"Internal Server Error - Server error occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorResponseDto"}}}}},"security":[{"apiKey":[]}],"summary":"OpenAI-compatible chat completion. Set `stream: true` for server-sent events.","tags":["LLM"]}},"/api/v1/messages":{"post":{"operationId":"LlmController_createMessage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicMessageRequestDto"}}}},"responses":{"200":{"description":"Anthropic message. When `stream` is true the response is a `text/event-stream` of events.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicMessageResponseDto"}}}},"400":{"description":"Bad Request - unknown model or invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestErrorResponseDto"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorResponseDto"}}}},"402":{"description":"Payment Required - Insufficient account balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredErrorResponseDto"}}}},"500":{"description":"Internal Server Error - Server error occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorResponseDto"}}}}},"security":[{"apiKey":[]}],"summary":"Anthropic Messages API-compatible endpoint (Claude models). Set `stream: true` for server-sent events.","tags":["LLM"]}},"/api/v1/models":{"get":{"operationId":"LlmController_listModels","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelListResponseDto"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorResponseDto"}}}}},"security":[{"apiKey":[]}],"summary":"List available chat models with token pricing (USD per 1M tokens)","tags":["LLM"]}}},"info":{"title":"API Stock API","description":"One API, one key and one prepaid balance for video, image, music and\ntext models from many providers.\n\n**Media generation is asynchronous.** `POST /api/v1/generation/create`\nprices the request, debits the balance and returns a `taskId`\nimmediately. Poll `/api/v1/task` or supply a `webhook` to be called on\ncompletion. Results are downloaded to our own storage, so the media\nURLs we return stay valid after the provider expires its own.\n\n**Text generation is synchronous** and speaks the protocols you already\nuse: `POST /api/v1/chat/completions` (OpenAI) and `POST /api/v1/messages`\n(Anthropic).\n\nIf a provider fails, the same generation is retried automatically on a\nreserve provider; when every provider is exhausted the request is\nrefunded in full. Prices are per generation for media and per 1M tokens\nfor text — see `/api/v1/catalog` for the live model list and price table.\n\nAuthenticate with `Authorization: Bearer <your API key>`.","version":"1.0","contact":{}},"tags":[],"servers":[{"url":"https://api.api-stock.com","description":"Production"}],"components":{"securitySchemes":{"apiKey":{"scheme":"bearer","bearerFormat":"API Key","type":"http","description":"Enter your API key"}},"schemas":{"UserData":{"type":"object","properties":{"id":{"type":"string","description":"Internal user ID in the system","example":"01234567-89ab-cdef-0123-456789abcdef"},"balance":{"type":"number","description":"Current user balance in integer USD cents","format":"int32","example":15075},"createdAt":{"type":"string","description":"User creation date","example":"2026-02-28T11:22:33.000Z"}},"required":["id","balance","createdAt"]},"UserResponseDto":{"type":"object","properties":{"code":{"type":"number","description":"HTTP status code","example":200},"data":{"description":"Response data","allOf":[{"$ref":"#/components/schemas/UserData"}]}},"required":["code","data"]},"ErrorDetails":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable cause. English, stable — safe to log, not meant for display to end users in other languages."},"type":{"type":"string","description":"Error type"},"code":{"type":"string","description":"Stable machine-readable code. Match on this rather than on `message` — clients use it to render their own localized wording.","example":"insufficient_balance"}},"required":["message","type","code"]},"UnauthorizedErrorResponseDto":{"type":"object","properties":{"code":{"type":"number","description":"HTTP status code","example":401},"error":{"description":"Error details","allOf":[{"$ref":"#/components/schemas/ErrorDetails"}]}},"required":["code","error"]},"NotFoundErrorResponseDto":{"type":"object","properties":{"code":{"type":"number","description":"HTTP status code","example":404},"error":{"description":"Error details","allOf":[{"$ref":"#/components/schemas/ErrorDetails"}]}},"required":["code","error"]},"InternalServerErrorResponseDto":{"type":"object","properties":{"code":{"type":"number","description":"HTTP status code","example":500},"error":{"description":"Error details","allOf":[{"$ref":"#/components/schemas/ErrorDetails"}]}},"required":["code","error"]},"Sora2InputDto":{"type":"object","properties":{"prompt":{"type":"string","description":"User's prompt"},"aspectRatio":{"type":"string","description":"Aspect ratio","enum":["16:9","9:16"],"default":"16:9"},"urls":{"description":"Image URLs for video generation","type":"array","items":{"type":"string"}},"duration":{"type":"number","description":"Video duration in seconds","default":10,"enum":[10,15,25]}},"required":["prompt"]},"Sora2OfficialInputDto":{"type":"object","properties":{"prompt":{"type":"string","description":"User's prompt"},"aspectRatio":{"type":"string","description":"Aspect ratio","enum":["16:9","9:16"],"default":"16:9"},"urls":{"description":"Reference image URLs (max 1)","maxItems":1,"type":"array","items":{"type":"string"}},"duration":{"type":"number","description":"Video duration in seconds","default":4,"enum":[4,8,12,16,20]}},"required":["prompt"]},"Veo3InputDto":{"type":"object","properties":{"prompt":{"type":"string","description":"User's prompt"},"aspectRatio":{"type":"string","description":"Aspect ratio","enum":["16:9","9:16"],"default":"16:9"},"urls":{"description":"Image URLs for video generation","type":"array","items":{"type":"string"}},"resolution":{"type":"string","description":"Video resolution quality","enum":["720p","1080p","4k"],"default":"1080p"},"generationType":{"type":"string","description":"Generation type for VEO3 model","enum":["frame","reference"]}},"required":["prompt"]},"Veo3LiteInputDto":{"type":"object","properties":{"prompt":{"type":"string","description":"User's prompt"},"aspectRatio":{"type":"string","description":"Aspect ratio","enum":["16:9","9:16"],"default":"16:9"},"resolution":{"type":"string","description":"Video resolution quality","enum":["720p","1080p","4k"],"default":"1080p"}},"required":["prompt"]},"NanoBananaInputDto":{"type":"object","properties":{"prompt":{"type":"string","description":"User's prompt"},"urls":{"description":"Reference image URLs for image generation or editing","type":"array","items":{"type":"string"}},"size":{"type":"string","description":"Output image size ratio","enum":["1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9","1:4","1:8","4:1","8:1"],"default":"16:9"},"resolution":{"type":"string","description":"Output image resolution","enum":["512px","1K","2K","4K"],"default":"1K"}},"required":["prompt"]},"GrokImagineInputDto":{"type":"object","properties":{"prompt":{"type":"string","description":"Video content description"},"size":{"type":"string","description":"Video aspect ratio / size","enum":["16:9","9:16","1:1","3:2","2:3"],"default":"16:9"},"duration":{"type":"number","description":"Video duration in seconds","enum":[6,10,15,20,25,30],"default":6},"resolution":{"type":"string","description":"Video resolution","enum":["480p","720p"],"default":"480p"},"urls":{"description":"Reference image URLs for image-to-video mode","type":"array","items":{"type":"string"}}},"required":["prompt"]},"GrokImagineImageInputDto":{"type":"object","properties":{"prompt":{"type":"string","description":"Text description for image generation"},"size":{"type":"string","description":"Image aspect ratio","enum":["1:1","16:9","9:16","3:2","2:3"],"default":"1:1"},"urls":{"description":"Reference image URLs for image-to-image mode","maxItems":1,"type":"array","items":{"type":"string"}}},"required":["prompt"]},"GrokImagine2ImageInputDto":{"type":"object","properties":{"prompt":{"type":"string","description":"Text description for image generation"},"size":{"type":"string","description":"Image aspect ratio","enum":["1:1","2:3","3:2","3:4","4:3","9:16","16:9"],"default":"1:1"}},"required":["prompt"]},"SeedanceImageWithRole":{"type":"object","properties":{"url":{"type":"string","description":"Image URL"},"role":{"type":"string","description":"Image role: first_frame or last_frame","enum":["first_frame","last_frame"]}},"required":["url","role"]},"SeedanceToolDto":{"type":"object","properties":{"type":{"type":"string","description":"Generation enhancement tool","enum":["web_search"]}},"required":["type"]},"SeedanceInputDto":{"type":"object","properties":{"prompt":{"type":"string","description":"Video content description. Required unless image or video reference media is provided (maximum 4000 characters).","maxLength":4000},"duration":{"type":"number","description":"Video duration in seconds (4-15)","default":5,"minimum":4,"maximum":15},"size":{"type":"string","description":"Video aspect ratio. adaptive follows the input image or video.","enum":["adaptive","16:9","9:16","1:1","4:3","3:4","21:9"],"default":"16:9"},"resolution":{"type":"string","description":"Output resolution and per-second billing tier","enum":["480p","720p","1080p","4k"],"default":"480p"},"seed":{"type":"number","description":"Random seed for controlling randomness"},"generateAudio":{"type":"boolean","description":"Whether to generate audio","default":true},"nsfwCheck":{"type":"boolean","description":"Run Apimart prompt/image moderation before generation","default":false},"returnLastFrame":{"type":"boolean","description":"Whether to return the last frame image","default":false},"imageUrls":{"description":"Public image URLs for image-to-video (maximum 9)","maxItems":9,"type":"array","items":{"type":"string"}},"imageWithRoles":{"description":"Images with explicit first_frame / last_frame roles. Cannot be combined with other reference-media fields.","maxItems":2,"type":"array","items":{"$ref":"#/components/schemas/SeedanceImageWithRole"}},"videoUrls":{"description":"Public reference-video URLs (maximum 3; total duration must be more than 1.8s and less than 15.2s). Their duration is probed before charging.","maxItems":3,"type":"array","items":{"type":"string"}},"audioUrls":{"description":"Public reference-audio URLs (maximum 3; 15 seconds total). Requires imageUrls or videoUrls.","maxItems":3,"type":"array","items":{"type":"string"}},"tools":{"description":"Optional enhancements such as web search grounding","type":"array","items":{"$ref":"#/components/schemas/SeedanceToolDto"}}}},"Seedance25ImageWithRoleDto":{"type":"object","properties":{"url":{"type":"string","description":"Public image URL"},"role":{"type":"string","description":"Frame or reference role assigned to this image","enum":["first_frame","last_frame","reference_image"]}},"required":["url","role"]},"Seedance25ToolDto":{"type":"object","properties":{"type":{"type":"string","description":"Generation enhancement tool","enum":["web_search"]}},"required":["type"]},"Seedance25InputDto":{"type":"object","properties":{"prompt":{"type":"string","description":"Video prompt. Reference images, videos and audio positionally in the prompt."},"duration":{"type":"number","description":"Output duration in seconds (4-30). For reference-video jobs, input and output seconds use the reference-input tariff.","default":5,"minimum":4,"maximum":30},"size":{"type":"string","description":"Output aspect ratio. First/last-frame and extend jobs require adaptive.","enum":["adaptive","16:9","4:3","1:1","3:4","9:16","21:9"],"default":"adaptive"},"resolution":{"type":"string","description":"Output resolution and per-second billing tier","enum":["480p","720p","1080p"],"default":"480p"},"generateAudio":{"type":"boolean","description":"Whether the generated video includes audio","default":true},"nsfwCheck":{"type":"boolean","description":"Run prompt/image moderation before generation","default":false},"watermark":{"type":"boolean","description":"Add an AI-generated watermark","default":false},"seed":{"type":"number","description":"Random seed; identical output is not guaranteed"},"outputFormat":{"type":"string","description":"Output video container","enum":["mp4","mov"],"default":"mp4"},"omniReferenceTaskType":{"type":"string","description":"Optional task-type hint. edit is unavailable until variable-duration billing settlement is supported.","enum":["auto","reference","extend"],"default":"auto"},"imageUrls":{"description":"Reference image URLs (maximum 30 across both image fields)","maxItems":30,"type":"array","items":{"type":"string"}},"imageWithRoles":{"description":"Images with explicit first_frame, last_frame or reference_image roles","maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/Seedance25ImageWithRoleDto"}},"videoUrls":{"description":"Public reference-video URLs (maximum 10; 2-30 seconds each and 30 seconds total). Their duration is probed before charging.","maxItems":10,"type":"array","items":{"type":"string"}},"audioUrls":{"description":"Reference audio URLs (maximum 10; 30 seconds total)","maxItems":10,"type":"array","items":{"type":"string"}},"returnLastFrame":{"type":"boolean","description":"Return the output's last frame for chaining","default":false},"tools":{"description":"Optional enhancements such as web search grounding","type":"array","items":{"$ref":"#/components/schemas/Seedance25ToolDto"}}},"required":["prompt"]},"Seedance15ProInputDto":{"type":"object","properties":{"prompt":{"type":"string","description":"Video content description. Required for text-to-video; optional when image input is provided (maximum 4000 characters).","maxLength":4000},"duration":{"type":"number","description":"Video duration in seconds","default":4,"minimum":4,"maximum":15,"enum":[4,8,12]},"size":{"type":"string","description":"Video aspect ratio","enum":["16:9","9:16","1:1","4:3","3:4","21:9"],"default":"16:9"},"resolution":{"type":"string","description":"Video resolution","enum":["480p","720p","1080p"],"default":"480p"},"seed":{"type":"number","description":"Random seed for controlling randomness"},"generateAudio":{"type":"boolean","description":"Whether to generate audio","default":true},"imageUrls":{"description":"Public image URLs for image-to-video (maximum 9)","maxItems":9,"type":"array","items":{"type":"string"}},"imageWithRoles":{"description":"Images with explicit first_frame / last_frame roles. Cannot be combined with other reference-media fields.","maxItems":2,"type":"array","items":{"$ref":"#/components/schemas/SeedanceImageWithRole"}},"cameraFixed":{"type":"boolean","description":"Whether to fix the camera position","default":false}}},"GptImageInputDto":{"type":"object","properties":{"prompt":{"type":"string","description":"User's prompt"},"urls":{"description":"Reference image URLs (URLs or base64 data URIs) for image-to-image mode","type":"array","items":{"type":"string"}},"size":{"type":"string","description":"Output image aspect ratio. For GPT Image 2.5 models, 1:3 and 3:1 require 2k or 4k resolution.","enum":["auto","1:1","16:9","9:16","4:3","3:4","3:2","2:3","5:4","4:5","2:1","1:2","3:1","1:3","21:9","9:21"],"default":"1:1"},"resolution":{"type":"string","description":"Output image resolution","enum":["1k","2k","4k"],"default":"1k"}},"required":["prompt"]},"KlingMotionControlInputDto":{"type":"object","properties":{"prompt":{"type":"string","description":"Optional scene prompt"},"imageUrls":{"description":"Reference image URL (exactly one). JPG/JPEG/PNG, max 10MB","minItems":1,"maxItems":1,"type":"array","items":{"type":"string"}},"videoUrls":{"description":"Reference video URL (exactly one). MP4/MOV, max 100MB","minItems":1,"maxItems":1,"type":"array","items":{"type":"string"}},"characterOrientation":{"type":"string","description":"Character orientation mode. Determines whose orientation drives the motion transfer","enum":["image","video"]},"resolution":{"type":"string","description":"Output resolution","enum":["720p","1080p"],"default":"720p"}},"required":["imageUrls","videoUrls","characterOrientation"]},"PixverseInputDto":{"type":"object","properties":{"prompt":{"type":"string","description":"Video content description","maxLength":5000},"resolution":{"type":"string","description":"Video resolution tier (affects pricing)","enum":["360p","540p","720p","1080p"],"default":"360p"},"duration":{"type":"number","description":"Video duration in seconds (1-15). Transition mode only supports 5 or 8","default":5},"size":{"type":"string","description":"Video aspect ratio. Only effective in text-to-video and multi-reference fusion modes","enum":["16:9","4:3","1:1","3:4","9:16","2:3","3:2","21:9"],"default":"16:9"},"seed":{"type":"number","description":"Random seed","default":0},"negativePrompt":{"type":"string","description":"Negative prompt to exclude unwanted content","maxLength":2048},"audio":{"type":"boolean","description":"Whether to generate an audio track (increases pricing)","default":false},"watermark":{"type":"boolean","description":"Whether to add a watermark in the bottom-right corner","default":false},"motionMode":{"type":"string","description":"Motion mode. pixverse-v6 only supports \"normal\"","enum":["normal"]},"generateMultiClipSwitch":{"type":"boolean","description":"Whether to generate a multi-clip continuous video. Only supported in text-to-video and image-to-video modes","default":false},"imageUrls":{"description":"Input image URL array for image-to-video mode (only the first image is used)","type":"array","items":{"type":"string"}},"firstFrameImage":{"type":"string","description":"First frame image URL for transition mode. Must be provided together with lastFrameImage"},"lastFrameImage":{"type":"string","description":"Last frame image URL for transition mode. Must be provided together with firstFrameImage"},"imgReferences":{"description":"Reference image URLs for multi-reference fusion mode (1-7 images)","minItems":1,"maxItems":7,"type":"array","items":{"type":"string"}},"extendFromTaskId":{"type":"string","description":"Source task ID for video extension mode"}},"required":["prompt"]},"SeedreamInputDto":{"type":"object","properties":{"prompt":{"type":"string","description":"Text description for image generation"},"urls":{"description":"Reference image URLs (URLs or base64 data URIs) for image-to-image mode","maxItems":14,"type":"array","items":{"type":"string"}},"size":{"type":"string","description":"Image aspect ratio","enum":["1:1","4:3","3:4","16:9","9:16","3:2","2:3","21:9","9:21","auto"],"default":"1:1"},"resolution":{"type":"string","description":"Image resolution","enum":["1K","2K","3K","4K"],"default":"2K"},"outputFormat":{"type":"string","description":"Output image format (doubao-seedream-5-0-lite / doubao-seedream-5-0-pro only; ignored by other models)","enum":["jpeg","png"],"default":"jpeg"},"promptOptimizeMode":{"type":"string","description":"Prompt optimization mode (doubao-seedream-4-5 only; ignored by other models)","enum":["standard","fast"],"default":"standard"},"watermark":{"type":"boolean","description":"Whether to add a watermark to the generated image","default":false}},"required":["prompt"]},"Wan27VideoInputDto":{"type":"object","properties":{"prompt":{"type":"string","description":"Text prompt. Required for text-to-video, reference-to-video and edit-video; optional for image-to-video."},"imageUrls":{"description":"Image-to-video frames. First URL is the starting frame, an optional second URL is the ending frame. Providing this selects the image-to-video workflow.","maxItems":2,"type":"array","items":{"type":"string"}},"referenceImageUrls":{"description":"Reference images for the reference-to-video workflow. Requires a prompt.","type":"array","items":{"type":"string"}},"referenceVideoUrls":{"description":"Reference videos for the reference-to-video workflow. Requires a prompt.","type":"array","items":{"type":"string"}},"editVideoUrl":{"type":"string","description":"Source video to edit. Providing this selects the edit-video workflow (requires a prompt)."},"referenceImageUrl":{"type":"string","description":"Optional reference image guiding the edit-video workflow."},"continueVideoUrl":{"type":"string","description":"Source video to continue or extend. Selects the video-continuation workflow. Cannot be combined with imageUrls or audioUrl. Supported duration is 2-10 seconds."},"audioUrl":{"type":"string","description":"Optional audio URL (text-to-video and image-to-video workflows)."},"size":{"type":"string","description":"Aspect ratio (text-to-video, reference-to-video and edit-video). Ignored for image-to-video, where it is derived from the input frames.","enum":["16:9","9:16","1:1","4:3","3:4"],"default":"16:9"},"resolution":{"type":"string","description":"Output resolution","enum":["720p","1080p"],"default":"720p"},"duration":{"type":"number","description":"Video duration in seconds (2-15). Allowed values depend on the resolved workflow: text-to-video accepts 5/10/15, image-to-video 2-15, reference-to-video 2-10, edit-video 0 or 2-10 (0 lets PoYo detect the source video duration)."},"multiShots":{"type":"boolean","description":"Enable multi-shot generation (image, reference and edit workflows)."},"audioSetting":{"type":"string","description":"Audio setting for the edit-video workflow."},"seed":{"type":"number","description":"Random seed for controlling randomness"},"enableSafetyChecker":{"type":"boolean","description":"Enable the model's safety checker"}}},"Wan30ImageWithRoleDto":{"type":"object","properties":{"url":{"type":"string","description":"Image address (public URL or data:image/...;base64,...)"},"role":{"type":"string","description":"Role of the image. first_frame/last_frame belong to the frame family, reference_image to the reference family; the two cannot be mixed.","enum":["first_frame","last_frame","reference_image"]}},"required":["url"]},"Wan30VideoInputDto":{"type":"object","properties":{"prompt":{"type":"string","description":"Text description. Required unless at least one media input is supplied. In reference mode you can address assets positionally with \"图N / 视频N / 音频N\" labels; indices run per media type.","maxLength":20000},"imageUrls":{"description":"Image URLs without explicit roles. In the frame family the first item is the start frame and an optional second is the end frame; in the reference family every item is a reference image (up to 10).","maxItems":10,"type":"array","items":{"type":"string"}},"imageWithRoles":{"description":"Images with explicit roles. Use this when you need first/last frame or reference images stated outright rather than inferred from order.","maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/Wan30ImageWithRoleDto"}},"videoUrls":{"description":"Reference videos, up to 5 clips of 1-15s each (total <= 15s). Input video duration plus the requested output duration must stay within 30 seconds.","maxItems":5,"type":"array","items":{"type":"string"}},"audioUrls":{"description":"Reference audio, up to 5 clips of 1-15s each (total <= 15s).","maxItems":5,"type":"array","items":{"type":"string"}},"fileUrl":{"type":"string","description":"Reference document driving the generation (docx/xlsx/pptx/pdf/txt/md and similar, <=100MB, <=50 pages). Cannot be combined with linkUrl. A prompt is optional when this is supplied."},"linkUrl":{"type":"string","description":"Public, login-free web page to turn into a video. Cannot be combined with fileUrl."},"generationType":{"type":"string","description":"How bare imageUrls are classified: frame (first/last frame) or reference. Omit to let it be inferred — reference when the request already carries reference-family inputs, frame otherwise.","enum":["frame","reference"]},"size":{"type":"string","description":"Aspect ratio. `adaptive` lets the model pick one from the inputs.","enum":["adaptive","16:9","4:3","1:1","3:4","9:16"],"default":"adaptive"},"resolution":{"type":"string","description":"Output resolution. Each tier is billed at its own per-second rate, so 1080p costs four times 480p for the same duration.","enum":["480p","720p","1080p"],"default":"480p"},"duration":{"type":"number","description":"Duration in seconds (2-30). Billing is per second at the resolution's rate. With reference videos, total input video duration plus this value must be at most 30 seconds.","default":5,"minimum":2,"maximum":30},"audio":{"type":"boolean","description":"Include an audio track in the output.","default":true},"watermark":{"type":"boolean","description":"Add a watermark to the output","default":false},"seed":{"type":"number","description":"Random seed for controlling randomness","minimum":0,"maximum":2147483647}}},"ZImageInputDto":{"type":"object","properties":{"prompt":{"type":"string","description":"Text description for image generation","maxLength":1000},"urls":{"description":"Optional reference image for editing (exactly one URL). Providing it switches the request to image editing.","maxItems":1,"type":"array","items":{"type":"string"}},"size":{"type":"string","description":"Image aspect ratio. Required for text-to-image; optional for image editing (defaults to following the reference image).","enum":["1:1","4:3","3:4","16:9","9:16"],"default":"1:1"},"enableSafetyChecker":{"type":"boolean","description":"Enable the model's safety checker (defaults to true)"}},"required":["prompt"]},"Wan27ImageInputDto":{"type":"object","properties":{"prompt":{"type":"string","description":"Text description for image generation","maxLength":5000},"urls":{"description":"Reference images for editing (1-4 URLs). Providing them switches the request to edit mode. Order matters: reference them as image 1, image 2, etc. in the prompt.","minItems":1,"maxItems":4,"type":"array","items":{"type":"string"}},"size":{"type":"string","description":"Output aspect ratio (ignored when width + height are provided)","enum":["1:1","16:9","9:16","4:3","3:4","3:2","2:3"],"default":"1:1"},"width":{"type":"number","description":"Custom output width in pixels (requires height). Overrides size."},"height":{"type":"number","description":"Custom output height in pixels (requires width). Overrides size."},"seed":{"type":"number","description":"Random seed for reproducible output"}},"required":["prompt"]},"MidjourneyInputDto":{"type":"object","properties":{"action":{"type":"string","description":"Midjourney action / endpoint. Defaults to 'imagine' (text-to-image). Follow-up actions reference a previous generation via 'parentTaskId'.","enum":["imagine","edits","blend","describe","upscale","variation","high-variation","low-variation","reroll","zoom","pan","inpaint","modal","remix-strong","remix-subtle"],"default":"imagine"},"prompt":{"type":"string","description":"Prompt; required for imagine/edits. Native MJ flags allowed (e.g. '--ar 16:9 --v 6.1'). Structured body fields override prompt flags."},"imageUrls":{"description":"Image URLs or base64 data URIs. Used as: image-guided (imagine), source (edits), blend set (2–4), describe (1).","maxItems":16,"type":"array","items":{"type":"string"}},"parentTaskId":{"type":"string","description":"Parent generation id (a previous 'midjourney' generation in our system) for follow-up actions (upscale/variation/reroll/zoom/pan/inpaint/modal/remix). The upstream task id is resolved from it."},"index":{"type":"number","description":"Tile index (1–4) for upscale/variation/zoom/pan/inpaint/remix when 'customId' is not provided.","minimum":1,"maximum":4},"customId":{"type":"string","description":"Raw MJ button id for the action; when set, 'index'/'direction' matching is skipped."},"speed":{"type":"string","description":"Speed mode. 'relax' (default) adds no billing suffix.","enum":["relax","fast","turbo"],"default":"relax"},"direction":{"type":"string","description":"Pan direction (action=pan).","enum":["left","right","up","down"]},"zoomRatio":{"type":"number","description":"Zoom factor (action=zoom). < 2 → Zoom Out 1.5x; omitted or >= 2 → 2x."},"maskUrl":{"type":"string","description":"Mask image URL or base64 (action=modal). White = repaint, transparent = keep."},"dimensions":{"type":"string","description":"Aspect preset for blend (action=blend); overridden by 'size'.","enum":["SQUARE","PORTRAIT","LANDSCAPE"],"default":"SQUARE"},"size":{"type":"string","description":"Aspect ratio 'w:h' (--ar), e.g. '16:9', '1:1', '21:9'."},"quality":{"type":"string","description":"Quality (--q).","enum":["0.25","0.5","1","2"]},"style":{"type":"string","description":"Style (--style), e.g. 'raw'."},"version":{"type":"string","description":"Main MJ version (--v). With 'niji: true' and '7'/'6' it normalizes to Niji.","enum":["8.1","7","6.1","5.2","5.1"]},"seed":{"type":"number","description":"Seed (--seed)."},"negativePrompt":{"type":"string","description":"Negative prompt (--no), e.g. 'ugly, blurry'."},"stylize":{"type":"number","description":"Stylize (--s), 0–1000."},"chaos":{"type":"number","description":"Chaos (--c), 0–100."},"weird":{"type":"number","description":"Weird (--w), 0–3000."},"tile":{"type":"boolean","description":"Tile mode (--tile)."},"niji":{"type":"boolean","description":"Niji switch (--niji). Use with version 7/6."},"iw":{"type":"number","description":"Image weight (--iw), 0–3."},"cw":{"type":"number","description":"Character weight (--cw), 0–100."},"sw":{"type":"number","description":"Style weight (--sw), 0–1000."},"cref":{"type":"string","description":"Character reference URL (--cref)."},"sref":{"type":"string","description":"Style reference URL (--sref)."},"dref":{"type":"string","description":"Depth reference URL (--dref)."},"dw":{"type":"number","description":"Depth weight (--dw), 0–100."},"repeat":{"type":"number","description":"Repeat (--repeat), 2–40."},"raw":{"type":"boolean","description":"Raw style (--raw), v5.1+."},"draft":{"type":"boolean","description":"Draft mode (--draft), v7+."},"hd":{"type":"boolean","description":"HD mode (--hd), v8/v8.1 only."},"stop":{"type":"number","description":"Early stop (--stop), 10–100; v5–6.1 / niji 5–6 only."},"extra":{"type":"string","description":"Escape hatch appended to the prompt verbatim (any '--xxx')."}}},"MidjourneyVideoInputDto":{"type":"object","properties":{"prompt":{"type":"string","description":"Video prompt; optional when reusing a parent task."},"imageUrls":{"description":"First-frame image (1 image, URL or base64). One of imageUrls / parentTaskId.","maxItems":1,"type":"array","items":{"type":"string"}},"parentTaskId":{"type":"string","description":"Parent generation id (a SUCCESS 'midjourney' imagine generation) to reuse as the source. One of imageUrls / parentTaskId."},"index":{"type":"number","description":"Which tile of the parent imagine grid is the first frame (0–3).","minimum":0,"maximum":3},"videoType":{"type":"string","description":"Resolution / mode tier. 720 tiers bill at the 720p rate.","enum":["vid_1.1_i2v_480","vid_1.1_i2v_720","vid_1.1_i2v_start_end_480","vid_1.1_i2v_start_end_720"],"default":"vid_1.1_i2v_480"},"animateMode":{"type":"string","description":"Animation mode. 'auto' requires parentTaskId + index.","enum":["manual","auto"],"default":"manual"},"motion":{"type":"string","description":"Motion amount. No billing impact.","enum":["low","high"],"default":"high"},"batchSize":{"type":"number","description":"Batch size (1 / 2 / 4). Billed × N.","enum":[1,2,4],"default":1},"endUrl":{"type":"string","description":"End frame; when set, videoType auto-upgrades to a start/end tier."}}},"SunoCustomModelDto":{"type":"object","properties":{"name":{"type":"string","description":"Custom model name"},"audioUrls":{"description":"Audio URLs to train on (6–24)","type":"array","items":{"type":"string"}}},"required":["name","audioUrls"]},"SunoInputDto":{"type":"object","properties":{"action":{"type":"string","description":"Suno operation","enum":["music","extend","cover","add-instrumental","add-vocals","sound","stems","stems-all","wav","lyrics","voice","timestamped-lyrics","boost-style","music-cover","replace-section","music-video","inspo","upload","remaster","add-stem","vox","remove-section","crop","fade-in","fade-out","adjust-speed","concat","mashup","sample","midi","bpm"],"default":"music"},"mv":{"type":"string","description":"Engine version. Audio actions: v3.5 | v4.0 | v4.5 | v4.5+ | v5.0 | v5.5 | custom. lyrics: remi-v1 | default. Not used by stems/stems-all/wav/voice.","example":"v4.5+"},"custom":{"type":"boolean","description":"false for simple mode, true for custom mode"},"gptDescriptionPrompt":{"type":"string","description":"Simple mode: song / effect description (with optional lyrics)"},"prompt":{"type":"string","description":"Custom mode: detailed lyrics / prompt (also the lyrics or sound description)"},"tags":{"type":"string","description":"Custom mode: genre / style tags"},"title":{"type":"string","description":"Title for the result"},"makeInstrumental":{"type":"boolean","description":"Generate an instrumental-only track","default":false},"negativeTags":{"type":"string","description":"Styles to avoid (custom mode / sound)"},"personaId":{"type":"string","description":"ID of a custom voice (persona) to sing the generated music"},"customModel":{"description":"Inline custom model definition (required when mv=custom)","allOf":[{"$ref":"#/components/schemas/SunoCustomModelDto"}]},"audioUrl":{"type":"string","description":"Audio file URL to operate on"},"continueAt":{"type":"number","description":"extend: time in seconds where the extension should begin"},"sourceTaskId":{"type":"string","description":"Reference to one of your prior Suno generations (its taskId), used by stateful actions such as extend, music-cover, replace-section, timestamped-lyrics, music-video, voice and wav."},"audioId":{"type":"string","description":"The track to operate on, identified by its id (as returned in a prior generation's `output.tracks[].audioId`). A generation usually produces 2 tracks; omit to use the first."},"fullLyrics":{"type":"string","description":"replace-section: complete lyrics for the whole track after the edit"},"author":{"type":"string","description":"music-video: artist / creator name on the cover (max 50)"},"domainName":{"type":"string","description":"music-video: brand / site watermark at the bottom (max 50)"},"aspectRatio":{"type":"string","description":"music-video: output aspect ratio","enum":["9:16","16:9","1:1","3:4","4:3"],"default":"9:16"},"backgroundColors":{"description":"music-video: 1–4 hex colors for the blurred gradient backdrop (e.g. [\"#1B2635\", \"#8A6A4F\"])","type":"array","items":{"type":"string"}},"imageUrl":{"type":"string","description":"music-video: cover image URL to show inside the ring (default: the source track's cover art when available)"},"quality":{"type":"string","description":"music-video: output quality. `compact` — small share-friendly file (~5MB / 3 min); `high` — sharper 720p-class output at roughly double the size; `max` — 1080p-class, ~4× compact","enum":["compact","high","max"],"default":"compact"},"startS":{"type":"number","description":"Start time (seconds) of the affected range. Used by remove-section / crop / sample (the range), replace-section (the infill range) and vox / voice-from-track (the vocal window)."},"endS":{"type":"number","description":"End time (seconds) of the affected range (> startS). See startS for the actions that use it."},"bpm":{"type":"number","description":"sound: tempo in BPM"},"key":{"type":"string","description":"sound: musical key (Major C–B; Minor Cm–Bm)"},"type":{"type":"string","description":"sound: 'one-shot' or 'loop' (defaults to one-shot)","enum":["one-shot","loop"]},"voiceAudioUrl":{"type":"string","description":"voice: URL to the voice recording"},"verificationAudioUrl":{"type":"string","description":"voice: URL to the verification-phrase recording"},"phraseId":{"type":"string","description":"voice: phrase ID from the verification-phrase endpoint"},"name":{"type":"string","description":"voice: voice name"},"description":{"type":"string","description":"voice: description"},"styles":{"type":"string","description":"voice: genre tags (e.g. 'funk edm')"},"singerSkillLevel":{"type":"string","description":"voice: singer skill level","enum":["Beginner","Intermediate","Advanced","Professional"]},"audioUrls":{"description":"inspo: 1–4 public audio URLs used as inspiration references","type":"array","items":{"type":"string"}},"styleWeight":{"type":"number","description":"Style weight (0.00–1.00)"},"weirdnessConstraint":{"type":"number","description":"Creativity / weirdness weight (0.00–1.00)"},"audioWeight":{"type":"number","description":"Audio weight (0.00–1.00)"},"vocalGender":{"type":"string","description":"Vocal gender: Male or Female","enum":["Male","Female"]},"autoLyrics":{"type":"boolean","description":"inspo: rewrite the provided lyrics creatively"},"variationCategory":{"type":"string","description":"remaster: intensity (subtle / normal / high)","enum":["subtle","normal","high"]},"stemType":{"type":"string","description":"stems: which stem to extract (e.g. lead_vocal, backing_vocals, drum_kit, bass, piano, electric_guitar). Defaults to lead_vocal."},"voxAudioId":{"type":"string","description":"voice (persona from a track): id obtained from a prior vox extraction; the startS/endS must match that vox's clip range."},"durationS":{"type":"number","description":"fade-in / fade-out: fade duration in seconds"},"speed":{"type":"number","description":"adjust-speed: speed multiplier (0.25–4)"},"keepPitch":{"type":"boolean","description":"adjust-speed: keep the original pitch (defaults to true)"},"sourceTaskIds":{"description":"mashup: exactly 2 prior suno generation ids (taskIds) to remix together","type":"array","items":{"type":"string"}},"audioIds":{"description":"mashup: parallel array to sourceTaskIds selecting the track in each source by its audioId (as returned in output.tracks[].audioId); omit an entry to use that source's first track","type":"array","items":{"type":"string"}}}},"CreateGenerationRequestDto":{"type":"object","properties":{"model":{"type":"string","description":"Model of generation","enum":["sora2","sora2-pro","sora-2-official","veo3.1-fast","veo3.1-quality","veo3.1-lite","nano-banana","nano-banana-pro","nano-banana-2","nano-banana-2-lite","grok-imagine-1.5-video","grok-imagine-1.5-image","grok-imagine-2.0-image","doubao-seedance-2.0","doubao-seedance-2.0-fast","doubao-seedance-2.0-mini","doubao-seedance-2.5","doubao-seedance-1-5-pro","gpt-image-2","gpt-image-2.5-sunburst","gpt-image-2.5-flare","kling-3.0-motion-control","pixverse-v6","doubao-seedream-5-0-lite","doubao-seedream-5-0-pro","doubao-seedream-4-5","wan2.7-video","wan3.0-video","z-image","wan2.7-image","wan2.7-image-pro","midjourney","midjourney-video","suno"]},"input":{"description":"Generation parameters (structure depends on the model)","oneOf":[{"$ref":"#/components/schemas/Sora2InputDto"},{"$ref":"#/components/schemas/Sora2OfficialInputDto"},{"$ref":"#/components/schemas/Veo3InputDto"},{"$ref":"#/components/schemas/Veo3LiteInputDto"},{"$ref":"#/components/schemas/NanoBananaInputDto"},{"$ref":"#/components/schemas/GrokImagineInputDto"},{"$ref":"#/components/schemas/GrokImagineImageInputDto"},{"$ref":"#/components/schemas/GrokImagine2ImageInputDto"},{"$ref":"#/components/schemas/SeedanceInputDto"},{"$ref":"#/components/schemas/Seedance25InputDto"},{"$ref":"#/components/schemas/Seedance15ProInputDto"},{"$ref":"#/components/schemas/GptImageInputDto"},{"$ref":"#/components/schemas/KlingMotionControlInputDto"},{"$ref":"#/components/schemas/PixverseInputDto"},{"$ref":"#/components/schemas/SeedreamInputDto"},{"$ref":"#/components/schemas/Wan27VideoInputDto"},{"$ref":"#/components/schemas/Wan30VideoInputDto"},{"$ref":"#/components/schemas/ZImageInputDto"},{"$ref":"#/components/schemas/Wan27ImageInputDto"},{"$ref":"#/components/schemas/MidjourneyInputDto"},{"$ref":"#/components/schemas/MidjourneyVideoInputDto"},{"$ref":"#/components/schemas/SunoInputDto"}]},"webhook":{"type":"string","description":"Webhook for result"}},"required":["model","input"]},"GenerationCostEstimateDto":{"type":"object","properties":{"cost":{"type":"number","description":"Exact amount the generation would charge, in µUSD (1 cent = 10 000 µUSD). Sub-cent tiers are preserved, e.g. 32000 for a $0.032 request.","example":32000}},"required":["cost"]},"GenerationResponseData":{"type":"object","properties":{"taskId":{"type":"string","description":"Generation task ID","example":"01234567-89ab-cdef-0123-456789abcdef"},"status":{"type":"string","description":"Current generation status","enum":["not_started","processing","finished","failed","expired"],"example":"not_started"},"createdAt":{"type":"string","description":"Generation creation timestamp","example":"2026-02-28T11:22:33.000Z"}},"required":["taskId","status","createdAt"]},"CreateGenerationResponseDto":{"type":"object","properties":{"code":{"type":"number","description":"HTTP status code","example":200},"data":{"description":"Response data","allOf":[{"$ref":"#/components/schemas/GenerationResponseData"}]}},"required":["code","data"]},"BadRequestErrorResponseDto":{"type":"object","properties":{"code":{"type":"number","description":"HTTP status code","example":400},"error":{"description":"Error details","allOf":[{"$ref":"#/components/schemas/ErrorDetails"}]}},"required":["code","error"]},"PaymentRequiredErrorResponseDto":{"type":"object","properties":{"code":{"type":"number","description":"HTTP status code","example":402},"error":{"description":"Error details","allOf":[{"$ref":"#/components/schemas/ErrorDetails"}]}},"required":["code","error"]},"MediaFileDto":{"type":"object","properties":{"fileUrl":{"type":"string","description":"Direct URL to the generated file (retained for 3 days)","example":"https://storage.api-stock.com/generated/image-abc123.jpg"},"fileType":{"type":"string","description":"Type of media file: 'image', 'video' or 'music'","enum":["image","video","music"],"example":"image"}},"required":["fileUrl","fileType"]},"TaskDataDto":{"type":"object","properties":{"taskId":{"type":"string","description":"Unique task identifier","example":"019ca881-9503-7270-a560-f00fc2b15785"},"status":{"type":"string","description":"Task status: not_started, processing, finished, failed, expired","enum":["not_started","processing","finished","failed","expired"],"example":"finished"},"files":{"description":"Generated media files (populated when status is finished)","example":[{"file_url":"https://storage.api-stock.com/generated/image-abc123.jpg","file_type":"image"}],"type":"array","items":{"$ref":"#/components/schemas/MediaFileDto"}},"output":{"type":"object","description":"Structured result data. For data generations (e.g. Suno lyrics text or created persona) this is the full result. For media generations it carries extra metadata when available — e.g. Suno music returns `tracks` with per-track title, duration, lyrics, tags and cover image URLs (order matches `files`).","nullable":true},"createdTime":{"type":"string","description":"ISO 8601 timestamp of task creation","example":"2025-11-12T10:30:00"},"errorMessage":{"type":"string","description":"Error description (when status is failed)","example":null,"nullable":true}},"required":["taskId","status","files","createdTime"]},"TaskStatusResponseDto":{"type":"object","properties":{"code":{"type":"number","description":"HTTP status code","example":200},"data":{"description":"Task data","allOf":[{"$ref":"#/components/schemas/TaskDataDto"}]}},"required":["code","data"]},"CatalogPriceDto":{"type":"object","properties":{"key":{"type":"string","description":"Cost key from the model catalog (\"default\", a resolution, a size…)"},"price":{"type":"string","description":"Price in USD, as a string, for one unit of `CatalogModelDto.priceUnit` — a whole generation, one second of output or 1M tokens"},"isDefault":{"type":"boolean","description":"Whether this is the model's base tier: what a request that sets no parameters is billed"},"dimensions":{"type":"object","additionalProperties":{"type":"string"},"description":"Resolved tariff dimensions for this price; present for matrix tariffs"}},"required":["key","price","isDefault"]},"CatalogParamOptionDto":{"type":"object","properties":{"value":{"description":"Value sent to the API","oneOf":[{"type":"string"},{"type":"number"}]},"label":{"type":"string","description":"Human-readable label"}},"required":["value","label"]},"CatalogParamFieldDto":{"type":"object","properties":{"name":{"type":"string","description":"Field name as sent in `input`"},"label":{"type":"string","description":"Label for the form control"},"description":{"type":"string","description":"Field description"},"kind":{"type":"string","description":"Scalar kind of the field (of its items when `isArray`)","enum":["string","number","boolean"]},"isArray":{"type":"boolean","description":"Whether the field accepts a list of values"},"required":{"type":"boolean","description":"Whether the field is mandatory"},"default":{"description":"Default value, if any","nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{}}]},"options":{"description":"Allowed values — render as a select","type":"array","items":{"$ref":"#/components/schemas/CatalogParamOptionDto"}},"minimum":{"type":"number"},"maximum":{"type":"number"},"maxLength":{"type":"number"},"isMedia":{"type":"boolean","description":"Field holds a URL of user-supplied media"},"isPrompt":{"type":"boolean","description":"Field is the model's main prompt"},"multiline":{"type":"boolean","description":"Render as a textarea rather than an input"},"deprecated":{"type":"boolean","description":"Field is kept for compatibility only"}},"required":["name","label","kind","isArray","required","isMedia","isPrompt","multiline","deprecated"]},"CatalogModelDto":{"type":"object","properties":{"id":{"type":"string","description":"Public model id, also used as the URL slug"},"group":{"type":"string","description":"Routing group shared by related models"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Marketing description"},"type":{"type":"string","description":"Generation type","enum":["TEXT","MUSIC","IMAGE","VIDEO"]},"kind":{"type":"string","description":"Media generation model or LLM chat model","enum":["media","llm"]},"vendor":{"type":"string","description":"Upstream vendor, e.g. Google"},"tags":{"description":"Catalog tags","type":"array","items":{"type":"string"}},"capabilities":{"description":"Capability tags derived from the model's parameters","type":"array","items":{"type":"string"}},"pricing":{"description":"Price table; empty when the model has no published price","type":"array","items":{"$ref":"#/components/schemas/CatalogPriceDto"}},"priceFrom":{"type":"string","description":"Headline price in USD, in the same unit as `pricing` (see `priceUnit`): the base-tier price for media models (or the cheapest complete tariff variant when no base tier resolves), the input-token rate for chat models"},"priceUnit":{"type":"string","description":"What one price in `pricing` and `priceFrom` buys: a whole generation, one second of output (per-second video tariffs) or 1M tokens (chat models)","enum":["generation","second","megatoken"]},"params":{"description":"Input parameters, in the order the form should render them","type":"array","items":{"$ref":"#/components/schemas/CatalogParamFieldDto"}},"protocols":{"type":"array","description":"Wire protocols available for an LLM model","items":{"type":"string","enum":["openai","anthropic"]}}},"required":["id","group","name","type","kind","tags","capabilities","pricing","priceUnit","params"]},"StatsTotalsDto":{"type":"object","properties":{"balance":{"type":"number","description":"Current balance, in cents"},"spent":{"type":"number","description":"Spent within the selected period, in cents. Failed generations are refunded, so they are not counted here even though they count as requests"},"spentAllTime":{"type":"number","description":"Spent since registration, in cents; refunded failures excluded"},"requests":{"type":"number","description":"Generations created within the period"},"succeeded":{"type":"number","description":"Generations finished successfully"},"failed":{"type":"number","description":"Generations that ended in an error"},"inProgress":{"type":"number","description":"Generations still running"},"llmRequests":{"type":"number","description":"LLM chat requests within the period"},"llmTokens":{"type":"number","description":"LLM tokens consumed within the period"}},"required":["balance","spent","spentAllTime","requests","succeeded","failed","inProgress","llmRequests","llmTokens"]},"StatsBucketDto":{"type":"object","properties":{"key":{"type":"string","description":"Bucket key — a date (YYYY-MM-DD) or model id"},"count":{"type":"number","description":"Number of generations in the bucket"},"cost":{"type":"number","description":"Amount spent in the bucket, in cents; refunded failures excluded"}},"required":["key","count","cost"]},"StatsResponseDto":{"type":"object","properties":{"from":{"type":"string","description":"Period start actually used (ISO 8601)"},"to":{"type":"string","description":"Period end actually used (ISO 8601)"},"totals":{"$ref":"#/components/schemas/StatsTotalsDto"},"byDay":{"description":"Spend per day, ascending, gaps filled with zeroes","type":"array","items":{"$ref":"#/components/schemas/StatsBucketDto"}},"byModel":{"description":"Spend per model, most expensive first","type":"array","items":{"$ref":"#/components/schemas/StatsBucketDto"}},"byType":{"description":"Spend per generation type","type":"array","items":{"$ref":"#/components/schemas/StatsBucketDto"}}},"required":["from","to","totals","byDay","byModel","byType"]},"ChatMessageDto":{"type":"object","properties":{"role":{"type":"string","description":"Role of the message author","example":"user"},"content":{"type":"object","description":"Message content. Either a string or an array of content parts (multimodal).","example":"Hello!"},"name":{"type":"string","description":"Optional author name"}},"required":["role","content"]},"ChatCompletionRequestDto":{"type":"object","properties":{"model":{"type":"string","description":"Model id","example":"gemini-3.5-flash"},"messages":{"description":"Conversation messages","type":"array","items":{"$ref":"#/components/schemas/ChatMessageDto"}},"stream":{"type":"boolean","description":"Stream partial deltas as server-sent events","default":false},"temperature":{"type":"number","description":"Sampling temperature (0-2)"},"top_p":{"type":"number","description":"Nucleus sampling probability"},"max_tokens":{"type":"number","description":"Maximum tokens to generate"},"max_completion_tokens":{"type":"number","description":"Alias for max_tokens; capped by API Stock"},"n":{"type":"number","description":"Number of completions. API Stock currently supports one.","default":1,"maximum":1}},"required":["model","messages"]},"ChatCompletionChoiceDto":{"type":"object","properties":{"index":{"type":"number","example":0},"message":{"type":"object","example":{"role":"assistant","content":"Hi there!"}},"finish_reason":{"type":"string","example":"stop","nullable":true}},"required":["index","message","finish_reason"]},"ChatCompletionUsageDto":{"type":"object","properties":{"prompt_tokens":{"type":"number","example":12},"completion_tokens":{"type":"number","example":34},"total_tokens":{"type":"number","example":46}},"required":["prompt_tokens","completion_tokens","total_tokens"]},"ChatCompletionResponseDto":{"type":"object","properties":{"id":{"type":"string","example":"chatcmpl-abc123"},"object":{"type":"string","example":"chat.completion"},"created":{"type":"number","example":1700000000},"model":{"type":"string","example":"gemini-3.5-flash"},"choices":{"type":"array","items":{"$ref":"#/components/schemas/ChatCompletionChoiceDto"}},"usage":{"$ref":"#/components/schemas/ChatCompletionUsageDto"}},"required":["id","object","created","model","choices","usage"]},"AnthropicMessageDto":{"type":"object","properties":{"role":{"type":"string","description":"Role of the message author","example":"user"},"content":{"type":"object","description":"Message content. Either a string or an array of content blocks (text/image).","example":"Explain rate limiting in three sentences."}},"required":["role","content"]},"AnthropicMessageRequestDto":{"type":"object","properties":{"model":{"type":"string","description":"Model id","example":"claude-sonnet-5"},"max_tokens":{"type":"number","description":"Maximum number of tokens to generate (required by Anthropic).","example":1024},"messages":{"description":"Conversation messages","type":"array","items":{"$ref":"#/components/schemas/AnthropicMessageDto"}},"stream":{"type":"boolean","description":"Stream partial deltas as server-sent events","default":false}},"required":["model","max_tokens","messages"]},"AnthropicUsageDto":{"type":"object","properties":{"input_tokens":{"type":"number","example":10},"output_tokens":{"type":"number","example":13}},"required":["input_tokens","output_tokens"]},"AnthropicMessageResponseDto":{"type":"object","properties":{"id":{"type":"string","example":"msg_013zva2CMHNLnXJNN3QKQ2EF"},"type":{"type":"string","example":"message"},"role":{"type":"string","example":"assistant"},"content":{"example":[{"type":"text","text":"Hello! I'm Claude."}],"type":"array","items":{"type":"string"}},"model":{"type":"string","example":"claude-sonnet-5"},"stop_reason":{"type":"string","example":"end_turn","nullable":true},"usage":{"$ref":"#/components/schemas/AnthropicUsageDto"}},"required":["id","type","role","content","model","stop_reason","usage"]},"ModelLongContextPricingDto":{"type":"object","properties":{"thresholdTokens":{"type":"number","example":272000,"description":"Total input tokens above which these rates replace the base ones"},"input":{"type":"number","example":2.8,"description":"Input token price"},"output":{"type":"number","example":12.6,"description":"Output token price"},"cacheRead":{"type":"number","example":0.28,"description":"Cache-read token price"},"cacheWrite":{"type":"number","example":10,"description":"Cache-write token price"}},"required":["thresholdTokens","input","output","cacheRead"]},"ModelPricingDto":{"type":"object","properties":{"currency":{"type":"string","example":"USD"},"unit":{"type":"string","example":"1M_tokens","description":"Pricing unit"},"input":{"type":"number","example":1.4,"description":"Input token price"},"output":{"type":"number","example":8.4,"description":"Output token price"},"cacheRead":{"type":"number","example":0.14,"description":"Cache-read token price"},"cacheWrite":{"type":"number","example":5,"description":"Cache-write token price (Anthropic models)"},"longContext":{"description":"Higher rates that replace the ones above for the whole request once its total input exceeds `thresholdTokens`. Absent when the model is priced flat at any context size.","allOf":[{"$ref":"#/components/schemas/ModelLongContextPricingDto"}]}},"required":["currency","unit","input","output","cacheRead"]},"ModelObjectDto":{"type":"object","properties":{"id":{"type":"string","example":"gemini-3.5-flash"},"object":{"type":"string","example":"model"},"created":{"type":"number","example":1700000000},"owned_by":{"type":"string","example":"api-stock"},"pricing":{"nullable":true,"description":"User-facing token pricing (USD per 1M tokens); null if not configured","type":"object","allOf":[{"$ref":"#/components/schemas/ModelPricingDto"}]}},"required":["id","object","created","owned_by"]},"ModelListResponseDto":{"type":"object","properties":{"object":{"type":"string","example":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ModelObjectDto"}}},"required":["object","data"]}}},"externalDocs":{"description":"API Stock documentation","url":"https://docs.api-stock.com"}}