import { OctosparkClient } from '@octospark/sdk'
const client = new OctosparkClient({
token: process.env.OCTOSPARK_TOKEN
})
const response = await client.mediaCreation.createGreenScreenMeme({
teamId: process.env.OCTOSPARK_TEAM_ID ?? "teamId",
body: {},
})import os
from octospark_sdk import OctosparkClient
client = OctosparkClient(token=os.environ["OCTOSPARK_TOKEN"])
response = client.media_creation.create_green_screen_meme(
teamId=os.environ.get("OCTOSPARK_TEAM_ID", "teamId"),
body={}
)octospark media-creation create-green-screen-meme \
--request '{"path":{"teamId":"teamId"},"body":{}}'use reqwest::Client;
use std::env;
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let base_url = env::var("OCTOSPARK_API_URL").unwrap_or_else(|_| "https://api.octospark.ai".to_string());
let team_id = env::var("OCTOSPARK_TEAM_ID").unwrap_or_else(|_| "teamId".to_string());
let url = format!("{}/v1/teams/{}/content/green-screen-memes", base_url.trim_end_matches('/'), team_id);
let token = env::var("OCTOSPARK_TOKEN").expect("OCTOSPARK_TOKEN");
let mut request = client.post(url).bearer_auth(token);
request = request.json(&serde_json::json!({}));
let response = request.send().await?;
println!("{}", response.text().await?);
Ok(())
}import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http;
Future<void> main() async {
final baseUrl = Platform.environment['OCTOSPARK_API_URL'] ?? 'https://api.octospark.ai';
final token = Platform.environment['OCTOSPARK_TOKEN'];
final teamId = Platform.environment['OCTOSPARK_TEAM_ID'] ?? 'teamId';
final url = '${baseUrl.replaceFirst(RegExp(r'/$'), '')}/v1/teams/$teamId/content/green-screen-memes';
final uri = Uri.parse(url);
final headers = {
'Authorization': 'Bearer $token',
'Content-Type': 'application/json',
};
final response = await http.post(
uri,
headers: headers,
body: jsonEncode({}),
);
print(response.body);
}curl --request POST \
--url https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"templateAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"backgroundAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"captions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"x": 0.5,
"y": 0.5,
"width": 0.5,
"fontFamily": "<string>",
"fontSize": 259,
"fill": "<string>",
"stroke": "<string>",
"strokeWidth": 10,
"bold": true,
"uppercase": true,
"height": 0.5,
"rotation": 0,
"italic": true,
"shadow": true,
"opacity": 0.5
}
],
"audio": {
"volume": 0.5
},
"chromaKey": {
"keyColor": "<string>",
"similarity": 0.5,
"blend": 0.5,
"despill": 0.5,
"version": 123,
"confidence": 0.5
}
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'templateAssetId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'backgroundAssetId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'title' => '<string>',
'captions' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'text' => '<string>',
'x' => 0.5,
'y' => 0.5,
'width' => 0.5,
'fontFamily' => '<string>',
'fontSize' => 259,
'fill' => '<string>',
'stroke' => '<string>',
'strokeWidth' => 10,
'bold' => true,
'uppercase' => true,
'height' => 0.5,
'rotation' => 0,
'italic' => true,
'shadow' => true,
'opacity' => 0.5
]
],
'audio' => [
'volume' => 0.5
],
'chromaKey' => [
'keyColor' => '<string>',
'similarity' => 0.5,
'blend' => 0.5,
'despill' => 0.5,
'version' => 123,
'confidence' => 0.5
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"idempotency-key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes"
payload := strings.NewReader("{\n \"templateAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"backgroundAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"captions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"x\": 0.5,\n \"y\": 0.5,\n \"width\": 0.5,\n \"fontFamily\": \"<string>\",\n \"fontSize\": 259,\n \"fill\": \"<string>\",\n \"stroke\": \"<string>\",\n \"strokeWidth\": 10,\n \"bold\": true,\n \"uppercase\": true,\n \"height\": 0.5,\n \"rotation\": 0,\n \"italic\": true,\n \"shadow\": true,\n \"opacity\": 0.5\n }\n ],\n \"audio\": {\n \"volume\": 0.5\n },\n \"chromaKey\": {\n \"keyColor\": \"<string>\",\n \"similarity\": 0.5,\n \"blend\": 0.5,\n \"despill\": 0.5,\n \"version\": 123,\n \"confidence\": 0.5\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("idempotency-key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes")
.header("idempotency-key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"templateAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"backgroundAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"captions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"x\": 0.5,\n \"y\": 0.5,\n \"width\": 0.5,\n \"fontFamily\": \"<string>\",\n \"fontSize\": 259,\n \"fill\": \"<string>\",\n \"stroke\": \"<string>\",\n \"strokeWidth\": 10,\n \"bold\": true,\n \"uppercase\": true,\n \"height\": 0.5,\n \"rotation\": 0,\n \"italic\": true,\n \"shadow\": true,\n \"opacity\": 0.5\n }\n ],\n \"audio\": {\n \"volume\": 0.5\n },\n \"chromaKey\": {\n \"keyColor\": \"<string>\",\n \"similarity\": 0.5,\n \"blend\": 0.5,\n \"despill\": 0.5,\n \"version\": 123,\n \"confidence\": 0.5\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["idempotency-key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"templateAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"backgroundAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"captions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"x\": 0.5,\n \"y\": 0.5,\n \"width\": 0.5,\n \"fontFamily\": \"<string>\",\n \"fontSize\": 259,\n \"fill\": \"<string>\",\n \"stroke\": \"<string>\",\n \"strokeWidth\": 10,\n \"bold\": true,\n \"uppercase\": true,\n \"height\": 0.5,\n \"rotation\": 0,\n \"italic\": true,\n \"shadow\": true,\n \"opacity\": 0.5\n }\n ],\n \"audio\": {\n \"volume\": 0.5\n },\n \"chromaKey\": {\n \"keyColor\": \"<string>\",\n \"similarity\": 0.5,\n \"blend\": 0.5,\n \"despill\": 0.5,\n \"version\": 123,\n \"confidence\": 0.5\n }\n}"
response = http.request(request)
puts response.read_body$headers=@{}
$headers.Add("idempotency-key", "<idempotency-key>")
$headers.Add("Authorization", "Bearer <token>")
$headers.Add("Content-Type", "application/json")
$response = Invoke-WebRequest -Uri 'https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"templateAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"backgroundAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"captions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"x": 0.5,
"y": 0.5,
"width": 0.5,
"fontFamily": "<string>",
"fontSize": 259,
"fill": "<string>",
"stroke": "<string>",
"strokeWidth": 10,
"bold": true,
"uppercase": true,
"height": 0.5,
"rotation": 0,
"italic": true,
"shadow": true,
"opacity": 0.5
}
],
"audio": {
"volume": 0.5
},
"chromaKey": {
"keyColor": "<string>",
"similarity": 0.5,
"blend": 0.5,
"despill": 0.5,
"version": 123,
"confidence": 0.5
}
}'import Foundation
let parameters = [
"templateAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"backgroundAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"captions": [
[
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"x": 0.5,
"y": 0.5,
"width": 0.5,
"fontFamily": "<string>",
"fontSize": 259,
"fill": "<string>",
"stroke": "<string>",
"strokeWidth": 10,
"bold": true,
"uppercase": true,
"height": 0.5,
"rotation": 0,
"italic": true,
"shadow": true,
"opacity": 0.5
]
],
"audio": ["volume": 0.5],
"chromaKey": [
"keyColor": "<string>",
"similarity": 0.5,
"blend": 0.5,
"despill": 0.5,
"version": 123,
"confidence": 0.5
]
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"idempotency-key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))using RestSharp;
var options = new RestClientOptions("https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("idempotency-key", "<idempotency-key>");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"templateAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"backgroundAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"captions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"x\": 0.5,\n \"y\": 0.5,\n \"width\": 0.5,\n \"fontFamily\": \"<string>\",\n \"fontSize\": 259,\n \"fill\": \"<string>\",\n \"stroke\": \"<string>\",\n \"strokeWidth\": 10,\n \"bold\": true,\n \"uppercase\": true,\n \"height\": 0.5,\n \"rotation\": 0,\n \"italic\": true,\n \"shadow\": true,\n \"opacity\": 0.5\n }\n ],\n \"audio\": {\n \"volume\": 0.5\n },\n \"chromaKey\": {\n \"keyColor\": \"<string>\",\n \"similarity\": 0.5,\n \"blend\": 0.5,\n \"despill\": 0.5,\n \"version\": 123,\n \"confidence\": 0.5\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
using RestSharp;
var options = new RestClientOptions("https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("idempotency-key", "<idempotency-key>");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"templateAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"backgroundAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"captions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"x\": 0.5,\n \"y\": 0.5,\n \"width\": 0.5,\n \"fontFamily\": \"<string>\",\n \"fontSize\": 259,\n \"fill\": \"<string>\",\n \"stroke\": \"<string>\",\n \"strokeWidth\": 10,\n \"bold\": true,\n \"uppercase\": true,\n \"height\": 0.5,\n \"rotation\": 0,\n \"italic\": true,\n \"shadow\": true,\n \"opacity\": 0.5\n }\n ],\n \"audio\": {\n \"volume\": 0.5\n },\n \"chromaKey\": {\n \"keyColor\": \"<string>\",\n \"similarity\": 0.5,\n \"blend\": 0.5,\n \"despill\": 0.5,\n \"version\": 123,\n \"confidence\": 0.5\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "idempotency-key: <idempotency-key>");
headers = curl_slist_append(headers, "Authorization: Bearer <token>");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"templateAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"backgroundAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"captions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"x\": 0.5,\n \"y\": 0.5,\n \"width\": 0.5,\n \"fontFamily\": \"<string>\",\n \"fontSize\": 259,\n \"fill\": \"<string>\",\n \"stroke\": \"<string>\",\n \"strokeWidth\": 10,\n \"bold\": true,\n \"uppercase\": true,\n \"height\": 0.5,\n \"rotation\": 0,\n \"italic\": true,\n \"shadow\": true,\n \"opacity\": 0.5\n }\n ],\n \"audio\": {\n \"volume\": 0.5\n },\n \"chromaKey\": {\n \"keyColor\": \"<string>\",\n \"similarity\": 0.5,\n \"blend\": 0.5,\n \"despill\": 0.5,\n \"version\": 123,\n \"confidence\": 0.5\n }\n}");
CURLcode ret = curl_easy_perform(hnd);CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "idempotency-key: <idempotency-key>");
headers = curl_slist_append(headers, "Authorization: Bearer <token>");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"templateAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"backgroundAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"captions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"x\": 0.5,\n \"y\": 0.5,\n \"width\": 0.5,\n \"fontFamily\": \"<string>\",\n \"fontSize\": 259,\n \"fill\": \"<string>\",\n \"stroke\": \"<string>\",\n \"strokeWidth\": 10,\n \"bold\": true,\n \"uppercase\": true,\n \"height\": 0.5,\n \"rotation\": 0,\n \"italic\": true,\n \"shadow\": true,\n \"opacity\": 0.5\n }\n ],\n \"audio\": {\n \"volume\": 0.5\n },\n \"chromaKey\": {\n \"keyColor\": \"<string>\",\n \"similarity\": 0.5,\n \"blend\": 0.5,\n \"despill\": 0.5,\n \"version\": 123,\n \"confidence\": 0.5\n }\n}");
CURLcode ret = curl_easy_perform(hnd);val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"templateAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"backgroundAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"captions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"x\": 0.5,\n \"y\": 0.5,\n \"width\": 0.5,\n \"fontFamily\": \"<string>\",\n \"fontSize\": 259,\n \"fill\": \"<string>\",\n \"stroke\": \"<string>\",\n \"strokeWidth\": 10,\n \"bold\": true,\n \"uppercase\": true,\n \"height\": 0.5,\n \"rotation\": 0,\n \"italic\": true,\n \"shadow\": true,\n \"opacity\": 0.5\n }\n ],\n \"audio\": {\n \"volume\": 0.5\n },\n \"chromaKey\": {\n \"keyColor\": \"<string>\",\n \"similarity\": 0.5,\n \"blend\": 0.5,\n \"despill\": 0.5,\n \"version\": 123,\n \"confidence\": 0.5\n }\n}")
val request = Request.Builder()
.url("https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes")
.post(body)
.addHeader("idempotency-key", "<idempotency-key>")
.addHeader("Authorization", "Bearer <token>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute(){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contentItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "generation",
"status": "<string>",
"targetSlideId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"regenerationScope": "text",
"baseRevision": 123,
"resultRevision": 123,
"workflowId": "<string>",
"renderJobId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outputAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errorCode": "<string>",
"diagnostics": "<string>",
"pauseReason": "<string>",
"maxSpendDecimillicents": 123,
"spentDecimillicents": 123,
"activeDurationMs": 123,
"links": {
"self": "<string>",
"events": "<string>",
"slideshow": "<string>"
}
}{
"issues": [
{
"_tag": "Pointer",
"path": [
"<string>"
],
"message": "<string>"
}
],
"message": "<string>",
"_tag": "HttpApiDecodeError"
}{
"message": "<string>",
"_tag": "Unauthorized"
}{
"message": "<string>",
"_tag": "PaymentRequired"
}{
"message": "<string>",
"_tag": "Forbidden"
}{
"message": "<string>",
"_tag": "NotFound"
}{
"message": "<string>",
"_tag": "Conflict",
"code": "<string>",
"currentRevision": 123
}{
"message": "<string>",
"code": "<string>",
"_tag": "UnprocessableEntity"
}{
"message": "<string>",
"_tag": "TooManyRequests",
"code": "<string>",
"retryAfterSeconds": 123
}{
"message": "<string>",
"_tag": "InternalError"
}Create green screen meme
Composite a green-screen template over a chosen background and add captions. Rendering is asynchronous and uses the saved template calibration; poll the returned run and send an Idempotency-Key for a safe retry.
import { OctosparkClient } from '@octospark/sdk'
const client = new OctosparkClient({
token: process.env.OCTOSPARK_TOKEN
})
const response = await client.mediaCreation.createGreenScreenMeme({
teamId: process.env.OCTOSPARK_TEAM_ID ?? "teamId",
body: {},
})import os
from octospark_sdk import OctosparkClient
client = OctosparkClient(token=os.environ["OCTOSPARK_TOKEN"])
response = client.media_creation.create_green_screen_meme(
teamId=os.environ.get("OCTOSPARK_TEAM_ID", "teamId"),
body={}
)octospark media-creation create-green-screen-meme \
--request '{"path":{"teamId":"teamId"},"body":{}}'use reqwest::Client;
use std::env;
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let base_url = env::var("OCTOSPARK_API_URL").unwrap_or_else(|_| "https://api.octospark.ai".to_string());
let team_id = env::var("OCTOSPARK_TEAM_ID").unwrap_or_else(|_| "teamId".to_string());
let url = format!("{}/v1/teams/{}/content/green-screen-memes", base_url.trim_end_matches('/'), team_id);
let token = env::var("OCTOSPARK_TOKEN").expect("OCTOSPARK_TOKEN");
let mut request = client.post(url).bearer_auth(token);
request = request.json(&serde_json::json!({}));
let response = request.send().await?;
println!("{}", response.text().await?);
Ok(())
}import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http;
Future<void> main() async {
final baseUrl = Platform.environment['OCTOSPARK_API_URL'] ?? 'https://api.octospark.ai';
final token = Platform.environment['OCTOSPARK_TOKEN'];
final teamId = Platform.environment['OCTOSPARK_TEAM_ID'] ?? 'teamId';
final url = '${baseUrl.replaceFirst(RegExp(r'/$'), '')}/v1/teams/$teamId/content/green-screen-memes';
final uri = Uri.parse(url);
final headers = {
'Authorization': 'Bearer $token',
'Content-Type': 'application/json',
};
final response = await http.post(
uri,
headers: headers,
body: jsonEncode({}),
);
print(response.body);
}curl --request POST \
--url https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"templateAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"backgroundAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"captions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"x": 0.5,
"y": 0.5,
"width": 0.5,
"fontFamily": "<string>",
"fontSize": 259,
"fill": "<string>",
"stroke": "<string>",
"strokeWidth": 10,
"bold": true,
"uppercase": true,
"height": 0.5,
"rotation": 0,
"italic": true,
"shadow": true,
"opacity": 0.5
}
],
"audio": {
"volume": 0.5
},
"chromaKey": {
"keyColor": "<string>",
"similarity": 0.5,
"blend": 0.5,
"despill": 0.5,
"version": 123,
"confidence": 0.5
}
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'templateAssetId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'backgroundAssetId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'title' => '<string>',
'captions' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'text' => '<string>',
'x' => 0.5,
'y' => 0.5,
'width' => 0.5,
'fontFamily' => '<string>',
'fontSize' => 259,
'fill' => '<string>',
'stroke' => '<string>',
'strokeWidth' => 10,
'bold' => true,
'uppercase' => true,
'height' => 0.5,
'rotation' => 0,
'italic' => true,
'shadow' => true,
'opacity' => 0.5
]
],
'audio' => [
'volume' => 0.5
],
'chromaKey' => [
'keyColor' => '<string>',
'similarity' => 0.5,
'blend' => 0.5,
'despill' => 0.5,
'version' => 123,
'confidence' => 0.5
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"idempotency-key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes"
payload := strings.NewReader("{\n \"templateAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"backgroundAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"captions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"x\": 0.5,\n \"y\": 0.5,\n \"width\": 0.5,\n \"fontFamily\": \"<string>\",\n \"fontSize\": 259,\n \"fill\": \"<string>\",\n \"stroke\": \"<string>\",\n \"strokeWidth\": 10,\n \"bold\": true,\n \"uppercase\": true,\n \"height\": 0.5,\n \"rotation\": 0,\n \"italic\": true,\n \"shadow\": true,\n \"opacity\": 0.5\n }\n ],\n \"audio\": {\n \"volume\": 0.5\n },\n \"chromaKey\": {\n \"keyColor\": \"<string>\",\n \"similarity\": 0.5,\n \"blend\": 0.5,\n \"despill\": 0.5,\n \"version\": 123,\n \"confidence\": 0.5\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("idempotency-key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes")
.header("idempotency-key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"templateAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"backgroundAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"captions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"x\": 0.5,\n \"y\": 0.5,\n \"width\": 0.5,\n \"fontFamily\": \"<string>\",\n \"fontSize\": 259,\n \"fill\": \"<string>\",\n \"stroke\": \"<string>\",\n \"strokeWidth\": 10,\n \"bold\": true,\n \"uppercase\": true,\n \"height\": 0.5,\n \"rotation\": 0,\n \"italic\": true,\n \"shadow\": true,\n \"opacity\": 0.5\n }\n ],\n \"audio\": {\n \"volume\": 0.5\n },\n \"chromaKey\": {\n \"keyColor\": \"<string>\",\n \"similarity\": 0.5,\n \"blend\": 0.5,\n \"despill\": 0.5,\n \"version\": 123,\n \"confidence\": 0.5\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["idempotency-key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"templateAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"backgroundAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"captions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"x\": 0.5,\n \"y\": 0.5,\n \"width\": 0.5,\n \"fontFamily\": \"<string>\",\n \"fontSize\": 259,\n \"fill\": \"<string>\",\n \"stroke\": \"<string>\",\n \"strokeWidth\": 10,\n \"bold\": true,\n \"uppercase\": true,\n \"height\": 0.5,\n \"rotation\": 0,\n \"italic\": true,\n \"shadow\": true,\n \"opacity\": 0.5\n }\n ],\n \"audio\": {\n \"volume\": 0.5\n },\n \"chromaKey\": {\n \"keyColor\": \"<string>\",\n \"similarity\": 0.5,\n \"blend\": 0.5,\n \"despill\": 0.5,\n \"version\": 123,\n \"confidence\": 0.5\n }\n}"
response = http.request(request)
puts response.read_body$headers=@{}
$headers.Add("idempotency-key", "<idempotency-key>")
$headers.Add("Authorization", "Bearer <token>")
$headers.Add("Content-Type", "application/json")
$response = Invoke-WebRequest -Uri 'https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"templateAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"backgroundAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"captions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"x": 0.5,
"y": 0.5,
"width": 0.5,
"fontFamily": "<string>",
"fontSize": 259,
"fill": "<string>",
"stroke": "<string>",
"strokeWidth": 10,
"bold": true,
"uppercase": true,
"height": 0.5,
"rotation": 0,
"italic": true,
"shadow": true,
"opacity": 0.5
}
],
"audio": {
"volume": 0.5
},
"chromaKey": {
"keyColor": "<string>",
"similarity": 0.5,
"blend": 0.5,
"despill": 0.5,
"version": 123,
"confidence": 0.5
}
}'import Foundation
let parameters = [
"templateAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"backgroundAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"captions": [
[
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"x": 0.5,
"y": 0.5,
"width": 0.5,
"fontFamily": "<string>",
"fontSize": 259,
"fill": "<string>",
"stroke": "<string>",
"strokeWidth": 10,
"bold": true,
"uppercase": true,
"height": 0.5,
"rotation": 0,
"italic": true,
"shadow": true,
"opacity": 0.5
]
],
"audio": ["volume": 0.5],
"chromaKey": [
"keyColor": "<string>",
"similarity": 0.5,
"blend": 0.5,
"despill": 0.5,
"version": 123,
"confidence": 0.5
]
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"idempotency-key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))using RestSharp;
var options = new RestClientOptions("https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("idempotency-key", "<idempotency-key>");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"templateAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"backgroundAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"captions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"x\": 0.5,\n \"y\": 0.5,\n \"width\": 0.5,\n \"fontFamily\": \"<string>\",\n \"fontSize\": 259,\n \"fill\": \"<string>\",\n \"stroke\": \"<string>\",\n \"strokeWidth\": 10,\n \"bold\": true,\n \"uppercase\": true,\n \"height\": 0.5,\n \"rotation\": 0,\n \"italic\": true,\n \"shadow\": true,\n \"opacity\": 0.5\n }\n ],\n \"audio\": {\n \"volume\": 0.5\n },\n \"chromaKey\": {\n \"keyColor\": \"<string>\",\n \"similarity\": 0.5,\n \"blend\": 0.5,\n \"despill\": 0.5,\n \"version\": 123,\n \"confidence\": 0.5\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
using RestSharp;
var options = new RestClientOptions("https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("idempotency-key", "<idempotency-key>");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"templateAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"backgroundAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"captions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"x\": 0.5,\n \"y\": 0.5,\n \"width\": 0.5,\n \"fontFamily\": \"<string>\",\n \"fontSize\": 259,\n \"fill\": \"<string>\",\n \"stroke\": \"<string>\",\n \"strokeWidth\": 10,\n \"bold\": true,\n \"uppercase\": true,\n \"height\": 0.5,\n \"rotation\": 0,\n \"italic\": true,\n \"shadow\": true,\n \"opacity\": 0.5\n }\n ],\n \"audio\": {\n \"volume\": 0.5\n },\n \"chromaKey\": {\n \"keyColor\": \"<string>\",\n \"similarity\": 0.5,\n \"blend\": 0.5,\n \"despill\": 0.5,\n \"version\": 123,\n \"confidence\": 0.5\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "idempotency-key: <idempotency-key>");
headers = curl_slist_append(headers, "Authorization: Bearer <token>");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"templateAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"backgroundAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"captions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"x\": 0.5,\n \"y\": 0.5,\n \"width\": 0.5,\n \"fontFamily\": \"<string>\",\n \"fontSize\": 259,\n \"fill\": \"<string>\",\n \"stroke\": \"<string>\",\n \"strokeWidth\": 10,\n \"bold\": true,\n \"uppercase\": true,\n \"height\": 0.5,\n \"rotation\": 0,\n \"italic\": true,\n \"shadow\": true,\n \"opacity\": 0.5\n }\n ],\n \"audio\": {\n \"volume\": 0.5\n },\n \"chromaKey\": {\n \"keyColor\": \"<string>\",\n \"similarity\": 0.5,\n \"blend\": 0.5,\n \"despill\": 0.5,\n \"version\": 123,\n \"confidence\": 0.5\n }\n}");
CURLcode ret = curl_easy_perform(hnd);CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "idempotency-key: <idempotency-key>");
headers = curl_slist_append(headers, "Authorization: Bearer <token>");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"templateAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"backgroundAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"captions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"x\": 0.5,\n \"y\": 0.5,\n \"width\": 0.5,\n \"fontFamily\": \"<string>\",\n \"fontSize\": 259,\n \"fill\": \"<string>\",\n \"stroke\": \"<string>\",\n \"strokeWidth\": 10,\n \"bold\": true,\n \"uppercase\": true,\n \"height\": 0.5,\n \"rotation\": 0,\n \"italic\": true,\n \"shadow\": true,\n \"opacity\": 0.5\n }\n ],\n \"audio\": {\n \"volume\": 0.5\n },\n \"chromaKey\": {\n \"keyColor\": \"<string>\",\n \"similarity\": 0.5,\n \"blend\": 0.5,\n \"despill\": 0.5,\n \"version\": 123,\n \"confidence\": 0.5\n }\n}");
CURLcode ret = curl_easy_perform(hnd);val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"templateAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"backgroundAssetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"captions\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"x\": 0.5,\n \"y\": 0.5,\n \"width\": 0.5,\n \"fontFamily\": \"<string>\",\n \"fontSize\": 259,\n \"fill\": \"<string>\",\n \"stroke\": \"<string>\",\n \"strokeWidth\": 10,\n \"bold\": true,\n \"uppercase\": true,\n \"height\": 0.5,\n \"rotation\": 0,\n \"italic\": true,\n \"shadow\": true,\n \"opacity\": 0.5\n }\n ],\n \"audio\": {\n \"volume\": 0.5\n },\n \"chromaKey\": {\n \"keyColor\": \"<string>\",\n \"similarity\": 0.5,\n \"blend\": 0.5,\n \"despill\": 0.5,\n \"version\": 123,\n \"confidence\": 0.5\n }\n}")
val request = Request.Builder()
.url("https://api-staging.octospark.ai/v1/teams/{teamId}/content/green-screen-memes")
.post(body)
.addHeader("idempotency-key", "<idempotency-key>")
.addHeader("Authorization", "Bearer <token>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute(){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contentItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "generation",
"status": "<string>",
"targetSlideId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"regenerationScope": "text",
"baseRevision": 123,
"resultRevision": 123,
"workflowId": "<string>",
"renderJobId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outputAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errorCode": "<string>",
"diagnostics": "<string>",
"pauseReason": "<string>",
"maxSpendDecimillicents": 123,
"spentDecimillicents": 123,
"activeDurationMs": 123,
"links": {
"self": "<string>",
"events": "<string>",
"slideshow": "<string>"
}
}{
"issues": [
{
"_tag": "Pointer",
"path": [
"<string>"
],
"message": "<string>"
}
],
"message": "<string>",
"_tag": "HttpApiDecodeError"
}{
"message": "<string>",
"_tag": "Unauthorized"
}{
"message": "<string>",
"_tag": "PaymentRequired"
}{
"message": "<string>",
"_tag": "Forbidden"
}{
"message": "<string>",
"_tag": "NotFound"
}{
"message": "<string>",
"_tag": "Conflict",
"code": "<string>",
"currentRevision": 123
}{
"message": "<string>",
"code": "<string>",
"_tag": "UnprocessableEntity"
}{
"message": "<string>",
"_tag": "TooManyRequests",
"code": "<string>",
"retryAfterSeconds": 123
}{
"message": "<string>",
"_tag": "InternalError"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
a string at most 200 character(s) long
1 - 200Path Parameters
Team (workspace) id (UUID). Discover ids via the list teams endpoint or the agent context.
Body
a Universally Unique Identifier
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$a Universally Unique Identifier
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$a string at most 200 character(s) long
200Output proportions used to size the background and composition.
9:16, 16:9, 1:1, 4:5 an array of at most 20 item(s)
20Show child attributes
Show child attributes
Choose whether to keep or mute the template audio and its playback volume from zero to one.
Show child attributes
Show child attributes
Saved template calibration for removing the screen colour and reducing colour spill. Editors obtain this from template metadata automatically.
Show child attributes
Show child attributes
Response
Success
a Universally Unique Identifier
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$a Universally Unique Identifier
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$generation, slide_regeneration, edit a Universally Unique Identifier
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$text, image, layout, style, all an integer
an integer
a Universally Unique Identifier
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$a Universally Unique Identifier
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$Show child attributes
Show child attributes