Skip to content

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

Merged
sweetmantech merged 5 commits intomainfrom
feature/content-docs-driven-dev
Apr 9, 2026
Merged

feat: content V2 docs — malleable-first architecture, templates optional#100
sweetmantech merged 5 commits 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 new content primitives (image, video, caption, transcribe, upscale, analyze) plus POST create and a PATCH /api/content edit endpoint; edit now accepts image/audio inputs and requires at least one media URL.
    • Added GET /api/content/templates/{id} and template support across content creation requests to enable template-driven and malleable workflows.
  • Documentation

    • New "Content Creation" guide and Template Detail page; docs navigation updated 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

Warning

Rate limit exceeded

@sweetmantech has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 10 minutes and 21 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 10 minutes and 21 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 00bb5343-97f9-4dbf-970e-f30e0d86aa15

📥 Commits

Reviewing files that changed from the base of the PR and between d35aabf and 849d1df.

📒 Files selected for processing (2)
  • api-reference/openapi.json
  • content-agent.mdx
📝 Walkthrough

Walkthrough

Updated API reference and docs: added multiple content primitive endpoints and a template-detail endpoint, changed edit endpoint from PATCH /api/content/video to PATCH /api/content, reworked content template schemas, and updated related MDX pages and docs navigation.

Changes

Cohort / File(s) Summary
OpenAPI spec (core changes)
api-reference/openapi.json
Large spec update: added content primitive endpoints (POST /api/content/upscale, /analyze, /caption, /image, /video, /transcribe), added PATCH /api/content, added GET /api/content/templates/{id}, removed callbackSecret security scheme, adjusted operation security arrays, changed GET /api/accounts/{id} id format to uuid, removed ChatStreamRequest.accountId, and normalized many response/description strings.
Content schema updates
api-reference/openapi.json (schemas)
Reworked content template and create/edit schemas: ContentTemplate required fields changed (now id, description), added ContentTemplateDetail schema, made template optional/malleable in create requests, added template property to content-create variants, updated ContentCreateEditRequest (added image_url, requires at least one media URL), and removed some validation-check fields from ContentValidateResponse.
API docs: edit & new template detail
api-reference/content/edit.mdx, api-reference/content/template-detail.mdx
edit.mdx updated to reference PATCH /api/content (was /api/content/video); new template-detail.mdx added documenting GET /api/content/templates/{id}.
Guides & narrative docs
content-agent.mdx, content.mdx
content-agent.mdx adjusted template parameter wording to mark it optional and reference available templates; added new content.mdx "Content Creation" guide describing primitives, template behaviour (malleable vs shortcut), modes, and iterative workflows.
Docs navigation
docs.json
Inserted api-reference/content/template-detail into the Content Creation/docs navigation ordering.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰
I hopped through specs with cheerful pace,
New endpoints nested in their place,
Templates whisper defaults, then bend,
Edits, transcribe, upscale — all blend,
A little rabbit cheers the doc race!

🚥 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 title accurately reflects the main change: documentation for Content V2 API with malleable-first architecture and optional templates, which aligns with the new content.mdx guide, schema updates making templates optional, and the architectural shift described across files.
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

sweetmantech and others added 2 commits April 9, 2026 07:01
Resolve conflicts in docs.json and openapi.json by keeping both sides:
- PR: Music endpoints, Content navigation, template-detail page
- Main: Research endpoints/tab, reorganized navigation into 6 tabs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add cross-reference links to GET /api/content/templates in all template
parameter descriptions so devs and AI can easily discover available options.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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: 1

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)

14845-14959: ⚠️ Potential issue | 🟠 Major

Add structural constraints to enforce required inputs and conditional requirements.

The schema currently lacks required, anyOf, oneOf, or allOf constraints, so generated validators and SDKs will accept invalid bodies without at least one input URL or without properly handling the template/operations relationship. Implement the OpenAPI 3.1 constraint pattern shown below:

