|
| 1 | +{ |
| 2 | + "components": { |
| 3 | + "examples": {}, |
| 4 | + "headers": {}, |
| 5 | + "parameters": {}, |
| 6 | + "requestBodies": {}, |
| 7 | + "responses": {}, |
| 8 | + "schemas": { |
| 9 | + "Record_string.any_": { |
| 10 | + "properties": {}, |
| 11 | + "type": "object", |
| 12 | + "description": "Construct a type with a set of properties K of type T" |
| 13 | + }, |
| 14 | + "UploadAudioResponseDto": { |
| 15 | + "properties": { |
| 16 | + "url": { |
| 17 | + "type": "string", |
| 18 | + "description": "The temporary URL of the audio.\nThis URL should be provided when creating an animation via the /animations endpoint." |
| 19 | + }, |
| 20 | + "id": { |
| 21 | + "type": "string", |
| 22 | + "description": "A unique identifier for the audio.\nThis identifier should be used when deleting the audio via the /audio/{id} endpoint." |
| 23 | + }, |
| 24 | + "duration": { |
| 25 | + "type": "number", |
| 26 | + "format": "double", |
| 27 | + "description": "The duration of the audio in seconds" |
| 28 | + }, |
| 29 | + "moderation_metadata": { |
| 30 | + "$ref": "#/components/schemas/Record_string.any_", |
| 31 | + "description": "The audio moderation results metadata." |
| 32 | + } |
| 33 | + }, |
| 34 | + "required": ["url"], |
| 35 | + "type": "object", |
| 36 | + "additionalProperties": false |
| 37 | + }, |
| 38 | + "JsonError": { |
| 39 | + "properties": { |
| 40 | + "kind": { "type": "string" }, |
| 41 | + "description": { "type": "string" }, |
| 42 | + "details": {} |
| 43 | + }, |
| 44 | + "required": ["kind", "description"], |
| 45 | + "type": "object", |
| 46 | + "additionalProperties": false |
| 47 | + } |
| 48 | + }, |
| 49 | + "securitySchemes": { |
| 50 | + "basic": { "type": "http", "scheme": "basic" }, |
| 51 | + "bearer": { "type": "http", "scheme": "bearer" } |
| 52 | + } |
| 53 | + }, |
| 54 | + "info": { |
| 55 | + "title": "audios", |
| 56 | + "version": "1.1.0", |
| 57 | + "description": "Audios", |
| 58 | + "license": { "name": "ISC" }, |
| 59 | + "contact": { "name": "D-ID" } |
| 60 | + }, |
| 61 | + "openapi": "3.0.0", |
| 62 | + "paths": { |
| 63 | + "/audios": { |
| 64 | + "post": { |
| 65 | + "operationId": "Upload an audio", |
| 66 | + "responses": { |
| 67 | + "201": { |
| 68 | + "description": "The audio has been uploaded successfully", |
| 69 | + "content": { |
| 70 | + "application/json": { |
| 71 | + "schema": { "$ref": "#/components/schemas/UploadAudioResponseDto" }, |
| 72 | + "examples": { "Example 1": { "value": { "id": "DE8sPnUCMg7MBcFJisx5Z" } } } |
| 73 | + } |
| 74 | + } |
| 75 | + }, |
| 76 | + "400": { |
| 77 | + "description": "BadRequestError | InvalidFileSizeError | InvalidAudioDurationError", |
| 78 | + "content": { |
| 79 | + "application/json": { |
| 80 | + "schema": { "$ref": "#/components/schemas/JsonError" }, |
| 81 | + "examples": { |
| 82 | + "Example 1": { |
| 83 | + "value": { "kind": "BadRequestError", "description": "invalid audio" } |
| 84 | + } |
| 85 | + } |
| 86 | + } |
| 87 | + } |
| 88 | + }, |
| 89 | + "401": { |
| 90 | + "description": "AuthorizationError", |
| 91 | + "content": { |
| 92 | + "application/json": { |
| 93 | + "schema": { "$ref": "#/components/schemas/JsonError" }, |
| 94 | + "examples": { |
| 95 | + "Example 1": { |
| 96 | + "value": { "kind": "AuthorizationError", "description": "user unauthenticated" } |
| 97 | + } |
| 98 | + } |
| 99 | + } |
| 100 | + } |
| 101 | + }, |
| 102 | + "402": { |
| 103 | + "description": "InsufficientCreditsError", |
| 104 | + "content": { |
| 105 | + "application/json": { |
| 106 | + "schema": { "$ref": "#/components/schemas/JsonError" }, |
| 107 | + "examples": { |
| 108 | + "Example 1": { |
| 109 | + "value": { |
| 110 | + "kind": "InsufficientCreditsError", |
| 111 | + "description": "not enough credits" |
| 112 | + } |
| 113 | + } |
| 114 | + } |
| 115 | + } |
| 116 | + } |
| 117 | + }, |
| 118 | + "415": { |
| 119 | + "description": "UnsupportedMimeTypeError", |
| 120 | + "content": { |
| 121 | + "application/json": { |
| 122 | + "schema": { "$ref": "#/components/schemas/JsonError" }, |
| 123 | + "examples": { |
| 124 | + "Example 1": { |
| 125 | + "value": { |
| 126 | + "kind": "UnsupportedMimeTypeError", |
| 127 | + "description": "The provided mime type is not supported", |
| 128 | + "details": { "received": "image/jpg", "supported": ["audio/*", "video/*"] } |
| 129 | + } |
| 130 | + } |
| 131 | + } |
| 132 | + } |
| 133 | + } |
| 134 | + }, |
| 135 | + "451": { |
| 136 | + "description": "AudioModerationError", |
| 137 | + "content": { |
| 138 | + "application/json": { |
| 139 | + "schema": { "$ref": "#/components/schemas/JsonError" }, |
| 140 | + "examples": { |
| 141 | + "Example 1": { |
| 142 | + "value": { |
| 143 | + "kind": "AudioModerationError", |
| 144 | + "description": "Automatic audio moderation failed - Please try a different audio file" |
| 145 | + } |
| 146 | + } |
| 147 | + } |
| 148 | + } |
| 149 | + } |
| 150 | + } |
| 151 | + }, |
| 152 | + "description": "Upload an audio file to a temporary storage before creating an animation.\nThe audio is uploaded using `multipart/form-data`; the filename directive is optional and if provided should contain up to 50 valid characters long.\nThe resulting file is stored as a .wav file in a 16kHz sample rate.\n\nValid characters: a-z A-Z 0-9 . _ -\nSupported mime types: \"audio/*, video/*\"\nStorage duration: 24-48H", |
| 153 | + "summary": "Upload audio file", |
| 154 | + "security": [{ "basic": [] }, { "bearer": [] }], |
| 155 | + "parameters": [], |
| 156 | + "requestBody": { |
| 157 | + "required": false, |
| 158 | + "content": { |
| 159 | + "multipart/form-data": { |
| 160 | + "schema": { |
| 161 | + "type": "object", |
| 162 | + "properties": { |
| 163 | + "audio": { |
| 164 | + "type": "string", |
| 165 | + "format": "binary", |
| 166 | + "description": "The uploaded audio file, the file must not exceed 6MB in size." |
| 167 | + }, |
| 168 | + "source_url": { "type": "string" }, |
| 169 | + "result_url": { |
| 170 | + "type": "string", |
| 171 | + "description": "A URL to upload the audio to. If provided, the audio will be uploaded to this URL instead of the default bucket. https presigned URL supported. S3 presigned urls should have the putObject permission with content type audio/wav." |
| 172 | + } |
| 173 | + } |
| 174 | + } |
| 175 | + } |
| 176 | + } |
| 177 | + } |
| 178 | + } |
| 179 | + }, |
| 180 | + "/audios/{id}": { |
| 181 | + "delete": { |
| 182 | + "operationId": "Delete", |
| 183 | + "responses": { |
| 184 | + "204": { "description": "OK" }, |
| 185 | + "401": { |
| 186 | + "description": "AuthorizationError", |
| 187 | + "content": { |
| 188 | + "application/json": { |
| 189 | + "schema": { "$ref": "#/components/schemas/JsonError" }, |
| 190 | + "examples": { |
| 191 | + "Example 1": { |
| 192 | + "value": { "kind": "AuthorizationError", "description": "user unauthenticated" } |
| 193 | + } |
| 194 | + } |
| 195 | + } |
| 196 | + } |
| 197 | + }, |
| 198 | + "404": { |
| 199 | + "description": "NotFoundError", |
| 200 | + "content": { |
| 201 | + "application/json": { |
| 202 | + "schema": { "$ref": "#/components/schemas/JsonError" }, |
| 203 | + "examples": { |
| 204 | + "Example 1": { |
| 205 | + "value": { "kind": "NotFoundError", "description": "audio not found" } |
| 206 | + } |
| 207 | + } |
| 208 | + } |
| 209 | + } |
| 210 | + } |
| 211 | + }, |
| 212 | + "description": "Delete an audio file", |
| 213 | + "summary": "Delete an audio file", |
| 214 | + "security": [{ "basic": [] }, { "bearer": [] }], |
| 215 | + "parameters": [ |
| 216 | + { |
| 217 | + "description": "The id of the audio file", |
| 218 | + "in": "path", |
| 219 | + "name": "id", |
| 220 | + "required": true, |
| 221 | + "schema": { "type": "string" } |
| 222 | + } |
| 223 | + ] |
| 224 | + } |
| 225 | + } |
| 226 | + }, |
| 227 | + "servers": [{ "url": "https://api.d-id.com/" }] |
| 228 | +} |
0 commit comments