1.0
OAS 3.0
Before you can make requests to the API, you need to get an access token.
To get the access token you make the following request:
curl --request POST \
--url https://storykit-dev.eu.auth0.com/oauth/token \
--header 'Content-Type: application/json' \
--data '{
"audience": "https://jarvis.storykit.io",
"grant_type": "client_credentials",
"client_id": "your-client-id",
"client_secret": "your-client-secret"
}'
You receive the client ID and the client secret from your Storykit contact person.
Note: The access token expires after 24 hours and after that you need to retrieve a new one.
In subsequent requests to the API. You authorize the requests by sending the access token as part of
the Authorization
header, like so:
Authorization: Bearer your-access-token
Use the POST /v1/videos
endpoint to create a video. Videos can be created by directly inputting text or using a URL as the source:
if text is used, note that texts shorter than {minTextLength} of the chosen creator might produce low quality scripts. The {minTextLength} for each creator can be found through the GET /v1/creators
endpoint.
if a URL is used, note that scraped URLs with text longer than 200,000 characters will be shortened.
To get possible values for theme
, promptId
,
outputLanguage
, and sourceLanguage
, you can use the corresponding endpoints (e.g. GET /v1/themes
).
Creating a video takes ~1 min. To check the status of the creation and get the final results you use
the GET /v1/videos/:id
endpoint. You receive the video ID as a result from the previous POST
request.
Some errors (e.g bad requests and not-found errors), may come with error codes. Each error code has a corresponding description. You can see this mapping in the table below:
Error Code | Description |
---|---|
1 | Value must be a string. |
2 | Value length must be between 1 - 200,000 characters. |
3 | Value must not be a URL. |
4 | Value must be a valid URL. |
5 | Value must include either URL or text, but not both. |
6 | Value must be a 24-character hexadecimal (0-9, a-f) identifier. |
7 | Value must be one of the following values: square landscape portrait 4:5 coffee. |
8 | Value must not be an empty string (""). |
9 | Video not found. |
10 | Client not found. |
11 | Value must include a quote |
12 | Clients not found. |
13 | Value length must be between 1-320 characters. |
14 | Theme not found. |
15 | Prompt not found. |
16 | Source language not found. |
17 | Output language not found. |
18 | Value must not have more than 10 items. |
19 | Value's extension must be one of the following: .jpg .png .jpeg .webp. |
20 | Unable to upload one of the asset URLs. Please verify that the URL is valid and open to the public. |