the CHEAPEST way to access SORA 2 by API
TLDRThis tutorial demonstrates how to access Sora 2 via its API when you don't have access to the app or website. By using the key.ai platform and N8N, users can set up a simple workflow to send prompts and images to the API, receive a task ID, and download the resulting video. The video walks through creating API requests, managing keys, and handling response tasks. A downloadable JSON file with the N8N workflow is provided, allowing users to easily replicate the process and start generating videos with Sora 2.
Takeaways
- 😀 You can access Sora 2 via the API if you haven't received an invite code for the app or website.
- 💻 Key.ai is used to interact with the Explore the capabilities of the Sora 2 API for advanced AI-powered solutions., just like it was used for VO3 and Nano Banana.
- 💡 The cost for using the API is 20 credits (10 cents for a 10-second video).
- 🎥 You can use Key.ai's playground for one-off videos by uploading a file and setting a prompt.
- 🖼️ For API access, you can host your image online and use its URL to interact with the API.
- 🔧 In N8N, create a trigger, set up the prompt, and connect an HTTP request to Key.ai's API.
- 🔑 To use Key.ai's API, you need to create an API key through their API Key Management section.
- ⏳ Use a wait step in N8N to handle the time it takes for the task to complete.
- 🔄 Add an if statement in N8N to check whether the task is ready or still waiting, and loop until it's done.
- 📥 Once the task is finished, extract the result URL and use an HTTP request to download the generated content.
- 📁 You can import the JSON workflow from the video to N8N and reuse it with your own API key.
Q & A
What is the main topic of the video?
-The video explains how to access Sora 2 via API using the platform key.ai, as an alternative for users who don't have direct access through the Sora website or app.
Why would someone want to use the API instead of the Sora app?
-Because Sora 2 access is invite-only, and many users have not received an invite code yet. Using the API through key.ai allows them to use Sora 2 features without waiting for an official invite.
What is key.ai used for in this process?
-Key.ai is used to connect with Sora 2’s API, allowing users to generate videos using text-to-video or image-to-video prompts through either its playground interface or API integration.
How much does it cost to use Sora 2 via key.ai?
-It costs 20 credits, which equals about 10 cents for a 10-second video.
What is N8N, and how is it used in this tutorial?
-N8N is an automation tool that allows users to create workflows connecting different APIs and services. In this tutorial, it’s used to automate the process of sending prompts and images to the key.ai API to generate Sora 2 videos.
What are the two input types mentioned for generating videos?
-The two input types are 'text to video' and 'image to video'. Users can provide either a text prompt or an image to generate video content.
What does the creator do after setting up the prompt and image in N8N?
-The creator sets up an HTTP request node to send the prompt and image to key.ai’s API, includes their API key, and then executes the request to receive a task ID in response.
Why is there a wait step in the workflow?
-The wait step allows time for the Sora 2 Pro API to process the video generation task, which can take about a minute and a half. The creator uses short wait times while building the workflow for testing purposes.
How does the workflow check if the video generation is complete?
-The workflow uses an 'if' statement to repeatedly check the task status returned by the API. It loops until the status changes from 'waiting' to 'success'.
What happens when the video generation isAccess Sora 2 API successful?
-Once successful, the API returns an object containing the video URL. The workflow extracts this URL and then uses an HTTP GET request to download the completed video.
What does the creator provide at the end of the video for viewers?
-The creator offers a downloadable JSON file of the N8N workflow, which viewers can import directly into N8N to replicate the setup.
What error did the creator encounter and how was it fixed?
-The creator accidentally deleted the key 'image URLs' in the workflow, causing issues with the API request. They fixed it by re-adding the correct key name.
How does the creator demonstrate that the setup works?
-They run the complete workflow using a sample prompt and image, retrieve the video URL, and confirm that the video generated successfully by viewing it.
What kind of example prompt was used in the demonstration?
-The example prompt used in the demonstration was related to the Toronto Blue Jays defeating the New York Yankees.
What final advice does the creator give to viewers?
-The creator thanks viewers for watching and reminds them that they can download and import the JSON workflow file from the link in the description to easily replicate the setup.
Outlines
🔧 Accessing Sora 2 via API Setup
This paragraph outlines the steps to access Sora 2 when you don't have an invite code. The method shown involves using the key.ai platform to send API requests to generate videos. The speaker explains how to use key.ai's playground to create videos from prompts and images and how to work with the API through N8N. This section includes instructions on setting up prompts and uploading images for video creation, focusing on the initial setup steps and configurations required for using the API.
⏳ Managing API Requests and Task ID
Here, the speaker discusses the process of managing API requests and handling task IDs. After setting up the prompt and image, they show how to send a request using key.ai's API and retrieve a task ID. The speaker encounters an issue with missing values in the setup, which they quickly correct, and then explain how to wait for the task to complete. The wait time is adjusted, and they show how to query the task status, indicating the importance of proper error handling and waiting for the task to be ready before continuing.
🎥 Finalizing the Video Creation and Download
This section demonstrates how to finalize the video creation process. Once the taskAccessing Sora 2 API completes, the video URL is extracted from the response, and the video is downloaded using another HTTP request. The speaker emphasizes how to handle the response to access the video URL, and ends with a demonstration of the final video result. There’s also a brief mention of an issue with the video prompt related to a baseball game, showing that the speaker was experimenting with different prompts. The final instructions encourage users to download the setup as a JSON file for reuse in N8N.
Mindmap
Keywords
💡SORA 2
💡API
💡key.ai / kie.ai
💡N8N
💡playground
💡API key
💡curl
💡HTTP request
💡task ID
💡wait step
💡prompt
💡image URL
💡set node / object extraction
💡download / HTTP GET
💡webhook / automation
Highlights
Learn how to access Sora 2 via API when not yet invited to the app or website.
Using key.ai for Sora 2 API, with a cost of 20 credits for a 10-second video.
Quick video and image-to-video creation using key.ai's playground feature.
How to upload a file and generate a video with a prompt and image hosted online.
Setting up N8N for automated API requests to key.ai for Sora 2 video generation.
Steps for manually setting the prompt and image URL in N8N before sending the API request.
Copying and importing the cURL command to make API requests in N8N for task creation.
Explanation of how to retrieve and use the API key for authentication in the request.
Managing errors when the request fails, and troubleshooting with N8N workflow.
Incorporating wait steps in N8N to handle delays while waiting for task completion.
Querying the task status using the task ID to check if the video is ready for download.
Setting up an 'if' condition in N8N to continuously check the task status until success.
Utilizing a set node toJSON code correction extract the video URL from the response JSON for further use.
Using an HTTP request in N8N to download the video after task completion.
Final steps to verify the generated video, including checking the video result in N8N.