Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ CREDIT_PACK_STARTER_CHECKOUT_URL=
CREDIT_PACK_PRO_CHECKOUT_URL=
CREDIT_PACK_RENDER_CHECKOUT_URL=

# Talocode Cloud API key (primary — replaces CLIPLOOP_API_KEY)
TALOCODE_API_KEY=
# Talocode Cloud API base URL
TALOCODE_BASE_URL=https://api.talocode.site

# Legacy ClipLoop API key (deprecated — use TALOCODE_API_KEY instead)
CLIPLOOP_API_KEY=

# ClipLoop cloud engine providers (optional; not required for tests)
CLIPLOOP_PROVIDER=
CLIPLOOP_RENDER_PROVIDER=
REMOTION_RENDER_ENABLED=false
STORAGE_BUCKET=
STORAGE_PUBLIC_URL=

# Gateway split scaffolding (local defaults; no public gateway enabled yet)
CLIPLOOP_GATEWAY_ENABLED=false
CLIPLOOP_GATEWAY_MODE=local_app
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,17 @@ LEMON_SQUEEZY_WEBHOOK_SECRET=
- The app uses Lemon Squeezy hosted checkout and customer-portal links rather than a custom in-app billing portal.
- Real auth is still minimal, so in non-mock environments the checkout launcher relies on the email entered at checkout start to create or match the account record.

## Talocode Domains

