Загружает файл в ваше хранилище и возвращает публичную ссылку на него. Ссылку можно передать в image_url или file текстового запроса, а также во входные параметры медиа-задачи. Тело запроса — только multipart/form-data: отправка сырых байт или JSON с base64 не поддерживается.
Максимальный размер — 100 МБ. Превышение даёт 400 invalid_request.
Типы text/*, image/*, audio/*, video/* и application/pdf обрабатываются штатно.
Остальные типы — офисные документы, архивы, произвольный бинарный формат — не отклоняются. Метка типа отбрасывается, а тип определяется по расширению файла.
Единственная жёсткая проверка формата: устаревший .ppt отклоняется с 400 invalid_request.
Изображение может быть перекодировано в PNG без потерь, если получившийся файл меньше исходного. Длинная сторона при этом ограничивается 2000 пикселями. Поэтому size в ответе может оказаться меньше размера загруженного файла.
url — обычная публичная ссылка на основной (или производный) файл. Она не подписана и не имеет срока действия: отдавать её можно кому угодно.
url — не ссылка с подписью. Если вам нужна приватная ссылка с ограничением по времени, хранилище такого не выдаёт — загрузите файл по своей схеме подписи.
Здесь нет полей param и code верхнего уровня, которые есть у OpenAI-формата. Клиент, разбирающий error.code, на этом эндпоинте получит null. Полный разбор — на странице Ошибки.
{"docsConfig":{"theme":"luma","$schema":"https://mintlify.com/docs.json","name":"Документация SpeShu.AI","colors":{"primary":"#ff7819","light":"#ff9038","dark":"#ff7819"},"logo":{"light":"https://mintcdn.com/speshu/HiupqL5TwnvMFufM/logo/speshu_logo.png?fit=max\u0026auto=format\u0026n=HiupqL5TwnvMFufM\u0026q=85\u0026s=fd0fe3cc5f642899ca9d4e8bdee6a0f0","dark":"https://mintcdn.com/speshu/HiupqL5TwnvMFufM/logo/speshu_logo.png?fit=max\u0026auto=format\u0026n=HiupqL5TwnvMFufM\u0026q=85\u0026s=fd0fe3cc5f642899ca9d4e8bdee6a0f0"},"favicon":"https://mintcdn.com/speshu/4vy74SrUrHtVMEav/favicon.svg?fit=max\u0026auto=format\u0026n=4vy74SrUrHtVMEav\u0026q=85\u0026s=3fe1d515b10b46d55add95c515686b24","api":{"mdx":{"auth":{"method":"bearer","name":"Authorization"},"server":"https://speshu.ai"}},"appearance":{"default":"light"},"navbar":{"links":[{"href":"/support","label":"Поддержка"}],"primary":{"type":"button","label":"Профиль","href":"https://speshu.ai/profile"}},"footer":{"links":[{"items":[{"label":"Сотрудничество","href":"mailto:info@speshu.ai"},{"label":"Написать в ТГ","href":"https://t.me/sprt_speshu_ai"},{"label":"Клуб AI-Профи","href":"https://t.me/+9Fkgdpnm3axlN2Ji"}]}]},"contextual":{"options":["copy","view"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Модели","icon":"microchip","href":"/api-reference/media/models"},{"anchor":"Каталог","icon":"list","href":"/models"},{"anchor":"Профиль","icon":"gauge","href":"https://speshu.ai/profile"},{"anchor":"Поддержка","icon":"headset","href":"/support"}]},"languages":[{"language":"ru","href":""}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"speshu","hasAudioNarration":false,"actualSubdomain":"speshu","customDomains":["speshu.ai"],"gitSource":{"type":"github","owner":"laoboost","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ad74369dcf1b2c01a0bc747","clientVersion":"0.0.4102","searchFilterCounts":[{"language":"ru","tag":"Руководства","count":41},{"language":"ru","tag":"API Reference","count":23},{"language":"ru","tag":"Документация","count":13},{"language":"ru","tag":"Фреймворки","count":12},{"language":"ru","tag":"Текстовая генерация","count":7},{"language":"ru","tag":"Агенты и редакторы","count":7},{"language":"ru","tag":"Медиа","count":6},{"language":"ru","tag":"О сервисе","count":6},{"language":"ru","tag":"Возможности моделей","count":6},{"language":"ru","tag":"Начало","count":5}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"/docs","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/storage/upload","slug":"/api-reference/storage/upload","pageMetadata":{"title":"Загрузить файл","description":"POST /api/v1/storage/upload — загрузка файла в хранилище и получение ссылки","openapi":"api-reference/openapi.json POST /api/v1/storage/upload","playground":"interactive","icon":"upload","href":"/api-reference/storage/upload"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"POST /api/v1/storage/upload — загрузка файла в хранилище и получение ссылки\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,CodeGroup,Heading,Info,Table,Warning}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Загружает файл в ваше хранилище и возвращает публичную ссылку на него. Ссылку можно передать в `,_jsx(_components.code,{children:`image_url`}),` или `,_jsx(_components.code,{children:`file`}),` текстового запроса, а также во входные параметры медиа-задачи. Тело запроса — только `,_jsx(_components.code,{children:`multipart/form-data`}),`: отправка сырых байт или JSON с base64 не поддерживается.`]}),`\n`,_jsx(Heading,{level:`2`,id:`пример`,children:`Пример`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://speshu.ai/api/v1/storage/upload`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$SPESHU_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -F`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"file=@photo.jpg\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -F`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"asset_type=chat_upload\"`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`12`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`with`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` open`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"photo.jpg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"rb\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` f:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://speshu.ai/api/v1/storage/upload\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Authorization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer sk-ваш-ключ\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` files`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"file\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: (`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"photo.jpg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, f, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"image/jpeg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` data`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"asset_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"chat_upload\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`asset `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.json()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(asset[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"asset_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`], asset[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`]})})})]}),`\n`,_jsx(_components.p,{children:`Ссылку из ответа можно сразу использовать в чате:`}),`\n`,_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`13`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://speshu.ai/api/v1/chat/completions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$SPESHU_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"gpt-4o\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [{`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"role\": \"user\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` { \"type\": \"text\", \"text\": \"Что на картинке?\" },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` { \"type\": \"image_url\", \"image_url\": { \"url\": \"https://cdn.example.com/uploads/1/2026/10/02/0199....png\" } }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`поля-формы`,children:`Поля формы`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Поле`}),_jsx(_components.th,{children:`Тип`}),_jsx(_components.th,{children:`Обязателен`}),_jsx(_components.th,{children:`Описание`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`file`})}),_jsx(_components.td,{children:`file`}),_jsx(_components.td,{children:`да`}),_jsx(_components.td,{children:`Сам файл`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`asset_type`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`нет`}),_jsxs(_components.td,{children:[`Тип файла. По умолчанию `,_jsx(_components.code,{children:`chat_upload`}),`. Неизвестное значение молча заменяется на `,_jsx(_components.code,{children:`chat_upload`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`session_id`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`нет`}),_jsx(_components.td,{children:`Идентификатор сессии — только для учёта`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`message_id`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`нет`}),_jsx(_components.td,{children:`Идентификатор сообщения — только для учёта`})]})]})]}),`\n`,_jsx(_components.p,{children:`Неизвестные поля формы игнорируются.`}),`\n`,_jsx(Heading,{level:`2`,id:`ответ`,children:`Ответ`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`201 Created`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"asset_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0199...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"filename\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"photo.png\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"size\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`245760`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"asset_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"chat_upload\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://cdn.example.com/uploads/\u003cuser>/2026/10/02/\u003cuuid>.png\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"mime_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"image/png\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Поле`}),_jsx(_components.th,{children:`Тип`}),_jsx(_components.th,{children:`Описание`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`asset_id`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Идентификатор файла в хранилище, UUID`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`filename`})}),_jsx(_components.td,{children:`string`}),_jsxs(_components.td,{children:[`Имя сохранённого файла. Может отличаться от исходного: у изображений расширение меняется на `,_jsx(_components.code,{children:`.png`}),` после перекодирования`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`size`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`Размер сохранённого файла в байтах`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`asset_type`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Тип, с которым файл лёг в хранилище`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`url`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Публичная ссылка на основной файл`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`mime_type`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Тип сохранённого файла`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`ограничения`,children:`Ограничения`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Максимальный размер — `,_jsx(_components.strong,{children:`100 МБ`}),`. Превышение даёт `,_jsx(_components.code,{children:`400 invalid_request`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Типы `,_jsx(_components.code,{children:`text/*`}),`, `,_jsx(_components.code,{children:`image/*`}),`, `,_jsx(_components.code,{children:`audio/*`}),`, `,_jsx(_components.code,{children:`video/*`}),` и `,_jsx(_components.code,{children:`application/pdf`}),` обрабатываются штатно.`]}),`\n`,_jsxs(_components.li,{children:[`Остальные типы — офисные документы, архивы, произвольный бинарный формат — `,_jsx(_components.strong,{children:`не отклоняются`}),`. Метка типа отбрасывается, а тип определяется по расширению файла.`]}),`\n`,_jsxs(_components.li,{children:[`Единственная жёсткая проверка формата: устаревший `,_jsx(_components.code,{children:`.ppt`}),` отклоняется с `,_jsx(_components.code,{children:`400 invalid_request`}),`.`]}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Изображение может быть перекодировано в PNG без потерь, если получившийся файл меньше исходного. Длинная сторона при этом ограничивается 2000 пикселями. Поэтому `,_jsx(_components.code,{children:`size`}),` в ответе может оказаться `,_jsx(_components.strong,{children:`меньше`}),` размера загруженного файла.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`ссылки-на-файл`,children:`Ссылки на файл`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`url`}),` — обычная публичная ссылка на основной (или производный) файл. Она не подписана и не имеет срока действия: отдавать её можно кому угодно.`]}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`url`}),` — не ссылка с подписью. Если вам нужна приватная ссылка с ограничением по времени, хранилище такого не выдаёт — загрузите файл по своей схеме подписи.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`квота`,children:`Квота`}),`\n`,_jsxs(_components.p,{children:[`Квота хранилища — на пользователя, а не на ключ. Когда она исчерпана, загрузка возвращает `,_jsx(_components.code,{children:`413 payload_too_large`}),`.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Эндпоинта, который отдаёт текущую квоту или занятый объём, на `,_jsx(_components.code,{children:`/api/v1`}),` нет. Лимит можно узнать только по факту отказа.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`ошибки`,children:`Ошибки`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Код`}),_jsx(_components.th,{children:`Причина`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`400 invalid_request`})}),_jsxs(_components.td,{children:[`Некорректный `,_jsx(_components.code,{children:`multipart/form-data`}),`, нет поля `,_jsx(_components.code,{children:`file`}),`, некорректное имя файла, `,_jsx(_components.code,{children:`.ppt`}),`, файл больше 100 МБ`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`401`})}),_jsx(_components.td,{children:`Ключ не передан или недействителен`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`413 payload_too_large`})}),_jsx(_components.td,{children:`Исчерпана квота хранилища`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`500`})}),_jsx(_components.td,{children:`Внутренняя ошибка`})]})]})]}),`\n`,_jsxs(Warning,{children:[_jsxs(_components.p,{children:[`Хранилище использует `,_jsx(_components.strong,{children:`третий`}),` формат ошибки — свой, отличный и от OpenAI, и от медиа-конверта:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{ `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"invalid_request\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } }`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`Здесь нет полей `,_jsx(_components.code,{children:`param`}),` и `,_jsx(_components.code,{children:`code`}),` верхнего уровня, которые есть у OpenAI-формата. Клиент, разбирающий `,_jsx(_components.code,{children:`error.code`}),`, на этом эндпоинте получит `,_jsx(_components.code,{children:`null`}),`. Полный разбор — на странице `,_jsx(_components.a,{href:`/errors`,children:`Ошибки`}),`.`]})]}),`\n`,_jsx(Heading,{level:`2`,id:`что-дальше`,children:`Что дальше`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Список файлов`,icon:`list`,href:`/api-reference/storage/list`,children:_jsx(_components.p,{children:`Что уже лежит в хранилище`})}),_jsx(Card,{title:`Метаданные файла`,icon:`magnifying-glass`,href:`/api-reference/storage/get`,children:_jsx(_components.p,{children:`Один файл по идентификатору`})}),_jsx(Card,{title:`Запрос чату`,icon:`message`,href:`/api-reference/chat/completions`,children:_jsx(_components.p,{children:`Как передать ссылку в модель`})}),_jsx(Card,{title:`Ошибки`,icon:`triangle-exclamation`,href:`/errors`,children:_jsx(_components.p,{children:`Полная таблица кодов`})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Загрузить файл","description":"POST /api/v1/storage/upload — загрузка файла в хранилище и получение ссылки","openapi":"api-reference/openapi.json POST /api/v1/storage/upload","playground":"interactive","icon":"upload","href":"/api-reference/storage/upload"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Пример","slug":"пример","depth":2,"children":[]},{"title":"Поля формы","slug":"поля-формы","depth":2,"children":[]},{"title":"Ответ","slug":"ответ","depth":2,"children":[]},{"title":"Ограничения","slug":"ограничения","depth":2,"children":[]},{"title":"Ссылки на файл","slug":"ссылки-на-файл","depth":2,"children":[]},{"title":"Квота","slug":"квота","depth":2,"children":[]},{"title":"Ошибки","slug":"ошибки","depth":2,"children":[]},{"title":"Что дальше","slug":"что-дальше","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Хранилище"],"operationId":"uploadFile","summary":"Загрузить файл","description":"POST /api/v1/storage/upload — загрузка файла в хранилище и получение ссылки","requestBody":"d93e62b8-dcd3-4dc8-a0ae-3f5c59786191","responses":{"201":"0c7b31ab-6b84-46ee-81c9-8acabde641b6","400":"6357fe0d-b4fb-4ed2-a486-6ab669dad643","401":"1d2f4c8f-ada5-49e9-932d-b87e8e2ee1e6","404":"2a58476d-c724-40b3-9794-876ea159724e","413":"0ab6be7b-38ab-4782-856e-e0bdb7e2c761","500":"17e3faca-485a-4c92-ab0c-9547a1e7ab8f"},"method":"post","type":"path","servers":["8a2807ef-ac4b-47e6-8d72-307eede96316"],"security":["e2ba089c-3a25-43cf-af05-e084bb9608e5"],"path":"/api/v1/storage/upload","baseUrlOptions":["https://speshu.ai"],"title":"Загрузить файл","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"Файл. Обязателен.","isRequired":true,"uniqueKey":"file","typeLabel":"file"},"asset_type":{"type":"string","default":"chat_upload","enum":["chat_upload","reference_image","voice_message"],"description":"Тип файла. Неизвестное значение заменяется на `chat_upload`.","uniqueKey":"asset_type","typeLabel":"enum\u003cstring>"},"session_id":{"type":"string","description":"Идентификатор сессии для привязки файла.","uniqueKey":"session_id","typeLabel":"string"},"message_id":{"type":"string","description":"Идентификатор сообщения для привязки файла.","uniqueKey":"message_id","typeLabel":"string"}},"required":["file"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"file":"\u003cstring>","asset_type":"chat_upload","session_id":"\u003cstring>","message_id":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"0c7b31ab-6b84-46ee-81c9-8acabde641b6":{"description":"Файл загружен.","content":{"application/json":{"schema":{"type":"object","properties":{"asset_id":{"type":"string","description":"Идентификатор файла в хранилище.","isRequired":true,"uniqueKey":"asset_id","typeLabel":"string"},"url":{"type":"string","description":"Публичная ссылка на файл.","isRequired":true,"uniqueKey":"url","typeLabel":"string"},"filename":{"type":"string","uniqueKey":"filename","typeLabel":"string"},"size":{"type":"integer","description":"Размер сохранённого файла в байтах.","uniqueKey":"size","typeLabel":"integer"},"asset_type":{"type":"string","uniqueKey":"asset_type","typeLabel":"string"},"mime_type":{"type":"string","uniqueKey":"mime_type","typeLabel":"string"}},"required":["asset_id","url"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"asset_id":"\u003cstring>","url":"\u003cstring>","filename":"\u003cstring>","size":123,"asset_type":"\u003cstring>","mime_type":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"6357fe0d-b4fb-4ed2-a486-6ab669dad643":{"description":"Ошибка хранилища.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","examples":["invalid_request"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"}},"required":["message","type"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"invalid_request"}}}},"exampleType":"generated"}},"exampleType":"generated"},"1d2f4c8f-ada5-49e9-932d-b87e8e2ee1e6":{"description":"Ошибка в формате OpenAI.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","examples":["invalid_request_error"],"description":"`authentication_error` при 401, `rate_limit_error` при 429, `permission_error` при 403, в остальных случаях `invalid_request_error`, `api_error` или `internal_error`.","isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","examples":["invalid_request"],"description":"Машиночитаемый код: `invalid_api_key`, `unauthorized`, `insufficient_quota`, `rate_limit_exceeded`, `token_limit_exceeded`, `content_too_large`, `limit_exceeded`, `model_not_found`, `no_providers`, `service_unavailable`, `provider_error`, `invalid_request`, `context_length_exceeded`, `internal_error`.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","examples":["invalid_request"],"description":"Машиночитаемый код: `invalid_api_key`, `unauthorized`, `insufficient_quota`, `rate_limit_exceeded`, `token_limit_exceeded`, `content_too_large`, `limit_exceeded`, `model_not_found`, `no_providers`, `service_unavailable`, `provider_error`, `invalid_request`, `context_length_exceeded`, `internal_error`.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"}},"required":["message","type"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"invalid_request_error","param":"\u003cstring>","code":"invalid_request"}}}},"exampleType":"generated"}},"exampleType":"generated"},"2a58476d-c724-40b3-9794-876ea159724e":{"description":"Ошибка хранилища.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","examples":["invalid_request"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"}},"required":["message","type"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"invalid_request"}}}},"exampleType":"generated"}},"exampleType":"generated"},"0ab6be7b-38ab-4782-856e-e0bdb7e2c761":{"description":"Ошибка хранилища.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","examples":["invalid_request"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"}},"required":["message","type"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"invalid_request"}}}},"exampleType":"generated"}},"exampleType":"generated"},"17e3faca-485a-4c92-ab0c-9547a1e7ab8f":{"description":"Ошибка хранилища.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","examples":["invalid_request"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"}},"required":["message","type"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"invalid_request"}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"e2ba089c-3a25-43cf-af05-e084bb9608e5":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API-ключ в формате `sk-...`. Альтернативно — заголовок `X-Api-Key: sk-...` (совместимо с Anthropic SDK).","scopes":[],"schemeName":"BearerAuth"}}},"servers":{"8a2807ef-ac4b-47e6-8d72-307eede96316":{"url":"https://speshu.ai","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"API-ключ в формате `sk-...`. Альтернативно — заголовок `X-Api-Key: sk-...` (совместимо с Anthropic SDK).","scopes":[],"schemeName":"BearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"API-ключ в формате `sk-...`. Альтернативно — заголовок `X-Api-Key: sk-...` (совместимо с Anthropic SDK).","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"BearerAuth","name":"Authorization"}],"title":"BearerAuth"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"speshu","siteName":"Документация SpeShu.AI","title":"Загрузить файл - Документация SpeShu.AI","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"ru":{"href":"/api-reference/storage/upload","matchLevel":0}}},"lastModified":"2026-10-02T04:29:21.542Z","originalFileLocation":"api-reference/storage/upload.mdx","locale":"ru"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"POST /api/v1/storage/upload — загрузка файла в хранилище и получение ссылки\">\u003cmeta data-mint-head name=\"application-name\" content=\"Документация SpeShu.AI\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/speshu/h8uCrMo0u7Pj0sRw/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/speshu/h8uCrMo0u7Pj0sRw/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/speshu/h8uCrMo0u7Pj0sRw/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/speshu/h8uCrMo0u7Pj0sRw/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/speshu/h8uCrMo0u7Pj0sRw/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/speshu/h8uCrMo0u7Pj0sRw/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/speshu/h8uCrMo0u7Pj0sRw/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/speshu/h8uCrMo0u7Pj0sRw/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/speshu/h8uCrMo0u7Pj0sRw/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Загрузить файл - Документация SpeShu.AI\">\u003cmeta data-mint-head property=\"og:description\" content=\"POST /api/v1/storage/upload — загрузка файла в хранилище и получение ссылки\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Документация SpeShu.AI\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://speshu.ai/docs/api-reference/storage/upload\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://speshu.mintlify.site/docs/_mintlify/api/og/v2?division=%D0%A5%D1%80%D0%B0%D0%BD%D0%B8%D0%BB%D0%B8%D1%89%D0%B5\u0026amp;title=%D0%97%D0%B0%D0%B3%D1%80%D1%83%D0%B7%D0%B8%D1%82%D1%8C+%D1%84%D0%B0%D0%B9%D0%BB\u0026amp;description=POST+%2Fapi%2Fv1%2Fstorage%2Fupload+%E2%80%94+%D0%B7%D0%B0%D0%B3%D1%80%D1%83%D0%B7%D0%BA%D0%B0+%D1%84%D0%B0%D0%B9%D0%BB%D0%B0+%D0%B2+%D1%85%D1%80%D0%B0%D0%BD%D0%B8%D0%BB%D0%B8%D1%89%D0%B5+%D0%B8+%D0%BF%D0%BE%D0%BB%D1%83%D1%87%D0%B5%D0%BD%D0%B8%D0%B5+%D1%81%D1%81%D1%8B%D0%BB%D0%BA%D0%B8\u0026amp;theme=e30006b63b476fd6b922259f\u0026amp;signature=805f0249ac745a34e485f6ef42ec4731819ffc04e59908276ed3630dae77fdae\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Загрузить файл - Документация SpeShu.AI\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"POST /api/v1/storage/upload — загрузка файла в хранилище и получение ссылки\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://speshu.mintlify.site/docs/_mintlify/api/og/v2?division=%D0%A5%D1%80%D0%B0%D0%BD%D0%B8%D0%BB%D0%B8%D1%89%D0%B5\u0026amp;title=%D0%97%D0%B0%D0%B3%D1%80%D1%83%D0%B7%D0%B8%D1%82%D1%8C+%D1%84%D0%B0%D0%B9%D0%BB\u0026amp;description=POST+%2Fapi%2Fv1%2Fstorage%2Fupload+%E2%80%94+%D0%B7%D0%B0%D0%B3%D1%80%D1%83%D0%B7%D0%BA%D0%B0+%D1%84%D0%B0%D0%B9%D0%BB%D0%B0+%D0%B2+%D1%85%D1%80%D0%B0%D0%BD%D0%B8%D0%BB%D0%B8%D1%89%D0%B5+%D0%B8+%D0%BF%D0%BE%D0%BB%D1%83%D1%87%D0%B5%D0%BD%D0%B8%D0%B5+%D1%81%D1%81%D1%8B%D0%BB%D0%BA%D0%B8\u0026amp;theme=e30006b63b476fd6b922259f\u0026amp;signature=805f0249ac745a34e485f6ef42ec4731819ffc04e59908276ed3630dae77fdae\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/speshu/h8uCrMo0u7Pj0sRw/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Документация SpeShu.AI\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#ff7819\">\u003clink data-mint-head rel=\"canonical\" href=\"https://speshu.ai/docs/api-reference/storage/upload\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/api-reference/storage/upload.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://speshu.ai/#organization\",\"name\":\"Документация SpeShu.AI\",\"url\":\"https://speshu.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/speshu/HiupqL5TwnvMFufM/logo/speshu_logo.png?fit=max\u0026auto=format\u0026n=HiupqL5TwnvMFufM\u0026q=85\u0026s=fd0fe3cc5f642899ca9d4e8bdee6a0f0\"}},{\"@type\":\"WebSite\",\"@id\":\"https://speshu.ai/docs#website\",\"name\":\"Документация SpeShu.AI\",\"url\":\"https://speshu.ai/docs\",\"publisher\":{\"@id\":\"https://speshu.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://speshu.ai/docs/api-reference/storage/upload#webpage\",\"url\":\"https://speshu.ai/docs/api-reference/storage/upload\",\"name\":\"Загрузить файл\",\"description\":\"POST /api/v1/storage/upload — загрузка файла в хранилище и получение ссылки\",\"dateModified\":\"2026-10-02T04:29:21.542Z\",\"isPartOf\":{\"@id\":\"https://speshu.ai/docs#website\"},\"breadcrumb\":{\"@id\":\"https://speshu.ai/docs/api-reference/storage/upload#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://speshu.ai/docs/api-reference/storage/upload#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Документация SpeShu.AI\",\"item\":\"https://speshu.ai/docs\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Загрузить файл\",\"item\":\"https://speshu.ai/docs/api-reference/storage/upload\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://speshu.ai/docs/api-reference/storage/upload#apireference\",\"headline\":\"Загрузить файл\",\"name\":\"Загрузить файл\",\"description\":\"POST /api/v1/storage/upload — загрузка файла в хранилище и получение ссылки\",\"url\":\"https://speshu.ai/docs/api-reference/storage/upload\",\"mainEntityOfPage\":{\"@id\":\"https://speshu.ai/docs/api-reference/storage/upload#webpage\"},\"dateModified\":\"2026-10-02T04:29:21.542Z\",\"publisher\":{\"@id\":\"https://speshu.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://speshu.ai/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Документация SpeShu.AI\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Документация SpeShu.AI\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/api-reference/storage/upload.md","siteName":"Документация SpeShu.AI","nav":{"global":{"anchors":[{"anchor":"Модели","icon":"microchip","href":"/api-reference/media/models"},{"anchor":"Каталог","icon":"list","href":"/models"},{"anchor":"Профиль","icon":"gauge","href":"https://speshu.ai/profile"},{"anchor":"Поддержка","icon":"headset","href":"/support"}]},"languages":[{"language":"ru","tabs":[{"tab":"Документация","pages":[{"title":"Документация","href":""}]},{"tab":"Руководства","pages":[{"title":"Руководства","href":"/gaidy/getting-started"}]},{"tab":"API Reference","groups":[{"group":"Текстовая генерация","pages":[{"title":"Введение в API","icon":"book","href":"/api-reference/introduction"},{"title":"Запрос чату","openapi":"api-reference/openapi.json POST /api/v1/chat/completions","playground":"interactive","icon":"message","href":"/api-reference/chat/completions"},{"title":"Responses","openapi":"api-reference/openapi.json POST /api/v1/responses","icon":"list","href":"/api-reference/responses/create"},{"title":"Anthropic Messages","openapi":"api-reference/openapi.json POST /api/v1/messages","icon":"a","href":"/api-reference/messages/create"},{"title":"Оценка решений","openapi":"api-reference/openapi.json POST /api/v1/decisions","playground":"interactive","icon":"scale-balanced","href":"/api-reference/decisions/create"},{"title":"Эмбеддинги","openapi":"api-reference/openapi.json POST /api/v1/embeddings","playground":"interactive","icon":"circle-nodes","href":"/api-reference/embeddings/create"},{"title":"Ранжирование","openapi":"api-reference/openapi.json POST /api/v1/rerank","playground":"interactive","icon":"arrow-down-short-wide","href":"/api-reference/rerank/create"}]},{"group":"Инструменты","pages":[{"title":"Поиск в интернете","openapi":"api-reference/openapi.json POST /api/v1/tools/search","playground":"interactive","icon":"magnifying-glass","href":"/api-reference/tools/search"},{"title":"Загрузка страницы","openapi":"api-reference/openapi.json POST /api/v1/tools/fetch","playground":"interactive","icon":"file-lines","href":"/api-reference/tools/fetch"}]},{"group":"Аудио","pages":[{"title":"Синтез речи","openapi":"api-reference/openapi.json POST /api/v1/audio/speech","playground":"interactive","icon":"volume-high","href":"/api-reference/audio/speech"},{"title":"Распознавание речи","openapi":"api-reference/openapi.json POST /api/v1/audio/transcriptions","playground":"interactive","icon":"microphone","href":"/api-reference/audio/transcriptions"}]},{"group":"Медиа","pages":[{"title":"Создать задачу","openapi":"api-reference/openapi.json POST /api/v1/async/media/tasks","playground":"interactive","icon":"plus","href":"/api-reference/media/create"},{"title":"Статус задачи","openapi":"api-reference/openapi.json GET /api/v1/async/media/tasks/{task_id}","icon":"magnifying-glass","href":"/api-reference/media/status"},{"title":"Список задач","openapi":"api-reference/openapi.json GET /api/v1/async/media/tasks","icon":"list","href":"/api-reference/media/list"},{"title":"Жизненный цикл задачи","openapi":"/api-reference/openapi.json","icon":"rotate","href":"/api-reference/media/tasks"},{"title":"Медиа-сессии","icon":"folder","href":"/api-reference/media/sessions"},{"title":"Каталог медиа-моделей","description":"GET /api/v1/media/models — схемы параметров, цены и доступные модели","openapi":"api-reference/openapi.json GET /api/v1/media/models","icon":"microchip","href":"/api-reference/media/models"}]},{"group":"Хранилище","pages":[{"title":"Загрузить файл","openapi":"api-reference/openapi.json POST /api/v1/storage/upload","playground":"interactive","icon":"upload","href":"/api-reference/storage/upload"},{"title":"Список файлов","description":"GET /api/v1/storage — постраничный список файлов хранилища с фильтрами","openapi":"api-reference/openapi.json GET /api/v1/storage","playground":"interactive","icon":"list","href":"/api-reference/storage/list"},{"title":"Метаданные файла","openapi":"api-reference/openapi.json GET /api/v1/storage/{id}","playground":"interactive","icon":"magnifying-glass","href":"/api-reference/storage/get"},{"title":"Удалить файл","openapi":"api-reference/openapi.json DELETE /api/v1/storage/{id}","icon":"trash","href":"/api-reference/storage/delete"}]},{"group":"Модели и баланс","pages":[{"title":"Каталог моделей","openapi":"api-reference/openapi.json GET /api/v1/models","playground":"interactive","icon":"microchip","href":"/api-reference/models/list"},{"title":"Баланс","openapi":"api-reference/openapi.json GET /api/v1/balance","playground":"interactive","icon":"wallet","href":"/api-reference/other/balance"}]}]}]}]},"basePath":"","title":"Загрузить файл - Документация SpeShu.AI","buildId":"dpl_2AK98Hxhwu4fUXpx9atbv41cC328","deploymentId":"dpl_2AK98Hxhwu4fUXpx9atbv41cC328","dynamics":["c2aa737661","b0f84f53ff","a9bb46feb3","2b790eda92"],"chunks":["OpenApiReferenceProvider-EBSrFTg1.js","utils-Y_7TcRh4.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-D1wvvkPH.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-aT0ty6oN.js","snippetPresets-DoNRuyJc.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","Page-DCFaZE46.js","ApiExamples-CXRajFpn.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BAyOsINj.js","shallow-CIcHqV1v.js","getApiPlaygroundDisplay-C5igZwEf.js","CodeSnippet-BFWnQLNh.js","CodeSnippets-Cx2mFgZW.js","getPastedJson-BOy09PZp.js","icon-BwmYtB6R.js","MethodPill-DAIhq-iu.js","DuplicateIcon-DFM8Q3ph.js","createIcon-0UdvzB4Z.js","DynamicMarkdown-DYYZTGpa.js","SectionHeading-BFCDRUuH.js","axios-vUo_bRtp.js","Markdown-C6TcKjiR.js","clsx-Y_UC780V.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-PCbBHBTv.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-D4q_oRML.js"]}