# Create Request

This section allows you to create a request and estimate costs

## Create Video Request

> Create a new video enhancement request.\
> \
> Send information about the video and desired enhancements then receive cost and time estimates.\
> \
> Calling this endpoint does NOT consume credits.\
> \
> Calling this endpoint does NOT start processing.\
> \
> Estimations are based on values provided, and the calculation is rerun once the system receives the source video. If the second estimate is significantly different than the initial values, the request is failed and the credits are fully refunded.\
> \
> The lower bound value of the cost estimate is billed.\
> \
> Time estimates are in development and may not be accurate.\
> \
> \## Response body\
> \
> \| \*\*Property\*\*  | \*\*Type\*\* | \*\*Description\*\*                     |\
> \|---------------|----------|-------------------------------------|\
> \| \*\*requestId\*\* | UUID     | Unique request identifier           |\
> \| \*\*estimates\*\* | Object   | Refer to \*\*RequestEstimates\*\* below |\
> \
> \#### RequestEstimates\
> \
> \`cost\` and \`time\` are arrays with two integers each, representing lower and upper bounds of the estimate.\
> \
> \| \*\*Property\*\* | \*\*Type\*\* | \*\*Description\*\*         |\
> \|--------------|----------|-------------------------|\
> \| \*\*cost\*\*     | Array    | Cost range (in credits) |\
> \| \*\*time\*\*     | Array    | Time range (in seconds) |<br>

```json
{"openapi":"3.0.3","info":{"title":"Video API","version":"1.0.0"},"tags":[{"name":"Create Request","description":"This section allows you to create a request and estimate costs\n"}],"servers":[{"url":"https://api.topazlabs.com","description":"Production API base URL"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"X-API-Key"}},"requestBodies":{"CreateRequest":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["source","filters","output"],"properties":{"source":{"type":"object","description":"Source details for the video","required":["container","size","duration","frameCount","frameRate","resolution"],"properties":{"container":{"type":"string","enum":["mp4","mov","mkv"],"description":"The container format of the video file"},"size":{"type":"integer","description":"Size of the video file in bytes"},"duration":{"type":"number","description":"Duration of the video file in seconds"},"frameCount":{"type":"number","description":"Total number of frames in the video"},"frameRate":{"type":"number","description":"Frame rate of the video"},"resolution":{"type":"object","description":"Resolution details of the video","required":["width","height"],"properties":{"width":{"type":"integer","description":"Width of the video in pixels"},"height":{"type":"integer","description":"Height of the video in pixels"}}},"external":{"$ref":"#/components/schemas/ExternalStorage"}}},"filters":{"$ref":"#/components/schemas/InputFilters"},"output":{"$ref":"#/components/schemas/OutputInformationVideo"},"destination":{"type":"object","properties":{"external":{"$ref":"#/components/schemas/ExternalStorage"}}},"notifications":{"type":"object","properties":{"webhookUrl":{"type":"string","description":"Your URL for Topaz Labs to POST webhook notifications to. Webhooks are sent on successful completions and processing failures."}}}}}}}}},"schemas":{"ExternalStorage":{"type":"object","required":["provider","credentials","bucketName","key"],"properties":{"provider":{"type":"string","enum":["s3"]},"presignedUrl":{"type":"string","description":"Presigned URL to download the source video from or upload the output video to"},"awsCredentials":{"$ref":"#/components/schemas/CredentialsS3"},"bucketName":{"type":"string"},"key":{"type":"string","description":"The example includes the standard specifier for image sequence requests, with optional directory path. It must begin with \"%\" and end with the integer specifier \"d\". The \"0\" in the example indicates left-padding with zeroes, and \"6\" indicates the number of digits in the file name.\nKeys for video requests must be valid characters supported by S3.\n"}}},"CredentialsS3":{"type":"object","required":["roleArn","externalId"],"properties":{"roleArn":{"type":"string","description":"AWS ARN of the role to assume"},"externalId":{"type":"string","description":"Kind of like a secret string for extra layer of security"}}},"InputFilters":{"type":"array","description":"Array of UpscaleFilter or FrameInterpolationFilter objects","items":{"anyOf":[{"$ref":"#/components/schemas/UpscaleFilter"},{"$ref":"#/components/schemas/FrameInterpolationFilter"}]}},"UpscaleFilter":{"title":"Upscale Filter","type":"object","required":["model"],"properties":{"model":{"type":"string","description":"Short code name for the AI model\n","enum":["aaa-9","ahq-12","alq-13","alqs-2","amq-13","amqs-2","color-1","ddv-3","dtd-4","dtds-2","dtv-4","dtvs-2","gcg-5","ghq-5","iris-2","iris-3","nxf-1","nxl-1","nxhf-1","nyx-3","prob-4","rhea-1","thd-3","thf-4","thm-2"]},"videoType":{"type":"string","enum":["Progressive","Interlaced","ProgressiveInterlaced"],"description":"Frame/field type of the video"},"auto":{"type":"string","enum":["Auto","Manual","Relative"],"description":"Parameter mode of the selected model\n- Auto - parameter estimation is used with no customization\n- Relative - uses auto parameters with optional weights added\n- Manual - all parameters are manually set\n"},"fieldOrder":{"type":"string","enum":["TopFirst","BottomFirst","Auto"],"description":"Optional specification of field order for interlaced input videos"},"focusFixLevel":{"type":"string","enum":["None","Normal","Strong"],"description":"Downscales video input for stronger correction of blurred subjects"},"compression":{"type":"number","minimum":-1,"maximum":1,"description":"Adjust strength of compression recovery"},"details":{"type":"number","minimum":-1,"maximum":1,"description":"Amount of detail reconstruction"},"prenoise":{"type":"number","minimum":0,"maximum":0.1,"description":"Adds noise to input to reduce over-smoothing"},"noise":{"type":"number","minimum":-1,"maximum":1,"description":"Amount of noise reduction"},"halo":{"type":"number","minimum":-1,"maximum":1,"description":"Amount of halo reduction"},"preblur":{"type":"number","minimum":-1,"maximum":1,"description":"Adjust anti-aliasing and deblurring strength"},"blur":{"type":"number","minimum":-1,"maximum":1,"description":"Amount of sharpness applied"},"grain":{"type":"number","minimum":0,"maximum":0.1,"description":"Adds grain after AI model processing"},"grainSize":{"type":"number","minimum":0,"maximum":5,"description":"Size of generated grain"},"recoverOriginalDetailValue":{"type":"number","minimum":0,"maximum":1,"description":"Reintroduce source details into the output video"}}},"FrameInterpolationFilter":{"title":"Frame Interpolation Filter","type":"object","required":["model"],"properties":{"model":{"type":"string","description":"Short code name for the AI model\n","enum":["apf-2","apo-8","chf-3","chr-2"]},"slowmo":{"type":"number","minimum":1,"maximum":16,"description":"Slow motion factor applied to input video. For example, a value of 2 makes the output twice as slow and doubles the duration."},"fps":{"type":"number","minimum":15,"maximum":240,"description":"Output frame rate, does not increase duration"},"duplicate":{"type":"boolean","description":"Analyze input for duplicate frames and remove them"},"duplicateThreshold":{"type":"number","minimum":0.001,"maximum":0.1,"description":"Sensitivity of detection for duplicate frames"}}},"OutputInformationVideo":{"type":"object","required":["resolution","frameRate","audioCodec","audioTransfer"],"properties":{"resolution":{"type":"object","description":"Desired output resolution","required":["width","height"],"properties":{"width":{"type":"integer","description":"Width in pixels. The maximum size depends on the encoder and can be referenced using the table below <table> <tr> <td>H264</td> <td>H265</td> <td>ProRes <td>AV1 <td>VP9 </tr> <tr> <td>4096</td> <td>8192</td> <td>16386</td> <td>16384</td> <td>8192</td> </tr> </table>"},"height":{"type":"integer","description":"Height in pixels. The maximum size depends on the encoder and can be referenced using the table below <table> <tr> <td>H264</td> <td>H265</td> <td>ProRes <td>AV1 <td>VP9 </tr> <tr> <td>4096</td> <td>8192</td> <td>16386</td> <td>8704</td> <td>8192</td> </tr> </table>"}}},"frameRate":{"type":"number","description":"Frame rate"},"audioBitrate":{"type":"string","description":"Audio bitrate, if audioTransfer is Copy or Convert. Default values for the codec are used if not provided."},"audioCodec":{"type":"string","enum":["AAC","AC3","PCM"],"description":"__Required if audioTransfer is Copy or Convert.__"},"audioTransfer":{"type":"string","enum":["Copy","Convert","None"]},"codecId":{"type":"string","description":"Video codec ID, if known. Defaults to videoEncoder."},"videoEncoder":{"type":"string","enum":["AV1","H264","H265","VP9"]},"videoBitrate":{"type":"string","description":"__Required if dynamicCompressionLevel is not provided.__ Constant bitrate, suffixed with \"k\" for kilobits or \"m\" for megabits per second."},"dynamicCompressionLevel":{"type":"string","enum":["Low","Mid","High"],"description":"__Required if videoBitrate is not provided.__ Automatic CQP selection."},"videoProfile":{"type":"string","description":"Codec profile specific to videoEncoder. The following are some combinations of available profiles based on the 'videoEncoder' selection <table> <tr> <td>H264</td> <td>H265</td> <td>ProRes <td>AV1 <td>VP9 </tr> <tr> <td>High</td> <td>Main, Main10</td> <td>422 Proxy, 422 LT, 422 Std, 422 HQ</td> <td>8-bit, 10-bit</td> <td>Good, Best</td> </tr> </table>"},"cropToFit":{"type":"boolean","description":"Center cropping to fit the output dimensions"},"container":{"type":"string","enum":["mp4","mov","mkv"],"description":"Desired output container"}}},"CreateResponse":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"estimates":{"$ref":"#/components/schemas/RequestEstimates"}}},"RequestEstimates":{"type":"object","description":"Lower and upper bound estimates","properties":{"cost":{"type":"array","description":"In credits","items":{"type":"integer"}},"time":{"type":"array","description":"In seconds, assuming an empty queue, starting from the time the source video has been received","items":{"type":"integer"}}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"ServiceUnavailable":{"description":"Service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}}},"paths":{"/video/":{"post":{"tags":["Create Request"],"summary":"Create Video Request","operationId":"CreateVideoRequest","description":"Create a new video enhancement request.\n\nSend information about the video and desired enhancements then receive cost and time estimates.\n\nCalling this endpoint does NOT consume credits.\n\nCalling this endpoint does NOT start processing.\n\nEstimations are based on values provided, and the calculation is rerun once the system receives the source video. If the second estimate is significantly different than the initial values, the request is failed and the credits are fully refunded.\n\nThe lower bound value of the cost estimate is billed.\n\nTime estimates are in development and may not be accurate.\n\n## Response body\n\n| **Property**  | **Type** | **Description**                     |\n|---------------|----------|-------------------------------------|\n| **requestId** | UUID     | Unique request identifier           |\n| **estimates** | Object   | Refer to **RequestEstimates** below |\n\n#### RequestEstimates\n\n`cost` and `time` are arrays with two integers each, representing lower and upper bounds of the estimate.\n\n| **Property** | **Type** | **Description**         |\n|--------------|----------|-------------------------|\n| **cost**     | Array    | Cost range (in credits) |\n| **time**     | Array    | Time range (in seconds) |\n","requestBody":{"$ref":"#/components/requestBodies/CreateRequest"},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalServerError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}}}}
```
