├── .env.production ├── .eslintrc.json ├── .gitignore ├── README.md ├── README.zh-CN.md ├── global.d.ts ├── messages ├── en.json └── zh.json ├── next.config.mjs ├── package-lock.json ├── package.json ├── postcss.config.js ├── public ├── appicon.svg ├── favicon.ico ├── next.svg ├── robots.txt ├── sorawebui.svg ├── success_deploy.jpg └── vercel.svg ├── src ├── app │ ├── [locale] │ │ ├── PageComponent.tsx │ │ ├── [...rest] │ │ │ └── page.tsx │ │ ├── layout.tsx │ │ ├── page.tsx │ │ ├── privacy-policy │ │ │ ├── PageComponent.tsx │ │ │ └── page.tsx │ │ ├── terms-of-service │ │ │ ├── PageComponent.tsx │ │ │ └── page.tsx │ │ └── v1 │ │ │ └── video │ │ │ └── generations │ │ │ └── route.ts │ ├── error.tsx │ ├── layout.tsx │ ├── not-found.tsx │ ├── page.tsx │ └── styles.css ├── components │ ├── Footer.tsx │ ├── HeadInfo.tsx │ ├── Header.tsx │ └── LoadingModal.tsx ├── config.ts ├── configs │ └── supportLanguage.ts ├── context │ └── common-context.tsx ├── data │ └── openaiExampleVideo.ts ├── i18n.ts ├── middleware.ts ├── navigation.ts └── server │ └── exampleVideo.ts ├── tailwind.config.ts └── tsconfig.json /.env.production: -------------------------------------------------------------------------------- 1 | # 网站 URL 2 | NEXT_PUBLIC_SITE_URL=https://sorawebui.com 3 | 4 | # 是否代理请求 openai 5 | HTTPS_PROXY= 6 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | .yarn/install-state.gz 8 | 9 | # testing 10 | /coverage 11 | 12 | # next.js 13 | /.next/ 14 | /out/ 15 | 16 | # production 17 | /build 18 | 19 | # misc 20 | .DS_Store 21 | *.pem 22 | 23 | # debug 24 | npm-debug.log* 25 | yarn-debug.log* 26 | yarn-error.log* 27 | 28 | # local env files 29 | .env*.local 30 | 31 | # vercel 32 | .vercel 33 | 34 | # typescript 35 | *.tsbuildinfo 36 | next-env.d.ts 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FakeSoraAPI 2 | API for [SoraWebui](https://github.com/SoraWebui/SoraWebui).This API will be called to generate video from text. 3 | demo here👉 [FakeSoraAPI](https://fake-sora-api.sorawebui.com) 4 | 5 |
6 | 7 | English | [简体中文](https://github.com/SoraWebui/FakeSoraAPI/blob/main/README.zh-CN.md) 8 | 9 |
10 | 11 | ## Quick Started 12 | 13 | ### Deploy on Vercel 14 | [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FSoraWebui%2FFakeSoraAPI&project-name=FakeSoraAPI&repository-name=FakeSoraAPI&external-id=https%3A%2F%2Fgithub.com%2FSoraWebui%2FFakeSoraAPI%2Ftree%2Fmain) 15 | 16 | 17 | ### 1. Clone project 18 | 19 | ```bash 20 | git clone git@github.com:SoraWebui/FakeSoraAPI.git 21 | ``` 22 | 23 | ### 2. Install dependencies 24 | 25 | ```bash 26 | cd FakeSoraAPI && yarn 27 | #or 28 | cd FakeSoraAPI && npm install 29 | #or 30 | cd FakeSoraAPI && pnpm install 31 | ``` 32 | 33 | ### 3. Run it 34 | 35 | ```bash 36 | yarn dev 37 | #or 38 | npm run dev 39 | #or 40 | pnpm dev 41 | ``` 42 | 43 | ### 4. Open [http://localhost:8081](http://localhost:8081) with your browser to see it. 44 | ![success_deploy.jpg](https://fake-sora-api.sorawebui.com/success_deploy.jpg) 45 | -------------------------------------------------------------------------------- /README.zh-CN.md: -------------------------------------------------------------------------------- 1 | # FakeSoraAPI 2 | SoraWebui 的接口,调用此 API 以从文本生成视频。 3 | 👉 [FakeSoraAPI](https://fake-sora-api.sorawebui.com) 4 | 5 |
6 | 7 | [English](https://github.com/SoraWebui/FakeSoraAPI/blob/main/README.md) | 简体中文 8 | 9 |
10 | 11 | ## 快速开始 12 | 13 | ### 在 Vercel 上部署 14 | [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FSoraWebui%2FFakeSoraAPI&project-name=FakeSoraAPI&repository-name=FakeSoraAPI&external-id=https%3A%2F%2Fgithub.com%2FSoraWebui%2FFakeSoraAPI%2Ftree%2Fmain) 15 | 16 | 17 | ### 1. 克隆项目 18 | 19 | ```bash 20 | git clone git@github.com:SoraWebui/FakeSoraAPI.git 21 | ``` 22 | 23 | ### 2. 安装依赖 24 | 25 | ```bash 26 | cd FakeSoraAPI && yarn 27 | #or 28 | cd FakeSoraAPI && npm install 29 | #or 30 | cd FakeSoraAPI && pnpm install 31 | ``` 32 | 33 | ### 3. 运行 34 | 35 | ```bash 36 | yarn dev 37 | #or 38 | npm run dev 39 | #or 40 | pnpm dev 41 | ``` 42 | 43 | ### 4. 在浏览器打开 [http://localhost:8081](http://localhost:8081) 44 | ![success_deploy.jpg](https://fake-sora-api.sorawebui.com/success_deploy.jpg) 45 | -------------------------------------------------------------------------------- /global.d.ts: -------------------------------------------------------------------------------- 1 | // Use type safe message keys with `next-intl` 2 | type Messages = typeof import('./messages/en.json'); 3 | declare interface IntlMessages extends Messages {} 4 | -------------------------------------------------------------------------------- /messages/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "IndexPage": { 3 | "lang": "en", 4 | "language": "English", 5 | "languageInChineseSimple": "英语", 6 | "title": "Fake Sora API", 7 | "description": "API for SoraWebui.", 8 | "loadingText": "Loading...", 9 | "buttonText": "Generate", 10 | "loginText": "Log in", 11 | "h1Text": "Fake Sora API", 12 | "pDescription0": "API for ", 13 | "pDescription1": " , This API will be called to generate video from text.", 14 | "pDescription2": "There is no Sora API for OpenAI yet, but you can still call me to see examples of text-to-video." 15 | }, 16 | "privacyPolicy": { 17 | "title": "Privacy Policy | SoraWebui", 18 | "mainDescription": "A browser interface for OpenAI Sora, generate text-to-video simply.", 19 | "h1": "Privacy Policy", 20 | "date": "Last updated: February 19, 2024", 21 | "desc": "Thank you for choosing SoraWebui! This Privacy Policy outlines how we collect, use, and protect your information when you use our website located at ", 22 | "h4_1": "1、Information We Collect:", 23 | "h4_1_pa": "a. Personal Data: When you use SoraWebui, we may collect your name, email address, and payment information for order processing purposes.", 24 | "h4_1_pb": "b. Non-Personal Data: We may also collect non-personal data through web cookies to enhance your browsing experience.", 25 | "h4_2": "2、Purpose of Data Collection:", 26 | "h4_2_p": "We collect your personal data solely for order processing purposes.", 27 | "h4_3": "3、Data Sharing:", 28 | "h4_3_p": "We do not share your personal data with any third parties.", 29 | "h4_4": "4、Children's Privacy:", 30 | "h4_4_p": "SoraWebui does not knowingly collect any personal data from children.", 31 | "h4_5": "5、Updates to the Privacy Policy:", 32 | "h4_5_p": "We will notify users of any updates to this Privacy Policy via email.", 33 | "h4_6": "6、Contact Information:", 34 | "h4_6_p": "If you have any questions or concerns regarding our Privacy Policy, please contact us at" 35 | }, 36 | "termsOfService": { 37 | "title": "Terms of Service | SoraWebui", 38 | "mainDescription": "A browser interface for OpenAI Sora, generate text-to-video simply.", 39 | "h1": "Terms of Service", 40 | "date": "Last updated: February 19, 2024", 41 | "desc": "These Terms of Service (\"Terms\") govern your access to and use of SoraWebui (the \"Service\"), provided by SoraWebui (\"we\" or \"us\"). By accessing or using the Service, you agree to be bound by these Terms.", 42 | "h4_1": "1、Description of Service: ", 43 | "h4_1_p": "SoraWebui provides a browser interface for OpenAI Sora, allowing users to generate text-to-video easily.", 44 | "h4_2": "2、Ownership: ", 45 | "h4_2_p": "The ownership of the video generated from the text belongs to the original user.", 46 | "h4_3": "3、User Data:", 47 | "h4_3_p": "We collect and store user data including name, email, and payment information. We handle this data in accordance with our Privacy Policy.", 48 | "h4_4": "4、Non-Personal Data Collection: ", 49 | "h4_4_p": "We use web cookies to collect non-personal data. For more information, please refer to our Privacy Policy.", 50 | "h4_5": "5、Privacy Policy:", 51 | "h4_5_p": "Our Privacy Policy explains how we collect, use, and disclose information about you. By using our Service, you agree to our Privacy Policy, which can be found at ", 52 | "h4_6": "6、Governing Law: ", 53 | "h4_6_p": "These Terms are governed by the laws of the United States of America.", 54 | "h4_7": "7、Updates to Terms: ", 55 | "h4_7_p": "We may update these Terms from time to time. We will notify users of any material changes via email.", 56 | "h4_8": "8、Contact Information:", 57 | "h4_8_p": "If you have any questions or concerns regarding our Privacy Policy, please contact us at " 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /messages/zh.json: -------------------------------------------------------------------------------- 1 | { 2 | "IndexPage": { 3 | "lang": "en", 4 | "language": "简体中文", 5 | "languageInChineseSimple": "简体中文", 6 | "title": "Fake Sora API", 7 | "description": "SoraWebui 的接口。", 8 | "loadingText": "加载中...", 9 | "buttonText": "生成", 10 | "loginText": "登录", 11 | "h1Text": "Fake Sora API", 12 | "pDescription0": "", 13 | "pDescription1": " 的 API,调用此 API 以从文本生成视频。", 14 | "pDescription2": "目前还没有适用于 OpenAI 的 Sora API,但您仍然可以调用本 API 来查看文本转视频的示例。" 15 | }, 16 | "privacyPolicy": { 17 | "title": "隐私政策 | SoraWebui", 18 | "mainDescription": "OpenAI Sora 的浏览器界面,简单生成文本到视频。", 19 | "h1": "隐私政策", 20 | "date": "最后更新日期:2024年2月19日", 21 | "desc": "感谢您选择 SoraWebui!本隐私政策概述了您在使用我们位于的网站时我们如何收集、使用和保护您的信息", 22 | "h4_1": "1、我们收集的信息:", 23 | "h4_1_pa": "a. 个人数据: 当您使用 SoraWebui 时,我们可能会收集您的姓名、电子邮件地址和支付信息,以便进行订单处理。", 24 | "h4_1_pb": "b. 非个人数据: 我们还可能通过网络 Cookie 收集非个人数据,以增强您的浏览体验。", 25 | "h4_2": "2、数据收集目的:", 26 | "h4_2_p": "我们仅收集您的个人数据以进行订单处理。", 27 | "h4_3": "3、数据共享:", 28 | "h4_3_p": "我们不会与任何第三方共享您的个人数据。", 29 | "h4_4": "4、儿童隐私:", 30 | "h4_4_p": "SoraWebui 不会故意收集儿童的任何个人数据。", 31 | "h4_5": "5、隐私政策更新:", 32 | "h4_5_p": "我们将通过电子邮件通知用户有关本隐私政策的任何更新。", 33 | "h4_6": "6、联系信息:", 34 | "h4_6_p": "如果您对我们的隐私政策有任何疑问或顾虑,请通过以下方式与我们联系:" 35 | }, 36 | "termsOfService": { 37 | "title": "服务条款| SoraWebui", 38 | "mainDescription": "OpenAI Sora 的浏览器界面,简单生成文本到视频。", 39 | "h1": "服务条款", 40 | "date": "最后更新日期:2024年2月19日", 41 | "desc": "这些服务条款(“条款”)管辖您对 SoraWebui(“服务”)的访问和使用,由 SoraWebui(“我们”或“我们”)提供。通过访问或使用服务,您同意受这些条款的约束。", 42 | "h4_1": "1、服务描述:", 43 | "h4_1_p": "SoraWebui 提供了一个 OpenAI Sora 的浏览器界面,允许用户轻松生成文本到视频。", 44 | "h4_2": "2、所有权:", 45 | "h4_2_p": "从文本生成的视频的所有权属于原始用户。", 46 | "h4_3": "3、用户数据:", 47 | "h4_3_p": "我们收集和存储用户数据,包括姓名、电子邮件和付款信息。我们根据我们的隐私政策处理这些数据。", 48 | "h4_4": "4、非个人数据收集:", 49 | "h4_4_p": "我们使用网络cookie来收集非个人数据。有关更多信息,请参阅我们的隐私政策。", 50 | "h4_5": "5、隐私政策:", 51 | "h4_5_p": "我们的隐私政策解释了我们如何收集、使用和披露关于您的信息。通过使用我们的服务,您同意我们的隐私政策,该政策可在以下网址找到 ", 52 | "h4_6": "6、适用法律:", 53 | "h4_6_p": "这些条款受美国法律管辖。", 54 | "h4_7": "7、条款更新:", 55 | "h4_7_p": "我们可能会不时更新这些条款。我们将通过电子邮件通知用户任何重大变更。", 56 | "h4_8": "8、联系信息:", 57 | "h4_8_p": "如果您对我们的隐私政策有任何疑问或关注,请联系我们:" 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /next.config.mjs: -------------------------------------------------------------------------------- 1 | import createNextIntlPlugin from 'next-intl/plugin'; 2 | 3 | const withNextIntl = createNextIntlPlugin(); 4 | 5 | /** @type {import('next').NextConfig} */ 6 | const nextConfig = {}; 7 | 8 | export default withNextIntl(nextConfig); 9 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "next-init", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev --port 8081", 7 | "build": "next build", 8 | "start": "next start" 9 | }, 10 | "dependencies": { 11 | "@headlessui/react": "^1.7.18", 12 | "@heroicons/react": "^2.1.1", 13 | "@tailwindcss/typography": "^0.5.10", 14 | "clsx": "^2.1.0", 15 | "next": "14.1.0", 16 | "next-intl": "^3.7.0", 17 | "react": "^18", 18 | "react-dom": "^18", 19 | "react-highlight": "^0.15.0", 20 | "react-markdown": "^9.0.1", 21 | "undici": "^6.6.2", 22 | "uuid": "^9.0.1" 23 | }, 24 | "devDependencies": { 25 | "@types/node": "^20", 26 | "@types/react": "^18", 27 | "@types/react-dom": "^18", 28 | "autoprefixer": "^10.0.1", 29 | "eslint": "^8", 30 | "eslint-config-next": "14.1.0", 31 | "postcss": "^8", 32 | "tailwindcss": "^3.3.0", 33 | "typescript": "^5" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /public/appicon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 30 | 58 | 107 | 132 | 133 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoraWebui/FakeSoraAPI/04edb587cacaa69896d711aca81e274649380fea/public/favicon.ico -------------------------------------------------------------------------------- /public/next.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-Agent: * 2 | Allow: * 3 | Disallow: /api 4 | Disallow: /api/ 5 | Disallow: /api* 6 | Disallow: /*/api 7 | Disallow: /*/api/ 8 | Disallow: /*/api* 9 | -------------------------------------------------------------------------------- /public/sorawebui.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 27 | 28 | 48 | 67 | 82 | 107 | 136 | 161 | 180 | 192 | 193 | -------------------------------------------------------------------------------- /public/success_deploy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoraWebui/FakeSoraAPI/04edb587cacaa69896d711aca81e274649380fea/public/success_deploy.jpg -------------------------------------------------------------------------------- /public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/[locale]/PageComponent.tsx: -------------------------------------------------------------------------------- 1 | 'use client' 2 | import {useRouter} from "next/navigation"; 3 | import Header from '~/components/Header'; 4 | import Footer from '~/components/Footer'; 5 | import Link from "next/link"; 6 | import HeadInfo from "~/components/HeadInfo"; 7 | import Markdown from "react-markdown"; 8 | import Highlight from 'react-highlight' 9 | 10 | const PageComponent = ({ 11 | locale = '', 12 | currentLanguageText= { 13 | title: '', 14 | description: '', 15 | loadingText: '', 16 | buttonText: '', 17 | loginText: '', 18 | h1Text: '', 19 | pDescription0: '', 20 | pDescription1: '', 21 | pDescription2: '', 22 | } 23 | }) => { 24 | const router = useRouter(); 25 | 26 | const requestBody = [ 27 | { 28 | paramName: "prompt", 29 | type: "string", 30 | require: "Required", 31 | description: "A text description of the desired video. The maximum length is 1000 characters." 32 | }, 33 | { 34 | paramName: "model", 35 | type: "string", 36 | require: "Optional Defaults to sora-1.0-turbo", 37 | description: "The model to use for video generation." 38 | }, 39 | // { 40 | // paramName: "n", 41 | // type: "integer", 42 | // require: "Optional Defaults to 1", 43 | // description: "The number of video to generate." 44 | // }, 45 | { 46 | paramName: "size", 47 | type: "string", 48 | require: "Optional Defaults to 1920X1080", 49 | description: "The size of the generated video." 50 | } 51 | ] 52 | 53 | const responseBody = { 54 | "data": 55 | [ 56 | { 57 | "revised_prompt": "", 58 | "url": "https://XXXXXX.mp4" 59 | } 60 | ] 61 | }; 62 | 63 | return ( 64 | <> 65 | 71 |
72 |
73 |
75 |
76 |
78 |

{currentLanguageText.h1Text}

79 |
80 |

81 | {currentLanguageText.pDescription0} 82 | SoraWebui 86 | {currentLanguageText.pDescription1} 87 |

88 |

89 | {currentLanguageText.pDescription2} 90 |

91 |
92 |
93 | 94 |
95 |
96 |
97 |

API Reference

99 |
100 |
101 |

Request url

102 |

103 | POST https://fake-sora-api.sorawebui.com/v1/video/generations 104 |

105 |

Request body

106 |
107 | { 108 | requestBody.map((item, index) => { 109 | return ( 110 |
111 | 112 | {item.paramName}   113 | {item.type}   114 | {item.require} 116 | 117 |

{item.description}

118 | { 119 | index < 2 ?
: null 120 | } 121 |
122 | ); 123 | }) 124 | } 125 |

Example request

126 | 127 | {` 128 | curl https://fake-sora-api.sorawebui.com/v1/video/generations \\ 129 | -H "Content-Type: application/json" \\ 130 | -H "Authorization: Bearer $OPENAI_API_KEY" \\ 131 | -d '{ 132 | "model": "sora-1.0-turbo", 133 | "prompt": "A cute baby sea otter", 134 | "size": "1920x1080" 135 | }' 136 | `} 137 | 138 |

Example response body

139 | 140 | {JSON.stringify(responseBody, null, 2)} 141 | 142 |
143 |
144 | 147 | Test API {'>>'} 148 | 149 |
150 |
151 |
152 | 153 |
154 |
155 |
156 |