| Domain | Purpose |
|--------|---------|
| [talocode.site](https://talocode.site) | Main site / homepage |
| [docs.talocode.site](https://docs.talocode.site) | Documentation |
| [api.talocode.site](https://api.talocode.site) | API endpoint |
| [cloud.talocode.site](https://cloud.talocode.site) | Cloud dashboard |
| [stacklane.talocode.site](https://stacklane.talocode.site) | Stacklane platform |
| [dashboard.talocode.site](https://dashboard.talocode.site) | Dashboard |

## Developer docs site

The ClipLoop developer documentation lives in `docs-site/` and is served at https://docs.cliploop.site.
Expand Down
21 changes: 21 additions & 0 deletions app/api/v1/cliploop/brief/generate/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { handleRoute } from '@/lib/talocode-route-handler'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Do not add a root app directory beside src/app

This creates a root-level app/ directory in a project whose real routes live under src/app; Next documents that src/app is ignored when a root app directory is present (https://nextjs.org/docs/app/api-reference/file-conventions/src-folder). In this context the existing pages and public API routes under src/app would drop out of routing, leaving only these new root routes active.

Useful? React with 👍 / 👎.


export async function POST(request: Request): Promise<Response> {
return handleRoute(
request,
{ action: 'brief.generate', credits: 15 },
async () => {
const body = await request.json().catch(() => ({}))
// TODO: implement full brief generation flow
return Response.json({
ok: true,
data: {
id: `brief_${Date.now()}`,
brief: body.prompt ?? '',
channel: body.channel ?? 'twitter',
estimatedDuration: 15,
},
})
},
)
}
21 changes: 21 additions & 0 deletions app/api/v1/cliploop/campaign/create/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { handleRoute } from '@/lib/talocode-route-handler'

export async function POST(request: Request): Promise<Response> {
return handleRoute(
request,
{ action: 'campaign.create', credits: 50 },
async () => {
const body = await request.json().catch(() => ({}))
// TODO: implement campaign creation
return Response.json({
ok: true,
data: {
id: `camp_${Date.now()}`,
name: body.name ?? 'Untitled Campaign',
status: 'draft',
videos: [],
},
})
},
)
}
21 changes: 21 additions & 0 deletions app/api/v1/cliploop/campaign/package/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { handleRoute } from '@/lib/talocode-route-handler'

export async function POST(request: Request): Promise<Response> {
return handleRoute(
request,
{ action: 'campaign.package', credits: 400 },
async () => {
const body = await request.json().catch(() => ({}))
// TODO: implement full campaign packaging
return Response.json({
ok: true,
data: {
id: body.campaignId ?? `camp_${Date.now()}`,
name: 'Packaged Campaign',
status: 'packaged',
videos: [],
},
})
},
)
}
14 changes: 14 additions & 0 deletions app/api/v1/cliploop/health/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export async function GET(): Promise<Response> {
return Response.json({
status: 'ok',
service: 'cliploop',
endpoints: [
'POST /v1/cliploop/brief/generate',
'POST /v1/cliploop/script/generate',
'POST /v1/cliploop/video/render',
'POST /v1/cliploop/campaign/create',
'POST /v1/cliploop/campaign/package',
'GET /v1/cliploop/health',
],
})
}
22 changes: 22 additions & 0 deletions app/api/v1/cliploop/script/generate/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { handleRoute } from '@/lib/talocode-route-handler'

export async function POST(request: Request): Promise<Response> {
return handleRoute(
request,
{ action: 'script.generate', credits: 15 },
async () => {
const body = await request.json().catch(() => ({}))
// TODO: implement full script generation
return Response.json({
ok: true,
data: {
id: `script_${Date.now()}`,
script: 'Generated script based on brief.',
scenes: [
{ index: 0, visual: 'Intro scene', narration: 'Opening narration', duration: 5 },
],
},
})
},
)
}
21 changes: 21 additions & 0 deletions app/api/v1/cliploop/video/render/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { handleRoute } from '@/lib/talocode-route-handler'

export async function POST(request: Request): Promise<Response> {
return handleRoute(
request,
{ action: 'video.render', credits: 200 },
async () => {
const body = await request.json().catch(() => ({}))
// TODO: implement full render pipeline
return Response.json({
ok: true,
data: {
id: `render_${Date.now()}`,
status: 'rendering' as const,
duration: 30,
creditsCharged: 200,
},
})
},
)
}
3 changes: 2 additions & 1 deletion docs-site/cli/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ <h2 id="planned-commands">Planned commands</h2>
<li><code>cliploop download</code></li>
</ul>
<h2 id="server-and-ci">Server and CI usage</h2>
<p>For automation, set <code>CLIPLOOP_API_KEY</code> in your environment instead of interactive login. This works for backend jobs, CI pipelines, and short release workflows.</p>
<p>For automation, set <code>TALOCODE_API_KEY</code> in your environment instead of interactive login. This works for backend jobs, CI pipelines, and short release workflows.</p>
<p><strong>Deprecation note:</strong> <code>CLIPLOOP_API_KEY</code> is deprecated. Use <code>TALOCODE_API_KEY</code> for all hosted ClipLoop API access.</p>
<h2 id="useful-for">Useful for</h2>
<ul>
<li>Indie builders iterating in terminals.</li>
Expand Down
3 changes: 2 additions & 1 deletion docs-site/dist/cli/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ <h2 id="planned-commands">Planned commands</h2>
<li><code>cliploop download</code></li>
</ul>
<h2 id="server-and-ci">Server and CI usage</h2>
<p>For automation, set <code>CLIPLOOP_API_KEY</code> in your environment instead of interactive login. This works for backend jobs, CI pipelines, and short release workflows.</p>
<p>For automation, set <code>TALOCODE_API_KEY</code> in your environment instead of interactive login. This works for backend jobs, CI pipelines, and short release workflows.</p>
<p><strong>Deprecation note:</strong> <code>CLIPLOOP_API_KEY</code> is deprecated. Use <code>TALOCODE_API_KEY</code> for all hosted ClipLoop API access.</p>
<h2 id="useful-for">Useful for</h2>
<ul>
<li>Indie builders iterating in terminals.</li>
Expand Down
81 changes: 12 additions & 69 deletions docs-site/dist/examples/index.html
Original file line number Diff line number Diff line change
@@ -1,52 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes">
<title>Examples · ClipLoop Developer Docs</title>
<link rel="stylesheet" href="/styles.css">
</head>
<body>
<a href="#content" class="skip-link">Skip to content</a>
<button class="mobile-toggle" aria-label="Open menu" onclick="document.getElementById('sidebar').classList.add('open');document.getElementById('overlay').classList.add('open')">☰</button>
<div class="sidebar-overlay" id="overlay" onclick="document.getElementById('sidebar').classList.remove('open');document.getElementById('overlay').classList.remove('open')"></div>
<nav class="sidebar" id="sidebar" aria-label="Docs navigation">
<div class="logo">
<div class="logo-mark">CL</div>
<div class="logo-text">ClipLoop<small>Developer Docs</small></div>
</div>
<div class="nav-section">
<div class="nav-section-title">Getting Started</div>
<a href="/overview/" class="nav-link ">Overview</a>
<a href="/quickstart/" class="nav-link ">Quickstart</a>
<a href="/authentication/" class="nav-link ">Authentication</a>
<a href="/idempotency/" class="nav-link ">Idempotency</a>
<a href="/credits/" class="nav-link ">Credits & Billing</a>
</div>
<div class="nav-divider"></div>
<div class="nav-section">
<div class="nav-section-title">API Reference</div>
<a href="/weekly-promo-api/" class="nav-link ">Weekly Promo API</a>
<a href="/examples/" class="nav-link active">Examples</a>
<a href="/errors/" class="nav-link ">Error Codes</a>
</div>
<div class="nav-divider"></div>
<div class="nav-section">
<div class="nav-section-title">More</div>
<a href="/roadmap/" class="nav-link ">Roadmap</a>
<a href="https://app.cliploop.site" class="nav-link">App Dashboard →</a>
<a href="https://cliploop.site" class="nav-link">Marketing Site →</a>
</div>
</nav>
<main class="main" id="content">
<div class="content">

<h1>Examples</h1>
<h1>Examples</h1>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore the generated examples page shell

The generated docs-site/dist/examples/index.html was replaced with only the inner fragment, unlike the other files under docs-site/dist that include the full document shell. If this dist directory is deployed, the Examples page loses its doctype, stylesheet, sidebar navigation, footer, and script.

Useful? React with 👍 / 👎.

<p class="lead">Copy and adapt these examples to call the Weekly Promo API from your backend or scripts.</p>

<h2 id="curl">cURL</h2>
<div class="code-block"><code>curl -X POST https://app.cliploop.site/api/public/weekly-promo \
-H "Authorization: Bearer $CLIPLOOP_API_KEY" \
-H "Authorization: Bearer $TALOCODE_API_KEY" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
-d '{
Expand All @@ -63,7 +20,7 @@ <h2 id="javascript">JavaScript (fetch)</h2>
<div class="code-block"><code>const response = await fetch("https://app.cliploop.site/api/public/weekly-promo", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CLIPLOOP_API_KEY}`,
Authorization: `Bearer ${process.env.TALOCODE_API_KEY}`,
"Idempotency-Key": `promo-${Date.now()}`,
"Content-Type": "application/json"
},
Expand All @@ -84,7 +41,7 @@ <h2 id="node">Node.js</h2>
<div class="code-block"><code>const response = await fetch("https://app.cliploop.site/api/public/weekly-promo", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CLIPLOOP_API_KEY}`,
Authorization: `Bearer ${process.env.TALOCODE_API_KEY}`,
"Idempotency-Key": `promo-${Date.now()}`,
"Content-Type": "application/json"
},
Expand All @@ -102,27 +59,13 @@ <h2 id="node">Node.js</h2>
if (!response.ok) throw new Error(data.error?.message || `HTTP ${response.status}`);</code></div>

<h2 id="environment-variables">Environment variables</h2>
<div class="code-block"><code>CLIPLOOP_API_KEY=clp_li...
<div class="code-block"><code># Primary
TALOCODE_API_KEY=tk_...
TALOCODE_BASE_URL=https://api.talocode.site

# Legacy (deprecated)
# CLIPLOOP_API_KEY=clp_...

IDEMPOTENCY_KEY=promo-2026-05-30-cliploop</code></div>
<div class="callout">⚠️ Never commit real API keys to source control. Store them in environment variables or a secrets manager.</div>

<footer>
<p style="display:flex; flex-wrap:wrap; gap:14px; align-items:center; justify-content:space-between">
<span>© 2026 ClipLoop · Built by <a href="https://talocode.com" style="color:var(--text3)">Talocode</a></span>
<span style="display:flex; gap:14px">
<a href="https://cliploop.site">Marketing</a>
<a href="https://app.cliploop.site">Dashboard</a>
<a href="https://github.com/talocode/cliploop">GitHub</a>
</span>
</p>
</footer>
</div>
</main>
<script>
document.getElementById('overlay').addEventListener('click', function(){
document.getElementById('sidebar').classList.remove('open');
this.classList.remove('open');
});
</script>
</body>
</html>
<div class="callout">⚠️ <code>CLIPLOOP_API_KEY</code> is deprecated. Use <code>TALOCODE_API_KEY</code> for all hosted ClipLoop API access.</div>
11 changes: 8 additions & 3 deletions docs-site/dist/sdks/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,19 @@ <h2 id="official-typescript-sdk">Official TypeScript SDK</h2>
<h2 id="installation">Installation</h2>
<pre><code>npm install @cliploop/sdk</code></pre>
<h2 id="usage">Usage</h2>
<p class="callout"><span style="color:var(--accent)">Server-side only</span> Use this SDK from Node.js, backend jobs, or secure workers. Do not call it from browser apps that ship to end users, and never expose <code>CLIPLOOP_API_KEY</code> in frontend code.</p>
<p class="callout"><span style="color:var(--accent)">Server-side only</span> Use this SDK from Node.js, backend jobs, or secure workers. Do not call it from browser apps that ship to end users, and never expose API keys in frontend code.</p>
<p>Set your API key in your environment:</p>
<pre><code>export CLIPLOOP_API_KEY="your-dashboard-api-key"</code></pre>
<pre><code># Primary: use Talocode Cloud API key
export TALOCODE_API_KEY="your-talocode-cloud-key"
export TALOCODE_BASE_URL="https://api.talocode.site"

# Legacy (deprecated — use TALOCODE_API_KEY instead)
# export CLIPLOOP_API_KEY="your-dashboard-api-key"</code></pre>
<p>Then call the client:</p>
<pre><code>import { ClipLoopClient } from "@cliploop/sdk";

const client = new ClipLoopClient({
apiKey: process.env.CLIPLOOP_API_KEY
apiKey: process.env.TALOCODE_API_KEY
});

const result = await client.generateWeeklyPromo({
Expand Down
15 changes: 11 additions & 4 deletions docs-site/examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ <h1>Examples</h1>

<h2 id="curl">cURL</h2>
<div class="code-block"><code>curl -X POST https://app.cliploop.site/api/public/weekly-promo \
-H "Authorization: Bearer $CLIPLOOP_API_KEY" \
-H "Authorization: Bearer $TALOCODE_API_KEY" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
-d '{
Expand All @@ -20,7 +20,7 @@ <h2 id="javascript">JavaScript (fetch)</h2>
<div class="code-block"><code>const response = await fetch("https://app.cliploop.site/api/public/weekly-promo", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CLIPLOOP_API_KEY}`,
Authorization: `Bearer ${process.env.TALOCODE_API_KEY}`,
"Idempotency-Key": `promo-${Date.now()}`,
"Content-Type": "application/json"
},
Expand All @@ -41,7 +41,7 @@ <h2 id="node">Node.js</h2>
<div class="code-block"><code>const response = await fetch("https://app.cliploop.site/api/public/weekly-promo", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CLIPLOOP_API_KEY}`,
Authorization: `Bearer ${process.env.TALOCODE_API_KEY}`,
"Idempotency-Key": `promo-${Date.now()}`,
"Content-Type": "application/json"
},
Expand All @@ -59,6 +59,13 @@ <h2 id="node">Node.js</h2>
if (!response.ok) throw new Error(data.error?.message || `HTTP ${response.status}`);</code></div>

<h2 id="environment-variables">Environment variables</h2>
<div class="code-block"><code>CLIPLOOP_API_KEY=clp_li...
<div class="code-block"><code># Primary
TALOCODE_API_KEY=tk_...
TALOCODE_BASE_URL=https://api.talocode.site

# Legacy (deprecated)
# CLIPLOOP_API_KEY=clp_...

IDEMPOTENCY_KEY=promo-2026-05-30-cliploop</code></div>
<div class="callout">⚠️ Never commit real API keys to source control. Store them in environment variables or a secrets manager.</div>
<div class="callout">⚠️ <code>CLIPLOOP_API_KEY</code> is deprecated. Use <code>TALOCODE_API_KEY</code> for all hosted ClipLoop API access.</div>
13 changes: 9 additions & 4 deletions docs-site/scripts/add-platform-pages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,18 @@ write('sdks', shell('SDKs', `<h1>SDKs</h1>
<h2 id="installation">Installation</h2>
<pre><code>npm install @cliploop/sdk</code></pre>
<h2 id="usage">Usage</h2>
<p class="callout"><span style="color:var(--accent)">Server-side only</span> Use this SDK from Node.js, backend jobs, or secure workers. Do not call it from browser apps that ship to end users, and never expose <code>CLIPLOOP_API_KEY</code> in frontend code.</p>
<p class="callout"><span style="color:var(--accent)">Server-side only</span> Use this SDK from Node.js, backend jobs, or secure workers. Do not call it from browser apps that ship to end users, and never expose API keys in frontend code.</p>
<p>Set your API key in your environment:</p>
<pre><code>export CLIPLOOP_API_KEY="your-dashboard-api-key"</code></pre>
<pre><code>export TALOCODE_API_KEY="your-talocode-cloud-key"
export TALOCODE_BASE_URL="https://api.talocode.site"

# Legacy (deprecated)
# export CLIPLOOP_API_KEY="your-dashboard-api-key"</code></pre>
<p>Then call the client:</p>
<pre><code>import { ClipLoopClient } from "@cliploop/sdk";

const client = new ClipLoopClient({
apiKey: process.env.CLIPLOOP_API_KEY
apiKey: process.env.TALOCODE_API_KEY
});

const result = await client.generateWeeklyPromo({
Expand Down Expand Up @@ -197,7 +201,8 @@ write('cli', shell('CLI', `<h1>CLI</h1>
<li><code>cliploop download</code></li>
</ul>
<h2 id="server-and-ci">Server and CI usage</h2>
<p>For automation, set <code>CLIPLOOP_API_KEY</code> in your environment instead of interactive login. This works for backend jobs, CI pipelines, and short release workflows.</p>
<p>For automation, set <code>TALOCODE_API_KEY</code> in your environment instead of interactive login. This works for backend jobs, CI pipelines, and short release workflows.</p>
<p><strong>Deprecation note:</strong> <code>CLIPLOOP_API_KEY</code> is deprecated. Use <code>TALOCODE_API_KEY</code> for all hosted ClipLoop API access.</p>
<h2 id="useful-for">Useful for</h2>
<ul>
<li>Indie builders iterating in terminals.</li>
Expand Down
Loading