Skip to content

feat: content V2 docs — malleable-first architecture, templates optional#100

Open
sidneyswift wants to merge 1 commit intomainfrom
feature/content-docs-driven-dev
Open

feat: content V2 docs — malleable-first architecture, templates optional#100
sidneyswift wants to merge 1 commit intomainfrom
feature/content-docs-driven-dev

Conversation

@sidneyswift
Copy link
Copy Markdown
Contributor

@sidneyswift sidneyswift commented Apr 3, 2026

Summary

  • OpenAPI schema: Moved PATCH edit from /video to /content, renamed ContentTemplate nameid, dropped defaultLipsync, added template field to video/image/text schemas, added GET /api/content/templates/{id} detail endpoint, made pipeline template optional, removed V1 artifacts
  • New guide page: content.mdx — malleable-first philosophy, primitives table, curl examples, architecture diagram, video modes, iteration guidance
  • Updated content-agent.mdx: Template marked as optional
  • Navigation: Added Content group to Guides tab

Test plan

  • Preview docs locally with npx mintlify@latest dev
  • Verify all content API reference pages render (generate-image, generate-video, generate-caption, transcribe-audio, edit, upscale, analyze-video, templates, template-detail, create, validate, estimate)
  • Verify new content.mdx guide page renders with primitives table and architecture diagram
  • Verify content-agent.mdx reflects optional template

Made with Cursor

Summary by CodeRabbit

  • New Features

    • Added seven new content primitive endpoints: image generation, video generation, caption, transcribe, upscale, and analyze operations
    • Added endpoint to retrieve individual template configurations
    • Extended content editing to support image and audio input URLs
    • Added template support across content creation requests for streamlined workflows
  • Documentation

    • Added comprehensive Content Creation guide covering primitives, templates, and usage patterns
    • Added Template Detail API documentation
    • Updated navigation to include new content resources

- OpenAPI: move PATCH edit from /video to /content, add image_url input
- OpenAPI: ContentTemplate schema — rename name→id, drop defaultLipsync
- OpenAPI: add GET /api/content/templates/{id} detail endpoint
- OpenAPI: add template field to video, image, text primitive schemas
- OpenAPI: make pipeline template optional (remove default)
- OpenAPI: remove V1 artifacts (era_config, pipeline_config)
- Guide: new content.mdx — primitives, templates, override priority, video modes
- Guide: update content-agent.mdx — template is optional
- Nav: add Content group to Guides tab

Made-with: Cursor
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 3, 2026

📝 Walkthrough

Walkthrough

The pull request updates API documentation and OpenAPI specifications to introduce new content primitive endpoints (/api/content/upscale, /api/content/analyze, /api/content/caption, /api/content/image, /api/content/video, /api/content/transcribe), adds a template detail endpoint (GET /api/content/templates/{id}), changes the edit endpoint from PATCH /api/content/video to PATCH /api/content, reshapes the ContentTemplate schema structure, and updates related documentation pages.

Changes

Cohort / File(s) Summary
API Documentation Pages
api-reference/content/edit.mdx, api-reference/content/template-detail.mdx
Updated edit endpoint reference from /api/content/video to /api/content; added new documentation page for template detail endpoint.
OpenAPI Specification
api-reference/openapi.json
Added 7 new content primitive endpoints (/upscale, /analyze, /caption, /image, /video, /transcribe), new PATCH /api/content edit endpoint, and GET /api/content/templates/{id} template detail endpoint. Reshaped ContentTemplate schema (renamed fields: name/defaultLipsyncid/description). Added template field to image, video, and text creation requests. Updated ContentCreateEditRequest to include image_url and require at least one input URL. Removed validation fields from ContentValidateResponse.checks.
Documentation
content-agent.mdx, content.mdx, docs.json
Updated template parameter documentation in content-agent guide. Added comprehensive "Content Creation" guide explaining content primitives, template usage modes, and workflows. Updated navigation structure to include new content documentation group.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • sweetmantech

Poem