OpenAPI 3.1 constraint example
       "ContentCreateEditRequest": {
         "type": "object",
         "description": "Must provide at least one input (video_url, image_url, or audio_url)",
+        "allOf": [
+          {
+            "anyOf": [
+              { "required": ["video_url"] },
+              { "required": ["image_url"] },
+              { "required": ["audio_url"] }
+            ]
+          },
+          {
+            "anyOf": [
+              { "required": ["template"] },
+              { "required": ["operations"] }
+            ]
+          }
+        ],
         "properties": {

If the backend requires exactly one of template or operations (not both), change the second anyOf to oneOf.

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

In `@api-reference/openapi.json` around lines 14845 - 14959, The schema for the
edit request object (properties video_url, image_url, audio_url, template,
operations, output_format) lacks structural constraints; add JSON Schema/OpenAPI
keywords to enforce: (1) at least one input URL present by adding an anyOf that
requires video_url or image_url or audio_url, and (2) a conditional that
requires either template or operations by adding an oneOf (or anyOf if both
allowed) with two alternatives: one requiring template and the other requiring
operations (and ensure operations retains its required:type inside items).
Update the object-level schema to include these anyOf/oneOf constraints so
generated validators/SDKs reject bodies missing an input URL or
missing/incorrect template↔operations usage.

5579-5583: ⚠️ Potential issue | 🔴 Critical

Remove callbackSecret from the security array at line 5581 or define it in components.securitySchemes.

The /api/content-agent/callback endpoint declares callbackSecret in its security requirements, but this scheme is not defined in the OpenAPI document's components.securitySchemes. The document currently only defines apiKeyAuth and bearerAuth. This inconsistency violates the OpenAPI specification and will break OpenAPI validators, code generators, and documentation renderers. Either add callbackSecret to components.securitySchemes or remove it from this endpoint's security array.

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

In `@api-reference/openapi.json` around lines 5579 - 5583, The security
requirement for the /api/content-agent/callback path references an undefined
scheme "callbackSecret"; fix this by either removing "callbackSecret" from the
security array for that endpoint or by adding a corresponding entry named
"callbackSecret" under components.securitySchemes with the proper type (e.g.,
apiKey or http bearer) and configuration; update the security array on the
/api/content-agent/callback path or add the "callbackSecret" scheme in
components.securitySchemes to restore consistency.
♻️ Duplicate comments (2)
api-reference/openapi.json (2)

13491-13495: ⚠️ Potential issue | 🟠 Major

Make ContentCreateResponse.template nullable and optional.

The request contract now documents template as optional for malleable-mode runs, but the response still requires a non-null template. As published, a successful template-free call cannot be represented.

🔧 Suggested schema 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: 13555-13560, 13586-13590

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

In `@api-reference/openapi.json` around lines 13491 - 13495, The response schema
currently requires a non-null "template" but requests can omit it in
malleable-mode; update the OpenAPI schemas so ContentCreateResponse.template is
optional and nullable (i.e., allow null and remove "required" constraint), and
apply the same change to any other response schemas referencing "template"
(e.g., ContentCreateResponse variants found near the other occurrences). Locate
the ContentCreateResponse object(s) and change the "template" property to
include "nullable": true (or make it type ["string","null"]) and ensure it is
not listed under "required" so a successful template-free response can be
represented.

13790-13812: ⚠️ Potential issue | 🟠 Major

Expose the full edit operation shape in ContentTemplateDetail.

GET /api/content/templates/{id} currently returns edit operations with only type, while ContentCreateEditRequest.operations supports the rest of the operation payload. Clients cannot reconstruct or inspect the advertised template edit pipeline from the detail endpoint as-is.

Also applies to: 14867-14945

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

In `@api-reference/openapi.json` around lines 13790 - 13812, The
ContentTemplateDetail response currently exposes only the operation "type" for
the "operations" array; update the OpenAPI schema so
ContentTemplateDetail.operations uses the full edit operation shape (matching
ContentCreateEditRequest.operations) — either by referencing the same component
schema or by expanding the "items" properties to include all fields (e.g.,
trim/crop/resize/overlay_text/mux_audio specific params) so the GET
/api/content/templates/{id} detail endpoint accurately reflects the complete
operation payload; apply the same change where the duplicate occurs.
🤖 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 4044-4108: The API currently exposes two equivalent edit
endpoints—PATCH /api/content and PATCH /api/content/video—creating duplicate
canonical routes; remove the legacy PATCH /api/content/video path from the
OpenAPI spec (or mark it deprecated and add a clear deprecation notice and a
reference pointing to PATCH /api/content) by deleting the /api/content/video
path object (or adding "deprecated": true plus a description directing callers
to "/api/content") and ensure any schemas (e.g., ContentCreateEditRequest,
ContentCreateEditResponse, ContentErrorResponse) referenced by
/api/content/video are either preserved elsewhere or updated to avoid dangling
refs; update any duplicate security/response blocks under the removed path
accordingly.

---

Outside diff comments:
In `@api-reference/openapi.json`:
- Around line 14845-14959: The schema for the edit request object (properties
video_url, image_url, audio_url, template, operations, output_format) lacks
structural constraints; add JSON Schema/OpenAPI keywords to enforce: (1) at
least one input URL present by adding an anyOf that requires video_url or
image_url or audio_url, and (2) a conditional that requires either template or
operations by adding an oneOf (or anyOf if both allowed) with two alternatives:
one requiring template and the other requiring operations (and ensure operations
retains its required:type inside items). Update the object-level schema to
include these anyOf/oneOf constraints so generated validators/SDKs reject bodies
missing an input URL or missing/incorrect template↔operations usage.
- Around line 5579-5583: The security requirement for the
/api/content-agent/callback path references an undefined scheme
"callbackSecret"; fix this by either removing "callbackSecret" from the security
array for that endpoint or by adding a corresponding entry named
"callbackSecret" under components.securitySchemes with the proper type (e.g.,
apiKey or http bearer) and configuration; update the security array on the
/api/content-agent/callback path or add the "callbackSecret" scheme in
components.securitySchemes to restore consistency.

---

Duplicate comments:
In `@api-reference/openapi.json`:
- Around line 13491-13495: The response schema currently requires a non-null
"template" but requests can omit it in malleable-mode; update the OpenAPI
schemas so ContentCreateResponse.template is optional and nullable (i.e., allow
null and remove "required" constraint), and apply the same change to any other
response schemas referencing "template" (e.g., ContentCreateResponse variants
found near the other occurrences). Locate the ContentCreateResponse object(s)
and change the "template" property to include "nullable": true (or make it type
["string","null"]) and ensure it is not listed under "required" so a successful
template-free response can be represented.
- Around line 13790-13812: The ContentTemplateDetail response currently exposes
only the operation "type" for the "operations" array; update the OpenAPI schema
so ContentTemplateDetail.operations uses the full edit operation shape (matching
ContentCreateEditRequest.operations) — either by referencing the same component
schema or by expanding the "items" properties to include all fields (e.g.,
trim/crop/resize/overlay_text/mux_audio specific params) so the GET
/api/content/templates/{id} detail endpoint accurately reflects the complete
operation payload; apply the same change where the duplicate occurs.
🪄 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: 8134d4f4-cabc-4ba3-b975-c7c9adf1704c

📥 Commits

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

📒 Files selected for processing (2)
  • api-reference/openapi.json
  • docs.json
✅ Files skipped from review due to trivial changes (1)
  • docs.json

@sweetmantech
Copy link
Copy Markdown
Collaborator

Template Link Verification

Tested all pages with template parameters on localhost:3000 — each now includes a clickable GET /api/content/templates link in the parameter description.

Page Template Link Status
/api-reference/content/generate-image GET /api/content/templates
/api-reference/content/generate-video GET /api/content/templates
/api-reference/content/generate-caption GET /api/content/templates
/api-reference/content/edit GET /api/content/templates
/api-reference/content/templates Page loads correctly
/api-reference/content/template-detail Page loads correctly

Merge conflict with main also resolved — kept both Music endpoints (PR) and Research endpoints (main) in openapi.json, and adopted main's reorganized 6-tab navigation in docs.json.

🤖 Generated with Claude Code

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.

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)

5579-5583: ⚠️ Potential issue | 🔴 Critical

Broken security reference: callbackSecret is undefined.

Line 5581 uses callbackSecret, but there is no matching scheme in components.securitySchemes, so the OpenAPI document has an unresolved security reference.

🔧 Suggested fix (add the missing scheme)
"securitySchemes": {
  "bearerAuth": {
    "type": "http",
    "scheme": "bearer"
  },
  "apiKeyAuth": {
    "type": "apiKey",
    "in": "header",
    "name": "x-api-key",
    "description": "Your Recoup API key. [Learn more](/quickstart#api-keys)."
+ },
+ "callbackSecret": {
+   "type": "apiKey",
+   "in": "header",
+   "name": "x-callback-secret",
+   "description": "Internal callback authentication secret."
  }
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@api-reference/openapi.json` around lines 5579 - 5583, The OpenAPI operation
uses a security requirement named "callbackSecret" but no corresponding scheme
exists in components.securitySchemes; add a new security scheme entry named
"callbackSecret" under components.securitySchemes (e.g., an apiKey, http bearer,
or other appropriate type) that matches how the operation expects to be
authenticated, then reference that scheme name exactly ("callbackSecret") so the
"security": [{"callbackSecret": []}] entry resolves correctly.

14846-14959: ⚠️ Potential issue | 🟠 Major

ContentCreateEditRequest documents conditional requirements but does not enforce them.

Line 14846 says at least one of video_url | image_url | audio_url is required, and Line 14969 says operations is required if template is absent. The schema currently permits {}.

🔧 Suggested validation constraints
"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"] }
+ ],
+ "oneOf": [
+   { "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.",
      "items": { ... }
    }
  }
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@api-reference/openapi.json` around lines 14846 - 14959, The
ContentCreateEditRequest schema allows an empty object but must require at least
one input and enforce operations when template is absent; update the schema for
ContentCreateEditRequest to add validation: include an "anyOf" requiring one of
the inputs (video_url, image_url, audio_url) e.g.
"anyOf":[{"required":["video_url"]},{"required":["image_url"]},{"required":["audio_url"]}]
and add a mutual exclusivity/requirement for template vs operations by adding
"oneOf":[{"required":["template"]},{"required":["operations"]}] (or "anyOf" if
multiple combos needed) so that either "template" is present or "operations" is
present; reference the properties video_url, image_url, audio_url, template, and
operations when applying these constraints.
♻️ Duplicate comments (3)
api-reference/openapi.json (3)

13790-13811: ⚠️ Potential issue | 🟠 Major

ContentTemplateDetail.edit.operations is still lossy.

Line 13790 only exposes type; callers cannot reconstruct the template’s edit pipeline details from the detail endpoint.

Use the same full operation shape as ContentCreateEditRequest.operations.items (e.g., start, duration, aspect, content, audio_url, color, font, height, width, position, stroke_color, replace, max_font_size) to keep contracts consistent.

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

In `@api-reference/openapi.json` around lines 13790 - 13811,
ContentTemplateDetail.edit.operations currently exposes only the "type" field,
which is lossy; update the OpenAPI schema for
ContentTemplateDetail.edit.operations.items to use the same full operation
object schema as ContentCreateEditRequest.operations.items so callers can
reconstruct the edit pipeline. Replace the minimal properties block (only
"type") with the full properties used by
ContentCreateEditRequest.operations.items (including fields like start,
duration, aspect, content, audio_url, color, font, height, width, position,
stroke_color, replace, max_font_size and any other operation-specific fields)
and retain the required "type" enum; ensure the description and enum values stay
unchanged so the contract is consistent.

13555-13560: ⚠️ Potential issue | 🟠 Major

ContentCreateResponse.template still contradicts template-optional mode.

Line 13559 requires template, and Line 13587 allows only non-null string, so successful malleable/template-free runs cannot be represented.

🔧 Suggested schema fix
"ContentCreateResponse": {
  "type": "object",
  "required": [
    "runIds",
    "status",
-   "artist_account_id",
-   "template"
+   "artist_account_id"
  ],
  "properties": {
    ...
    "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: 13586-13590

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

In `@api-reference/openapi.json` around lines 13555 - 13560, The schema currently
forces ContentCreateResponse.template to be required and a non-null string,
which breaks template-optional runs; remove "template" from the required array
(alongside runIds/status/artist_account_id) and change the
ContentCreateResponse.properties.template definition to allow absence/null
(e.g., make it nullable or type ["string","null"] or simply omit "required" for
template) so successful malleable/template-free responses can be represented;
apply the same change to the duplicate schema instance referenced around the
other occurrence of ContentCreateResponse.template.

4044-4108: ⚠️ Potential issue | 🟠 Major

Deprecate or remove the legacy PATCH /api/content/video route.

Line 5915 still publishes PATCH /api/content/video alongside the new canonical PATCH /api/content (Line 4044), which creates two first-class edit routes.

🔧 Suggested fix (deprecate legacy route if it must remain temporarily)
"/api/content/video": {
  "patch": {
+   "deprecated": true,
-   "description": "Apply edits to a video or audio file — trim, crop, resize, overlay text, or add an audio track. Pass a `template` for a preset edit pipeline, or build your own with an `operations` array. Everything runs in one pass.",
+   "description": "Deprecated. Use PATCH /api/content. Apply edits to content — trim, crop, resize, overlay text, or add an audio track.",
    ...
  }
}

Also applies to: 5915-5978

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

In `@api-reference/openapi.json` around lines 4044 - 4108, There are two
first-class edit endpoints (PATCH /api/content and the legacy PATCH
/api/content/video); remove or mark the legacy route as deprecated by deleting
the /api/content/video operation or adding a deprecation notice and linking it
to the canonical /api/content in the OpenAPI spec — update the operationId/path
entry for PATCH /api/content/video (or remove it entirely), and if keeping it
temporarily set "deprecated": true plus a description pointing to the canonical
PATCH /api/content and re-use the same request/response schemas
(ContentCreateEditRequest, ContentCreateEditResponse, ContentErrorResponse) to
avoid divergence.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@api-reference/openapi.json`:
- Around line 5579-5583: The OpenAPI operation uses a security requirement named
"callbackSecret" but no corresponding scheme exists in
components.securitySchemes; add a new security scheme entry named
"callbackSecret" under components.securitySchemes (e.g., an apiKey, http bearer,
or other appropriate type) that matches how the operation expects to be
authenticated, then reference that scheme name exactly ("callbackSecret") so the
"security": [{"callbackSecret": []}] entry resolves correctly.
- Around line 14846-14959: The ContentCreateEditRequest schema allows an empty
object but must require at least one input and enforce operations when template
is absent; update the schema for ContentCreateEditRequest to add validation:
include an "anyOf" requiring one of the inputs (video_url, image_url, audio_url)
e.g.
"anyOf":[{"required":["video_url"]},{"required":["image_url"]},{"required":["audio_url"]}]
and add a mutual exclusivity/requirement for template vs operations by adding
"oneOf":[{"required":["template"]},{"required":["operations"]}] (or "anyOf" if
multiple combos needed) so that either "template" is present or "operations" is
present; reference the properties video_url, image_url, audio_url, template, and
operations when applying these constraints.

---

Duplicate comments:
In `@api-reference/openapi.json`:
- Around line 13790-13811: ContentTemplateDetail.edit.operations currently
exposes only the "type" field, which is lossy; update the OpenAPI schema for
ContentTemplateDetail.edit.operations.items to use the same full operation
object schema as ContentCreateEditRequest.operations.items so callers can
reconstruct the edit pipeline. Replace the minimal properties block (only
"type") with the full properties used by
ContentCreateEditRequest.operations.items (including fields like start,
duration, aspect, content, audio_url, color, font, height, width, position,
stroke_color, replace, max_font_size and any other operation-specific fields)
and retain the required "type" enum; ensure the description and enum values stay
unchanged so the contract is consistent.
- Around line 13555-13560: The schema currently forces
ContentCreateResponse.template to be required and a non-null string, which
breaks template-optional runs; remove "template" from the required array
(alongside runIds/status/artist_account_id) and change the
ContentCreateResponse.properties.template definition to allow absence/null
(e.g., make it nullable or type ["string","null"] or simply omit "required" for
template) so successful malleable/template-free responses can be represented;
apply the same change to the duplicate schema instance referenced around the
other occurrence of ContentCreateResponse.template.
- Around line 4044-4108: There are two first-class edit endpoints (PATCH
/api/content and the legacy PATCH /api/content/video); remove or mark the legacy
route as deprecated by deleting the /api/content/video operation or adding a
deprecation notice and linking it to the canonical /api/content in the OpenAPI
spec — update the operationId/path entry for PATCH /api/content/video (or remove
it entirely), and if keeping it temporarily set "deprecated": true plus a
description pointing to the canonical PATCH /api/content and re-use the same
request/response schemas (ContentCreateEditRequest, ContentCreateEditResponse,
ContentErrorResponse) to avoid divergence.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dd3d8f09-e75e-4f9f-9b04-ff0d93ea3245

📥 Commits

Reviewing files that changed from the base of the PR and between 32c3c01 and d35aabf.

📒 Files selected for processing (1)
  • api-reference/openapi.json

Consolidated the orphaned content.mdx (primitives, templates, video modes,
iteration guide) into content-agent.mdx and renamed the page title to
"Content". Deleted content.mdx since it wasn't in the navigation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1. ContentCreateResponse: remove template from required, allow null
2. ContentTemplateDetail: add full operation properties to edit schema
3. Remove duplicate PATCH /api/content/video (keep PATCH /api/content)
4. Add missing Music schemas (MusicComposeRequest, MusicComposeDetailedRequest,
   MusicStreamRequest, MusicCreatePlanRequest, MusicCreatePlanResponse,
   MusicErrorResponse)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sweetmantech sweetmantech merged commit e1c40d8 into main Apr 9, 2026
3 checks passed
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.

2 participants