feat:Update openapi.yaml: headers, multipart, new schemas, xi-api-key auth#167
feat:Update openapi.yaml: headers, multipart, new schemas, xi-api-key auth#167
Conversation
WalkthroughThe 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
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)
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)
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)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
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
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
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-idheader 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-idis 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.
titleanddescriptionare marked as required but alsonullable: true. That means the keys must exist but can be null. If nulls aren’t meaningful, dropnullable; otherwise, remove them fromrequired.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.
⛔ Files ignored due to path filters (14)
src/libs/ElevenLabs/Generated/ElevenLabs.ElevenLabsClient.GetDocs.g.csis excluded by!**/generated/**src/libs/ElevenLabs/Generated/ElevenLabs.IElevenLabsClient.GetDocs.g.csis excluded by!**/generated/**src/libs/ElevenLabs/Generated/ElevenLabs.IMusicGenerationClient.CreateMusicDetailed.g.csis excluded by!**/generated/**src/libs/ElevenLabs/Generated/ElevenLabs.JsonSerializerContextTypes.g.csis excluded by!**/generated/**src/libs/ElevenLabs/Generated/ElevenLabs.Models.ComposeMusicWithADetailedResponseV1MusicDetailedPostResponse.g.csis excluded by!**/generated/**src/libs/ElevenLabs/Generated/ElevenLabs.Models.DetailedMusicResponse.Json.g.csis excluded by!**/generated/**src/libs/ElevenLabs/Generated/ElevenLabs.Models.DetailedMusicResponse.g.csis excluded by!**/generated/**src/libs/ElevenLabs/Generated/ElevenLabs.Models.MultipartMusicResponse.Json.g.csis excluded by!**/generated/**src/libs/ElevenLabs/Generated/ElevenLabs.Models.MultipartMusicResponse.g.csis excluded by!**/generated/**src/libs/ElevenLabs/Generated/ElevenLabs.Models.RedirectToMintlifyResponse.g.csis excluded by!**/generated/**src/libs/ElevenLabs/Generated/ElevenLabs.Models.SongMetadata.Json.g.csis excluded by!**/generated/**src/libs/ElevenLabs/Generated/ElevenLabs.Models.SongMetadata.g.csis excluded by!**/generated/**src/libs/ElevenLabs/Generated/ElevenLabs.Models.UserResponseModel.g.csis excluded by!**/generated/**src/libs/ElevenLabs/Generated/ElevenLabs.MusicGenerationClient.CreateMusicDetailed.g.csis 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
| 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 |
There was a problem hiding this comment.
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.
| 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.yamlLength 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
$defsentries undercomponents/schemas. - Update any
$ref: '$defs/...’to point at#/components/schemas/.... - Re-run validation:
npx swagger-cli validate src/libs/ElevenLabs/openapi.yamlnpx @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.
| 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 |
There was a problem hiding this comment.
MultipartMusicResponse block contains invalid nested $defs and a duplicate DetailedMusicResponse; likely breaks YAML and OpenAPI.
$defsmust 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
MultipartMusicResponseminimal 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.
| 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]' |
| description: Whether the user is new. | ||
| xi_api_key: | ||
| title: Xi Api Key | ||
| type: string |
There was a problem hiding this comment.
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.
| 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.
Summary by CodeRabbit
New Features
Documentation