🐰 Primitives hop and templates dance,
New endpoints shimmer in the spec's expanse,
From video edits to upscales bright,
The API blooms with renewed delight, 🌿✨
Content flows free in malleable mode!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately captures the main change: documentation updates for content API V2 with a malleable-first architecture and optional templates, which aligns with the substantial changes to openapi.json, content.mdx, and related documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/content-docs-driven-dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
api-reference/openapi.json (2)

5999-6049: ⚠️ Potential issue | 🔴 Critical

Add missing schema definitions for the /api/music/* endpoints

The operations reference schemas MusicComposeRequest, MusicComposeDetailedRequest, MusicStreamRequest, MusicCreatePlanRequest, MusicCreatePlanResponse, and MusicErrorResponse, but none are defined in components.schemas. This breaks any OpenAPI resolver or codegen tool. Add these schema definitions to components.schemas or update the $refs to point to existing definitions.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@api-reference/openapi.json` around lines 5999 - 6049, The OpenAPI spec
references missing schema definitions: MusicComposeRequest,
MusicComposeDetailedRequest, MusicStreamRequest, MusicCreatePlanRequest,
MusicCreatePlanResponse, and MusicErrorResponse; add these schemas under
components.schemas (or change the $ref targets to the correct existing schema
names) so the $ref entries in the endpoints resolve; ensure each schema matches
the expected request/response shapes (e.g., MusicComposeRequest,
MusicComposeDetailedRequest, MusicStreamRequest for request bodies and
MusicCreatePlanResponse, MusicErrorResponse for responses) and update any
example/required fields accordingly.

13660-13775: ⚠️ Potential issue | 🟠 Major

Encode the input and config requirements as JSON Schema constraints.

The schema currently has no machine-readable enforcement for its documented rules. An empty object {} would pass validation despite requiring at least one of video_url, image_url, or audio_url, and either template or operations. This weakens validation, SDK generation, and documentation.

Use anyOf to enforce at least one input, and allOf with anyOf to enforce the template/operations requirement. Also add minItems: 1 to the operations array.

🔧 Suggested fix
       "ContentCreateEditRequest": {
         "type": "object",
         "description": "Must provide at least one input (video_url, image_url, or audio_url)",
+        "anyOf": [
+          { "required": ["video_url"] },
+          { "required": ["image_url"] },
+          { "required": ["audio_url"] }
+        ],
+        "allOf": [
+          {
+            "anyOf": [
+              { "required": ["template"] },
+              { "required": ["operations"] }
+            ]
+          }
+        ],
         "properties": {
@@
           "operations": {
             "type": "array",
+            "minItems": 1,
             "description": "Array of edit operations to apply in order. Required if template is not provided.",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@api-reference/openapi.json` around lines 13660 - 13775, The
ContentCreateEditRequest schema currently allows an empty object; update the
JSON Schema for ContentCreateEditRequest to enforce the documented rules by
adding an anyOf at the root that requires at least one of the input URLs
(video_url, image_url, audio_url), add an allOf group that enforces "template OR
operations" (use anyOf inside allOf: one branch requires "template", the other
requires "operations"), and add "minItems: 1" to the operations array
definition; ensure these constraints reference the existing property names
(video_url, image_url, audio_url, template, operations) so validators and
generated SDKs will reject invalid empty payloads.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@api-reference/openapi.json`:
- Around line 12307-12310: Update the OpenAPI schema for ContentCreateResponse
so the template property is not required and its schema allows null;
specifically, remove "template" from the ContentCreateResponse's required array
and change the template schema (under the ContentCreateResponse object) to
accept type "string" or "null" (or add "nullable": true) so successful
template-free (malleable) responses can be represented. Apply the same change
for the duplicate/related response definitions referenced around the other block
(the section spanning 12369-12406) to ensure consistency.
- Around line 12505-12630: The ContentTemplateDetail.edit.operations schema
currently only exposes the operation "type" and is lossy; update
ContentTemplateDetail.edit.operations to mirror the full operation shape used by
ContentCreateEditRequest.operations by adding the additional properties (e.g.,
start, duration, aspect, content, audio_url, color, font, height, width,
position, stroke_color, replace, max_font_size) with appropriate types and
descriptions and include any relevant required fields so consumers of GET
/api/content/templates/{id} can fully reconstruct the edit pipeline; ensure the
property names exactly match those in ContentCreateEditRequest.operations to
keep schemas consistent.

---

Outside diff comments:
In `@api-reference/openapi.json`:
- Around line 5999-6049: The OpenAPI spec references missing schema definitions:
MusicComposeRequest, MusicComposeDetailedRequest, MusicStreamRequest,
MusicCreatePlanRequest, MusicCreatePlanResponse, and MusicErrorResponse; add
these schemas under components.schemas (or change the $ref targets to the
correct existing schema names) so the $ref entries in the endpoints resolve;
ensure each schema matches the expected request/response shapes (e.g.,
MusicComposeRequest, MusicComposeDetailedRequest, MusicStreamRequest for request
bodies and MusicCreatePlanResponse, MusicErrorResponse for responses) and update
any example/required fields accordingly.
- Around line 13660-13775: The ContentCreateEditRequest schema currently allows
an empty object; update the JSON Schema for ContentCreateEditRequest to enforce
the documented rules by adding an anyOf at the root that requires at least one
of the input URLs (video_url, image_url, audio_url), add an allOf group that
enforces "template OR operations" (use anyOf inside allOf: one branch requires
"template", the other requires "operations"), and add "minItems: 1" to the
operations array definition; ensure these constraints reference the existing
property names (video_url, image_url, audio_url, template, operations) so
validators and generated SDKs will reject invalid empty payloads.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 73f89d3e-16ff-4e4a-ab48-a179bf5710b3

📥 Commits

Reviewing files that changed from the base of the PR and between c20e95f and 145e341.

📒 Files selected for processing (6)
  • api-reference/content/edit.mdx
  • api-reference/content/template-detail.mdx
  • api-reference/openapi.json
  • content-agent.mdx
  • content.mdx
  • docs.json

Comment on lines 12307 to +12310
"template": {
"type": "string",
"description": "The template to use for content generation. Defines the visual style, scene, and prompt configuration. If omitted, defaults to `artist-caption-bedroom`. See [GET /api/content/templates](/api-reference/content/templates) for available options.",
"example": "artist-caption-stage",
"default": "artist-caption-bedroom"
"description": "Optional template ID for content generation. Defines the visual style, scene, and prompt configuration. When omitted, the pipeline runs in malleable mode using only the params you provide. See GET /api/content/templates for available options.",
"example": "artist-caption-stage"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
python - <<'PY'
import json
from pathlib import Path

data = json.loads(Path("api-reference/openapi.json").read_text())
req = data["components"]["schemas"]["ContentCreateRequest"]
resp = data["components"]["schemas"]["ContentCreateResponse"]

print("ContentCreateRequest.required:", req.get("required", []))
print("ContentCreateResponse.required:", resp.get("required", []))
print("ContentCreateResponse.template:", resp["properties"]["template"])
PY

Repository: recoupable/docs

Length of output: 327


Fix the create-response contract to support template-free requests.

The request documentation correctly shows template as optional and allows malleable mode operation without a template. However, ContentCreateResponse still requires a non-null template field, making it impossible to represent successful template-less calls with the published schema.

Remove template from the response's required fields and allow null values:

🔧 Suggested fix
       "ContentCreateResponse": {
         "type": "object",
         "required": [
           "runIds",
           "status",
-          "artist_account_id",
-          "template"
+          "artist_account_id"
         ],
@@
           "template": {
-            "type": "string",
-            "description": "The template being used",
-            "example": "artist-caption-bedroom"
+            "type": [
+              "string",
+              "null"
+            ],
+            "description": "Template ID when a preset pipeline is used; null in malleable mode.",
+            "example": null
           },

Also applies to: 12369-12406

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@api-reference/openapi.json` around lines 12307 - 12310, Update the OpenAPI
schema for ContentCreateResponse so the template property is not required and
its schema allows null; specifically, remove "template" from the
ContentCreateResponse's required array and change the template schema (under the
ContentCreateResponse object) to accept type "string" or "null" (or add
"nullable": true) so successful template-free (malleable) responses can be
represented. Apply the same change for the duplicate/related response
definitions referenced around the other block (the section spanning 12369-12406)
to ensure consistency.

Comment on lines +12505 to 12630
"ContentTemplateDetail": {
"type": "object",
"required": [
"id",
"description"
],
"description": "Full configuration for a content creation template including image prompts, video motion config, caption style rules, and edit operations.",
"properties": {
"id": {
"type": "string",
"description": "Template identifier",
"example": "artist-caption-bedroom"
},
"defaultLipsync": {
"type": "boolean",
"description": "Whether this template defaults to lip-sync mode when the `lipsync` flag is not explicitly set",
"example": false
"description": {
"type": "string",
"description": "Human-readable description of the template",
"example": "Moody bedroom selfie. Artist on camera with deadpan expression, purple LED lighting, dark room."
},
"image": {
"type": "object",
"description": "Image generation configuration",
"properties": {
"prompt": {
"type": "string",
"description": "Default image prompt used when no caller prompt is provided"
},
"reference_images": {
"type": "array",
"items": {
"type": "string",
"format": "uri"
},
"description": "Reference image URLs for style conditioning"
},
"style_rules": {
"type": "object",
"description": "Style constraints (lighting, colors, composition)"
}
}
},
"video": {
"type": "object",
"description": "Video generation configuration",
"properties": {
"moods": {
"type": "array",
"items": {
"type": "string"
},
"description": "Mood descriptors for motion prompt generation"
},
"movements": {
"type": "array",
"items": {
"type": "string"
},
"description": "Camera/subject movement descriptors"
}
}
},
"caption": {
"type": "object",
"description": "Caption generation configuration",
"properties": {
"guide": {
"type": "object",
"description": "Caption style guide",
"properties": {
"tone": {
"type": "string",
"description": "Voice and tone direction"
},
"rules": {
"type": "array",
"items": {
"type": "string"
},
"description": "Style rules for caption generation"
},
"formats": {
"type": "array",
"items": {
"type": "string"
},
"description": "Allowed caption formats"
}
}
},
"examples": {
"type": "array",
"items": {
"type": "string"
},
"description": "Example captions for few-shot prompting"
}
}
},
"edit": {
"type": "object",
"description": "Post-processing edit operations",
"properties": {
"operations": {
"type": "array",
"description": "Default edit operations applied during post-processing",
"items": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"trim",
"crop",
"resize",
"overlay_text",
"mux_audio"
],
"description": "Operation type"
}
}
}
}
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
python - <<'PY'
import json
from pathlib import Path

data = json.loads(Path("api-reference/openapi.json").read_text())
detail_props = data["components"]["schemas"]["ContentTemplateDetail"]["properties"]["edit"]["properties"]["operations"]["items"]["properties"]
edit_props = data["components"]["schemas"]["ContentCreateEditRequest"]["properties"]["operations"]["items"]["properties"]

print("ContentTemplateDetail.edit.operations fields:", sorted(detail_props.keys()))
print("ContentCreateEditRequest.operations fields:", sorted(edit_props.keys()))
PY

Repository: recoupable/docs

Length of output: 313


🏁 Script executed:

#!/bin/bash
# Check what schemas are at lines 13683-13763
sed -n '13683,13763p' api-reference/openapi.json | head -50

Repository: recoupable/docs

Length of output: 1802


ContentTemplateDetail.edit.operations is too lossy for a detail endpoint.

The schema only exposes type, while ContentCreateEditRequest.operations supports the full operation parameters (start, duration, aspect, content, audio_url, color, font, height, width, position, stroke_color, replace, max_font_size). Consumers calling GET /api/content/templates/{id} cannot reconstruct the advertised edit pipeline with just the operation type. Include all supported operation properties in the detail schema.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@api-reference/openapi.json` around lines 12505 - 12630, The
ContentTemplateDetail.edit.operations schema currently only exposes the
operation "type" and is lossy; update ContentTemplateDetail.edit.operations to
mirror the full operation shape used by ContentCreateEditRequest.operations by
adding the additional properties (e.g., start, duration, aspect, content,
audio_url, color, font, height, width, position, stroke_color, replace,
max_font_size) with appropriate types and descriptions and include any relevant
required fields so consumers of GET /api/content/templates/{id} can fully
reconstruct the edit pipeline; ensure the property names exactly match those in
ContentCreateEditRequest.operations to keep schemas consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant