Skip to content

feat:Update openapi.yaml: headers, multipart, new schemas, xi-api-key auth#167

Merged
HavenDV merged 1 commit intomainfrom
bot/update-openapi_202508201521
Aug 20, 2025
Merged

feat:Update openapi.yaml: headers, multipart, new schemas, xi-api-key auth#167
HavenDV merged 1 commit intomainfrom
bot/update-openapi_202508201521

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Aug 20, 2025

Summary by CodeRabbit

  • New Features

    • Multipart audio responses with unique song IDs for music endpoints.
    • Richer music and podcast generation models with detailed prompts and metadata.
    • RAG index management to track document indices, status, and usage.
    • Advanced webhook configurations with flexible schemas and HMAC/OAuth2 auth.
    • API key authentication support.
  • Documentation

    • Clearer response descriptions and headers, including multipart media examples.
    • Expanded docs for voice metadata, safety/verification, and moderation.
    • Detailed speech history and transcription models with timestamps and alignment.

@coderabbitai
Copy link

coderabbitai bot commented Aug 20, 2025

Walkthrough

The openapi.yaml updates add response headers, multipart response definitions, new and expanded schemas (music, podcast, voice, safety, speech history, RAG, webhook, subscription), security schemes, and tag descriptions. Some endpoints gained clarified responses; some were removed/commented. Overall, the API surface grows with detailed metadata and authentication via xi-api-key.

Changes

Cohort / File(s) Summary
Media response headers and multipart
src/libs/ElevenLabs/openapi.yaml
Added explicit response headers (e.g., song-id) to media endpoints; defined multipart/mixed responses combining binary audio and metadata; clarified response descriptions and examples (incl. base64 snippets).
Structured music and podcast models
src/libs/ElevenLabs/openapi.yaml
Introduced DetailedMusicResponse, MusicPrompt (styles, sections, examples) and Podcast* schemas for richer generation metadata and project structure.
Voice models and safety/compliance
src/libs/ElevenLabs/openapi.yaml
Expanded VoiceResponseModel with verified_languages, labels, moderation_check, safety checks, verification statuses, and related enums/properties.
Speech history and transcription
src/libs/ElevenLabs/openapi.yaml
Added SpeechHistory* models, chunk/word timing, alignment data, and detailed transcription schemas with timestamps.
RAG index management
src/libs/ElevenLabs/openapi.yaml
Added RAGDocumentIndexResponseModel, RAGIndexStatus, RAGIndexOverviewResponseModel, usage/status/progress fields, and config params like max_vector_distance.
Webhook integration schemas
src/libs/ElevenLabs/openapi.yaml
Added WebhookToolApiSchemaConfig-Input/Output with URL, headers, params, auth (HMAC/OAuth2) and examples for external integrations.
Security and tags/docs
src/libs/ElevenLabs/openapi.yaml
Introduced securitySchemes (ApiKeyAuth via xi-api-key). Extended tag descriptions. Deprecated/removed/commented endpoints (e.g., /docs).
Projects, snapshots, media references
src/libs/ElevenLabs/openapi.yaml
New models for media references, project/snapshot responses, metadata and data management fields.
Descriptions, enums, examples
src/libs/ElevenLabs/openapi.yaml
Numerous property additions, clarifications, examples, and enums across schemas; standardized headers in responses.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Client
  participant API as API: /v1/music(detailed)
  participant Generator as Audio/Metadata Generator

  Client->>API: POST music request (prompt, styles, sections)
  API->>Generator: Generate audio + metadata
  Generator-->>API: audio bytes + metadata (JSON)
  Note over API: Prepare multipart/mixed response<br/>Add response header: song-id
  API-->>Client: 206/200 multipart/mixed<br/>Header: song-id<br/>Part1: audio/*<br/>Part2: application/json (metadata)
Loading
sequenceDiagram
  autonumber
  actor Client
  participant API as API: RAG Index
  participant Store as Vector Store

  Client->>API: POST /rag/indexes (config)
  API->>Store: Initialize index (params: max_vector_distance,...)
  API-->>Client: 202 Accepted (index_id, status=creating)
  loop Poll status
    Client->>API: GET /rag/indexes/{id}/status
    API-->>Client: status (creating|ready|error), progress
  end
  Client->>API: GET /rag/indexes/{id}
  API-->>Client: RAGIndexOverviewResponseModel (usage, status, details)
Loading
sequenceDiagram
  autonumber
  actor Client
  participant API as API: Webhook Tool
  participant Ext as External Service

  Client->>API: Configure webhook schema (URL, headers, auth=HMAC/OAuth2)
  API-->>Client: 200 OK (saved config)
  API->>Ext: Invoke webhook (method, params, signed/authenticated)
  Ext-->>API: Response (status, body, headers)
  API-->>Client: WebhookToolApiSchemaConfig-Output (request+response details)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

Hop hop, new schemas in the sun,
Multipart songs, a header—song-id—won.
Voices verified, with safety in tow,
RAG maps knowledge where vectors go.
Webhooks hum with OAuth charms,
I thump approval with fuzzy arms.
Ship it—carrots raised, let’s run! 🥕

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bot/update-openapi_202508201521

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@HavenDV HavenDV merged commit 9c4ea6e into main Aug 20, 2025
2 of 4 checks passed
@HavenDV HavenDV deleted the bot/update-openapi_202508201521 branch August 20, 2025 15:22
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Update openapi.yaml: headers, multipart, new schemas, xi-api-key auth Aug 20, 2025
Copy link

@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: 4

🧹 Nitpick comments (3)
src/libs/ElevenLabs/openapi.yaml (3)

8938-8942: Header addition looks good; consider marking it as required.

If the song-id header is always present on 200 responses, declare it as required to tighten the contract.

Apply this diff:

           headers:
             song-id:
               description: Unique identifier for the generated song
+              required: true
               schema:
                 type: string

9079-9083: Header on streaming response: good; optionally mark as required.

Same suggestion as the other endpoints: if song-id is always returned, mark it required for consistency.

           headers:
             song-id:
               description: Unique identifier for the generated song
+              required: true
               schema:
                 type: string

22372-22419: Required + nullable on SongMetadata fields: pick one intent.

title and description are marked as required but also nullable: true. That means the keys must exist but can be null. If nulls aren’t meaningful, drop nullable; otherwise, remove them from required.

Two options:

  • Make them non-nullable (preferred)
         title:
           title: Title
           type: string
           description: The title of the song
-          nullable: true
         description:
           title: Description
           type: string
           description: The description of the song
-          nullable: true
  • Or remove from required:
       required:
-        - title
-        - description
         - genres
         - languages
         - is_explicit
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 95db7c5 and 53661c8.

⛔ Files ignored due to path filters (14)
  • src/libs/ElevenLabs/Generated/ElevenLabs.ElevenLabsClient.GetDocs.g.cs is excluded by !**/generated/**
  • src/libs/ElevenLabs/Generated/ElevenLabs.IElevenLabsClient.GetDocs.g.cs is excluded by !**/generated/**
  • src/libs/ElevenLabs/Generated/ElevenLabs.IMusicGenerationClient.CreateMusicDetailed.g.cs is excluded by !**/generated/**
  • src/libs/ElevenLabs/Generated/ElevenLabs.JsonSerializerContextTypes.g.cs is excluded by !**/generated/**
  • src/libs/ElevenLabs/Generated/ElevenLabs.Models.ComposeMusicWithADetailedResponseV1MusicDetailedPostResponse.g.cs is excluded by !**/generated/**
  • src/libs/ElevenLabs/Generated/ElevenLabs.Models.DetailedMusicResponse.Json.g.cs is excluded by !**/generated/**
  • src/libs/ElevenLabs/Generated/ElevenLabs.Models.DetailedMusicResponse.g.cs is excluded by !**/generated/**
  • src/libs/ElevenLabs/Generated/ElevenLabs.Models.MultipartMusicResponse.Json.g.cs is excluded by !**/generated/**
  • src/libs/ElevenLabs/Generated/ElevenLabs.Models.MultipartMusicResponse.g.cs is excluded by !**/generated/**
  • src/libs/ElevenLabs/Generated/ElevenLabs.Models.RedirectToMintlifyResponse.g.cs is excluded by !**/generated/**
  • src/libs/ElevenLabs/Generated/ElevenLabs.Models.SongMetadata.Json.g.cs is excluded by !**/generated/**
  • src/libs/ElevenLabs/Generated/ElevenLabs.Models.SongMetadata.g.cs is excluded by !**/generated/**
  • src/libs/ElevenLabs/Generated/ElevenLabs.Models.UserResponseModel.g.cs is excluded by !**/generated/**
  • src/libs/ElevenLabs/Generated/ElevenLabs.MusicGenerationClient.CreateMusicDetailed.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/ElevenLabs/openapi.yaml (7 hunks)
🔇 Additional comments (1)
src/libs/ElevenLabs/openapi.yaml (1)

16013-16059: Approve DetailedMusicResponse references
All referenced schemas have single, authoritative definitions under components/schemas in src/libs/ElevenLabs/openapi.yaml:

  • MusicPrompt defined at line 19860
  • SongMetadata defined at line 22372

Comment on lines +9007 to 9016
description: Multipart/mixed response with JSON metadata and binary audio file
headers:
song-id:
description: Unique identifier for the generated song
schema:
type: string
content:
application/json:
schema: { }
multipart/mixed:
schema:
type: string
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Multipart response schema is invalid; define parts with proper schema and encoding.

Declaring multipart/mixed as type: string is incorrect. Model the parts (metadata JSON + audio binary) either inline or via a dedicated schema, and add an encoding section to specify per-part content types.

Apply this diff to fix the response content:

         '200':
-          description: Multipart/mixed response with JSON metadata and binary audio file
+          description: Multipart/mixed response with JSON metadata and binary audio file
           headers:
             song-id:
               description: Unique identifier for the generated song
               schema:
                 type: string
           content:
             multipart/mixed:
-              schema:
-                type: string
+              schema:
+                $ref: '#/components/schemas/MultipartMusicResponse'
+              encoding:
+                metadata:
+                  contentType: application/json
+                audio:
+                  contentType: audio/*
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
description: Multipart/mixed response with JSON metadata and binary audio file
headers:
song-id:
description: Unique identifier for the generated song
schema:
type: string
content:
application/json:
schema: { }
multipart/mixed:
schema:
type: string
'200':
description: Multipart/mixed response with JSON metadata and binary audio file
headers:
song-id:
description: Unique identifier for the generated song
schema:
type: string
content:
multipart/mixed:
schema:
$ref: '#/components/schemas/MultipartMusicResponse'
encoding:
metadata:
contentType: application/json
audio:
contentType: audio/*

💡 Verification agent

❓ Verification inconclusive

Run an OpenAPI linter/validator to catch structural issues early.

Given the multipart schema changes and complex new components, validate the spec to avoid breaking SDK generation and docs.

Also applies to: 19652-19859


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Validate with swagger-cli
npm init -y >/dev/null 2>&1
npm i -D @apidevtools/swagger-cli >/dev/null 2>&1
npx swagger-cli validate src/libs/ElevenLabs/openapi.yaml

# Lint with Redocly (more semantic checks)
npm i -D @redocly/cli >/dev/null 2>&1
npx @redocly/cli lint src/libs/ElevenLabs/openapi.yaml

Length of output: 159


OpenAPI validation failed – fix $defs usage

Running npx swagger-cli validate src/libs/ElevenLabs/openapi.yaml reports:

Token “$defs” does not exist.

This indicates the spec is using JSON-Schema’s $defs, which isn’t recognized by the OpenAPI v3 validator. To resolve:

  • Migrate all $defs entries under components/schemas.
  • Update any $ref: '$defs/...’ to point at #/components/schemas/....
  • Re-run validation:
    • npx swagger-cli validate src/libs/ElevenLabs/openapi.yaml
    • npx @redocly/cli lint src/libs/ElevenLabs/openapi.yaml
  • Ensure no remaining linter errors before generating SDKs or docs.

Applies equally to the same pattern in lines 19652–19859.

Comment on lines +19652 to +19859
MultipartMusicResponse:
title: MultipartMusicResponse
required:
- metadata
- audio
type: object
properties:
metadata:
$ref: '#/components/schemas/DetailedMusicResponse'
audio:
title: Audio
type: string
description: Binary audio data in the requested format
format: binary
description: Multipart response structure with JSON metadata and binary audio
example:
audio: '[binary audio data]'
metadata:
$defs:
MusicPrompt:
example:
negative_global_styles:
- metal
- hip-hop
- country
positive_global_styles:
- pop
- rock
- jazz
sections:
- duration_ms: 10000
lines:
- Verse 1 lyrics
negative_local_styles:
- metal
- hip-hop
- country
positive_local_styles:
- pop
- rock
- jazz
section_name: Verse 1
properties:
positive_global_styles:
description: The styles that should be present in the entire song.
type: array
items:
type: string
maxItems: 50
title: Positive Global Styles
negative_global_styles:
description: The styles that should not be present in the entire song.
type: array
items:
type: string
maxItems: 50
title: Negative Global Styles
sections:
description: The sections of the song.
type: array
items:
$ref: '#/$defs/SongSection'
maxItems: 30
title: Sections
required:
- positive_global_styles
- negative_global_styles
- sections
title: MusicPrompt
type: object
SongMetadata:
example:
description: My Song Description
genres:
- pop
- rock
- jazz
is_explicit: false
languages:
- en
- fr
title: My Song
properties:
title:
description: The title of the song
title: Title
type: string
nullable: true
description:
description: The description of the song
title: Description
type: string
nullable: true
genres:
description: The genres of the song
type: array
items:
type: string
title: Genres
languages:
description: The languages of the song
type: array
items:
type: string
title: Languages
is_explicit:
description: Whether the song is explicit
title: Is Explicit
type: boolean
nullable: true
required:
- title
- description
- genres
- languages
- is_explicit
title: SongMetadata
type: object
SongSection:
properties:
section_name:
description: The name of the section. Must be between 1 and 100 characters.
type: string
maxLength: 100
minLength: 1
title: Section Name
positive_local_styles:
description: The styles that should be present in this section.
type: array
items:
type: string
maxItems: 50
title: Positive Local Styles
negative_local_styles:
description: The styles that should not be present in this section.
type: array
items:
type: string
maxItems: 50
title: Negative Local Styles
duration_ms:
description: The duration of the section in milliseconds. Must be between 3000ms and 120000ms.
type: integer
maximum: 120000
minimum: 3000
title: Duration Ms
lines:
description: The lyrics of the section.
type: array
items:
type: string
maxItems: 30
title: Lines
required:
- section_name
- positive_local_styles
- negative_local_styles
- duration_ms
- lines
title: SongSection
type: object
description: Response model for structured music generation endpoint
example:
composition_plan:
negative_global_styles:
- metal
- hip-hop
- country
positive_global_styles:
- pop
- rock
- jazz
sections:
- duration_ms: 10000
lines:
- Verse 1 lyrics
negative_local_styles:
- metal
- hip-hop
- country
positive_local_styles:
- pop
- rock
- jazz
section_name: Verse 1
song_metadata:
description: My Song Description
genres:
- pop
- rock
- jazz
is_explicit: false
languages:
- en
- fr
title: My Song
properties:
composition_plan:
description: The composition plan used to generate the song
$ref: '#/$defs/MusicPrompt'
song_metadata:
description: The metadata of the generated song
$ref: '#/$defs/SongMetadata'
required:
- composition_plan
- song_metadata
title: DetailedMusicResponse
type: object
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

MultipartMusicResponse block contains invalid nested $defs and a duplicate DetailedMusicResponse; likely breaks YAML and OpenAPI.

  • $defs must not appear inside example payloads.
  • The block appears to embed another full schema (DetailedMusicResponse) inside MultipartMusicResponse, which is invalid YAML structure and duplicates a component defined elsewhere.
  • Keep MultipartMusicResponse minimal and reference existing components.

Apply this diff to clean up the schema and example:

     MultipartMusicResponse:
       title: MultipartMusicResponse
       required:
         - metadata
         - audio
       type: object
       properties:
         metadata:
-          $ref: '#/components/schemas/DetailedMusicResponse'
+          $ref: '#/components/schemas/DetailedMusicResponse'
         audio:
           title: Audio
           type: string
           description: Binary audio data in the requested format
           format: binary
       description: Multipart response structure with JSON metadata and binary audio
-      example:
-        audio: '[binary audio data]'
-        metadata:
-          $defs:
-            MusicPrompt:
-              example:
-                negative_global_styles:
-                  - metal
-                  - hip-hop
-                  - country
-                positive_global_styles:
-                  - pop
-                  - rock
-                  - jazz
-                sections:
-                  - duration_ms: 10000
-                    lines:
-                      - Verse 1 lyrics
-                    negative_local_styles:
-                      - metal
-                      - hip-hop
-                      - country
-                    positive_local_styles:
-                      - pop
-                      - rock
-                      - jazz
-                    section_name: Verse 1
-              properties:
-                positive_global_styles:
-                  description: The styles that should be present in the entire song.
-                  type: array
-                  items:
-                    type: string
-                  maxItems: 50
-                  title: Positive Global Styles
-                negative_global_styles:
-                  description: The styles that should not be present in the entire song.
-                  type: array
-                  items:
-                    type: string
-                  maxItems: 50
-                  title: Negative Global Styles
-                sections:
-                  description: The sections of the song.
-                  type: array
-                  items:
-                    $ref: '#/$defs/SongSection'
-                  maxItems: 30
-                  title: Sections
-              required:
-                - positive_global_styles
-                - negative_global_styles
-                - sections
-              title: MusicPrompt
-              type: object
-            SongMetadata:
-              example:
-                description: My Song Description
-                genres:
-                  - pop
-                  - rock
-                  - jazz
-                is_explicit: false
-                languages:
-                  - en
-                  - fr
-                title: My Song
-              properties:
-                title:
-                  description: The title of the song
-                  title: Title
-                  type: string
-                  nullable: true
-                description:
-                  description: The description of the song
-                  title: Description
-                  type: string
-                  nullable: true
-                genres:
-                  description: The genres of the song
-                  type: array
-                  items:
-                    type: string
-                  title: Genres
-                languages:
-                  description: The languages of the song
-                  type: array
-                  items:
-                    type: string
-                  title: Languages
-                is_explicit:
-                  description: Whether the song is explicit
-                  title: Is Explicit
-                  type: boolean
-                  nullable: true
-              required:
-                - title
-                - description
-                - genres
-                - languages
-                - is_explicit
-              title: SongMetadata
-              type: object
-            SongSection:
-              properties:
-                section_name:
-                  description: The name of the section. Must be between 1 and 100 characters.
-                  type: string
-                  maxLength: 100
-                  minLength: 1
-                  title: Section Name
-                positive_local_styles:
-                  description: The styles that should be present in this section.
-                  type: array
-                  items:
-                    type: string
-                  maxItems: 50
-                  title: Positive Local Styles
-                negative_local_styles:
-                  description: The styles that should not be present in this section.
-                  type: array
-                  items:
-                    type: string
-                  maxItems: 50
-                  title: Negative Local Styles
-                duration_ms:
-                  description: The duration of the section in milliseconds. Must be between 3000ms and 120000ms.
-                  type: integer
-                  maximum: 120000
-                  minimum: 3000
-                  title: Duration Ms
-                lines:
-                  description: The lyrics of the section.
-                  type: array
-                  items:
-                    type: string
-                  maxItems: 30
-                  title: Lines
-              required:
-                - section_name
-                - positive_local_styles
-                - negative_local_styles
-                - duration_ms
-                - lines
-              title: SongSection
-              type: object
-          description: Response model for structured music generation endpoint
-          example:
-            composition_plan:
-              negative_global_styles:
-                - metal
-                - hip-hop
-                - country
-              positive_global_styles:
-                - pop
-                - rock
-                - jazz
-              sections:
-                - duration_ms: 10000
-                  lines:
-                    - Verse 1 lyrics
-                  negative_local_styles:
-                    - metal
-                    - hip-hop
-                    - country
-                  positive_local_styles:
-                    - pop
-                    - rock
-                    - jazz
-                  section_name: Verse 1
-            song_metadata:
-              description: My Song Description
-              genres:
-                - pop
-                - rock
-                - jazz
-              is_explicit: false
-              languages:
-                - en
-                - fr
-              title: My Song
-          properties:
-            composition_plan:
-              description: The composition plan used to generate the song
-              $ref: '#/$defs/MusicPrompt'
-            song_metadata:
-              description: The metadata of the generated song
-              $ref: '#/$defs/SongMetadata'
-          required:
-            - composition_plan
-            - song_metadata
-          title: DetailedMusicResponse
-          type: object
+      example:
+        metadata:
+          composition_plan:
+            positive_global_styles: [pop, rock, jazz]
+            negative_global_styles: [metal, hip-hop, country]
+            sections:
+              - section_name: Verse 1
+                duration_ms: 10000
+                lines: ["Verse 1 lyrics"]
+                positive_local_styles: [pop, rock, jazz]
+                negative_local_styles: [metal, hip-hop, country]
+          song_metadata:
+            title: My Song
+            description: My Song Description
+            genres: [pop, rock, jazz]
+            languages: [en, fr]
+            is_explicit: false
+        audio: '[binary audio data]'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
MultipartMusicResponse:
title: MultipartMusicResponse
required:
- metadata
- audio
type: object
properties:
metadata:
$ref: '#/components/schemas/DetailedMusicResponse'
audio:
title: Audio
type: string
description: Binary audio data in the requested format
format: binary
description: Multipart response structure with JSON metadata and binary audio
example:
audio: '[binary audio data]'
metadata:
$defs:
MusicPrompt:
example:
negative_global_styles:
- metal
- hip-hop
- country
positive_global_styles:
- pop
- rock
- jazz
sections:
- duration_ms: 10000
lines:
- Verse 1 lyrics
negative_local_styles:
- metal
- hip-hop
- country
positive_local_styles:
- pop
- rock
- jazz
section_name: Verse 1
properties:
positive_global_styles:
description: The styles that should be present in the entire song.
type: array
items:
type: string
maxItems: 50
title: Positive Global Styles
negative_global_styles:
description: The styles that should not be present in the entire song.
type: array
items:
type: string
maxItems: 50
title: Negative Global Styles
sections:
description: The sections of the song.
type: array
items:
$ref: '#/$defs/SongSection'
maxItems: 30
title: Sections
required:
- positive_global_styles
- negative_global_styles
- sections
title: MusicPrompt
type: object
SongMetadata:
example:
description: My Song Description
genres:
- pop
- rock
- jazz
is_explicit: false
languages:
- en
- fr
title: My Song
properties:
title:
description: The title of the song
title: Title
type: string
nullable: true
description:
description: The description of the song
title: Description
type: string
nullable: true
genres:
description: The genres of the song
type: array
items:
type: string
title: Genres
languages:
description: The languages of the song
type: array
items:
type: string
title: Languages
is_explicit:
description: Whether the song is explicit
title: Is Explicit
type: boolean
nullable: true
required:
- title
- description
- genres
- languages
- is_explicit
title: SongMetadata
type: object
SongSection:
properties:
section_name:
description: The name of the section. Must be between 1 and 100 characters.
type: string
maxLength: 100
minLength: 1
title: Section Name
positive_local_styles:
description: The styles that should be present in this section.
type: array
items:
type: string
maxItems: 50
title: Positive Local Styles
negative_local_styles:
description: The styles that should not be present in this section.
type: array
items:
type: string
maxItems: 50
title: Negative Local Styles
duration_ms:
description: The duration of the section in milliseconds. Must be between 3000ms and 120000ms.
type: integer
maximum: 120000
minimum: 3000
title: Duration Ms
lines:
description: The lyrics of the section.
type: array
items:
type: string
maxItems: 30
title: Lines
required:
- section_name
- positive_local_styles
- negative_local_styles
- duration_ms
- lines
title: SongSection
type: object
description: Response model for structured music generation endpoint
example:
composition_plan:
negative_global_styles:
- metal
- hip-hop
- country
positive_global_styles:
- pop
- rock
- jazz
sections:
- duration_ms: 10000
lines:
- Verse 1 lyrics
negative_local_styles:
- metal
- hip-hop
- country
positive_local_styles:
- pop
- rock
- jazz
section_name: Verse 1
song_metadata:
description: My Song Description
genres:
- pop
- rock
- jazz
is_explicit: false
languages:
- en
- fr
title: My Song
properties:
composition_plan:
description: The composition plan used to generate the song
$ref: '#/$defs/MusicPrompt'
song_metadata:
description: The metadata of the generated song
$ref: '#/$defs/SongMetadata'
required:
- composition_plan
- song_metadata
title: DetailedMusicResponse
type: object
MultipartMusicResponse:
title: MultipartMusicResponse
required:
- metadata
- audio
type: object
properties:
metadata:
$ref: '#/components/schemas/DetailedMusicResponse'
audio:
title: Audio
type: string
description: Binary audio data in the requested format
format: binary
description: Multipart response structure with JSON metadata and binary audio
example:
metadata:
composition_plan:
positive_global_styles: [pop, rock, jazz]
negative_global_styles: [metal, hip-hop, country]
sections:
- section_name: Verse 1
duration_ms: 10000
lines: ["Verse 1 lyrics"]
positive_local_styles: [pop, rock, jazz]
negative_local_styles: [metal, hip-hop, country]
song_metadata:
title: My Song
description: My Song Description
genres: [pop, rock, jazz]
languages: [en, fr]
is_explicit: false
audio: '[binary audio data]'

Comment on lines +24269 to 24272
description: Whether the user is new.
xi_api_key:
title: Xi Api Key
type: string
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Avoid exposing API keys in response models; mark as writeOnly or split request/response models.

Returning xi_api_key in responses is a sensitive data leak. Mark it writeOnly: true (request-only), or better, remove it from response schemas and only return once at creation.

Minimal mitigation:

         xi_api_key:
           title: Xi Api Key
           type: string
+          writeOnly: true
+          description: API key secret. Provided in requests and at creation time only; never returned by read endpoints.

If this schema is used for both requests and responses, consider splitting into distinct request/response models to ensure the key is never serialized in responses.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
description: Whether the user is new.
xi_api_key:
title: Xi Api Key
type: string
description: Whether the user is new.
xi_api_key:
title: Xi Api Key
type: string
writeOnly: true
description: API key secret. Provided in requests and at creation time only; never returned by read endpoints.
🤖 Prompt for AI Agents
In src/libs/ElevenLabs/openapi.yaml around lines 24269-24272, the schema
currently exposes the xi_api_key in responses; update the OpenAPI definition to
prevent leaking API keys by marking xi_api_key as writeOnly: true or by
splitting the schema into separate request and response models so the key is
only included in request/creation payloads (or returned once at creation) and
removed from all response schemas.

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