> ## Documentation Index
> Fetch the complete documentation index at: https://docs.deepshi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> The Deepshi API is an OpenAI-compatible gateway. Base URL: https://api.deepshi.ai/v1. API keys start with sk-bf- and go in the Authorization: Bearer header. Prefer the official OpenAI SDKs pointed at the Deepshi base URL. Model ids are clean with no provider prefix (e.g. deepshi-3.0, claude-opus-4.8, gpt-5.5). Chat and image requests are synchronous; video and music requests are asynchronous job APIs (create, then poll). Every synchronous response carries usage.cost.total_cost in USD. Do not reference the internal /api/* admin plane or virtual keys.

# Create a music job

> Create an asynchronous music generation job from a style prompt. Returns a job with `status: "in_progress"`; poll `GET /v1/audio/generations/{audio_id}` until it is `completed`. Some models take lyrics and generate vocal songs, others are instrumental; call `GET /v1/models` to see the parameters a model supports. Music is billed once, on completion; pricing is shown on deepshi.ai.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/audio/generations
openapi: 3.1.0
info:
  title: Deepshi API
  description: >-
    OpenAI-compatible REST API for Deepshi's own models and leading third-party
    models. Authenticate with your Deepshi API key as a bearer token, and
    reference a model by its id (e.g. `deepshi-3.0`, `gpt-4o`) in the `model`
    field.
  version: 1.0.0
servers:
  - url: https://api.deepshi.ai
    description: Deepshi API
security:
  - BearerAuth: []
paths:
  /v1/audio/generations:
    post:
      tags:
        - Music
      summary: Create a music job
      description: >-
        Create an asynchronous music generation job from a style prompt. Returns
        a job with `status: "in_progress"`; poll `GET
        /v1/audio/generations/{audio_id}` until it is `completed`. Some models
        take lyrics and generate vocal songs, others are instrumental; call `GET
        /v1/models` to see the parameters a model supports. Music is billed
        once, on completion; pricing is shown on deepshi.ai.
      operationId: createMusic
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AudioGenerationRequest'
            example:
              model: minimax-music-v2
              prompt: a warm lofi hip hop beat with mellow piano and vinyl crackle
              lyrics_prompt: |-
                [Verse]
                city lights fade slow
                in the quiet night we go
                [Chorus]
                hold on to the glow
      responses:
        '200':
          description: The created music job.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AudioJob'
              example:
                id: aud_a1b2c3
                object: audio
                model: minimax-music-v2
                status: in_progress
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/InsufficientQuota'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    AudioGenerationRequest:
      type: object
      description: >-
        Music generation request. `model` and `prompt` are required;
        `lyrics_prompt` is required by some models. The remaining fields are
        optional, model-specific options; call `GET /v1/models` for the
        parameters each model accepts. Additional parameters not listed here may
        also be sent and are forwarded to the model.
      required:
        - model
        - prompt
      additionalProperties: true
      properties:
        model:
          type: string
          description: The music model id. See `GET /v1/models`.
          example: minimax-music-v2
        prompt:
          type: string
          description: >-
            The music style: genre, mood, instruments, tempo. Up to the model's
            `prompt_max_length`.
          example: a warm lofi hip hop beat with mellow piano and vinyl crackle
        lyrics_prompt:
          type: string
          description: >-
            The lyrics to sing, with `[Verse]` / `[Chorus]` structure tags on
            their own lines (separate lines with `\n`). 10 to 3000 characters.
            Required by some models.
          example: |-
            [Verse]
            city lights fade slow
            in the quiet night we go
            [Chorus]
            hold on to the glow
        is_instrumental:
          type: boolean
          description: Generate a vocal-free track, where supported.
        music_length_ms:
          type: integer
          description: >-
            Output length in milliseconds, where the model supports duration
            control.
        seconds_total:
          type: integer
          description: Output length in seconds, where the model supports duration control.
        duration:
          type: integer
          description: Output length in seconds, where the model supports duration control.
        sample_rate:
          type: integer
          description: >-
            Output sample rate in Hz; one of the model's allowed values, where
            supported.
          example: 44100
        bitrate:
          type: integer
          description: >-
            Output bitrate in bits per second; one of the model's allowed
            values, where supported.
          example: 256000
        format:
          type: string
          description: Output container, where supported.
          example: mp3
    AudioJob:
      type: object
      description: A music generation job.
      properties:
        id:
          type: string
          description: The job id. Pass it to the retrieve and content endpoints.
        object:
          type: string
          description: Object type, always `audio`.
          example: audio
        model:
          type: string
          description: The music model id you requested.
        status:
          type: string
          enum:
            - in_progress
            - completed
            - failed
          description: Lifecycle state of the job.
        seconds:
          type: string
          description: >-
            Length of the generated track in seconds, present when `status` is
            `completed`.
        created_at:
          type: integer
          format: int64
          description: Unix timestamp when the job was created.
        completed_at:
          type: integer
          format: int64
          nullable: true
          description: Unix timestamp when the job completed.
        audio:
          type: array
          items:
            $ref: '#/components/schemas/AudioOutput'
          description: The generated song, present when `status` is `completed`.
        error:
          type: object
          nullable: true
          description: >-
            Present when `status` is `failed`. Explains the failure; the job is
            not charged.
          properties:
            code:
              type: string
            message:
              type: string
    AudioOutput:
      type: object
      properties:
        type:
          type: string
          description: Output kind, always `url`.
          example: url
        url:
          type: string
          description: Direct link to the finished `.mp3`.
        content_type:
          type: string
          description: Media type, always `audio/mpeg`.
    Error:
      type: object
      description: Error envelope, matching the OpenAI shape.
      required:
        - error
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: Human-readable description of the error.
            type:
              type: string
              description: >-
                Error category, e.g. `invalid_request_error` or
                `insufficient_quota`.
            code:
              type: string
              nullable: true
              description: >-
                Machine-readable error code, e.g. `invalid_api_key`,
                `model_not_found`, `insufficient_quota` (may be null).
            param:
              type: string
              nullable: true
              description: The request parameter the error relates to, when applicable.
  responses:
    BadRequest:
      description: Malformed request, or a model id that doesn't exist in the catalog.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: The model does not exist or you do not have access to it.
              type: invalid_request_error
              code: model_not_found
              param: null
    Unauthorized:
      description: Missing, malformed, or unknown API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Incorrect API key provided.
              type: invalid_request_error
              code: invalid_api_key
              param: null
    InsufficientQuota:
      description: The account is out of credits.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: You have insufficient credits to complete this request.
              type: insufficient_quota
              code: insufficient_quota
              param: null
    Forbidden:
      description: The key is revoked, or not permitted to use the requested model.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: The model does not exist or you do not have access to it.
              type: invalid_request_error
              code: model_not_found
              param: null
    RateLimited:
      description: Too many requests. Back off and retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Rate limit reached. Please retry after a short delay.
              type: rate_limit_error
              code: rate_limit_exceeded
              param: null
    InternalError:
      description: Temporary server error. Retry with backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: >-
                The server had an error while processing your request. Please
                retry.
              type: api_error
              code: null
              param: null
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'Your Deepshi API key, sent as `Authorization: Bearer <key>`.'

````