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

# Suno Query Batch

> Use DeerAPI to call the Suno Query Batch endpoint with request details, response details, examples, and an OpenAPI playground.

## Overview

Use this endpoint to call the Suno Query Batch workflow through DeerAPI. The API reference on this page shows the request schema, response schema, authentication requirements, and runnable examples for the configured endpoint.

## Before you start

Use the DeerAPI base URL and pass your API Key in the `Authorization` header:

```text theme={null}
https://api.deerapi.com
```

```text theme={null}
Authorization: Bearer $DEERAPI_KEY
```

## Model selection

Choose a current model ID from the [live pricing page](https://api.deerapi.com/pricing). Model availability changes over time, so avoid copying a model ID from an old project without checking the live list first.

## Implementation notes

* Use the OpenAPI playground for the exact request fields accepted by this endpoint.
* Keep API Keys on the server side when you build production applications.
* Log the request ID from failed calls so support can investigate the request.
* Retry `429`, `500`, and `503` responses with exponential backoff.


## OpenAPI

````yaml /api/openapi/music/suno/post-query-batch.openapi.json POST /suno/fetch
openapi: 3.1.0
info:
  title: Query Batch Tasks API
  version: 1.0.0
servers:
  - url: https://api.deerapi.com
security:
  - bearerAuth: []
paths:
  /suno/fetch:
    post:
      summary: Query batch tasks
      operationId: query_batch_tasks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - ids
                - action
              properties:
                ids:
                  type: array
                  items:
                    type: string
                  default:
                    - example
                action:
                  type: string
                  description: |
                    Action type: MUSIC or LYRICS.
                  default: example
              default:
                ids:
                  - example
                action: example
            example:
              ids:
                - example
              action: example
            examples:
              Default:
                summary: Default request
                value:
                  ids:
                    - example
                  action: example
      responses:
        '200':
          description: Batch task fetch
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                  - data
                properties:
                  code:
                    type: string
                    description: API response status code
                  message:
                    type: string
                    description: Response message
                  data:
                    type: array
                    description: Array of primary data items.
                    items:
                      type: object
                      properties:
                        task_id:
                          type: string
                          description: Unique task identifier
                        notify_hook:
                          type: string
                          description: >-
                            Webhook callback URL for task completion or status
                            changes.
                        action:
                          type: string
                          description: Task action type
                        status:
                          type: string
                          description: Current task status
                        fail_reason:
                          type: string
                          description: >-
                            Failure reason, only present when the task has
                            failed.
                        submit_time:
                          type: integer
                          description: Task submission timestamp (Unix timestamp, seconds)
                        start_time:
                          type: integer
                          description: >-
                            Task processing start timestamp (Unix timestamp,
                            seconds)
                        finish_time:
                          type: integer
                          description: Task completion timestamp (Unix timestamp, seconds)
                        progress:
                          type: string
                          description: Task completion progress percentage
                        data:
                          type: array
                          description: Array of task results.
                          items:
                            type: object
                            required:
                              - id
                              - title
                              - status
                              - metadata
                              - audio_url
                              - image_url
                              - video_url
                              - model_name
                              - image_large_url
                              - major_model_version
                            properties:
                              id:
                                type: string
                                description: Unique identifier of the generated item
                              title:
                                type: string
                                description: Title of the generated item
                              status:
                                type: string
                                description: Status of the generated item
                              metadata:
                                type: object
                                description: >-
                                  Object containing detailed metadata of
                                  generated items.
                                required:
                                  - tags
                                  - prompt
                                  - duration
                                  - error_type
                                  - error_message
                                  - audio_prompt_id
                                  - gpt_description_prompt
                                properties:
                                  tags:
                                    type: string
                                    description: Tags or keywords associated with the item
                                  prompt:
                                    type: string
                                    description: >-
                                      Input prompt text used to generate the
                                      item
                                  duration:
                                    type: 'null'
                                    description: Duration of the generated audio
                                  error_type:
                                    type: 'null'
                                    description: Error type
                                  error_message:
                                    type: 'null'
                                    description: Error message
                                  audio_prompt_id:
                                    type: 'null'
                                    description: Audio prompt ID
                                  gpt_description_prompt:
                                    type: string
                                    description: GPT-generated descriptive prompt
                              audio_url:
                                type: string
                                description: URL of the generated audio file
                              image_url:
                                type: string
                                description: URL of the associated image
                              video_url:
                                type: string
                                description: URL of the associated video
                              model_name:
                                type: string
                                description: AI model name used
                              image_large_url:
                                type: string
                                description: URL of the associated large image
                              major_model_version:
                                type: string
                                description: Primary version number of the AI model used
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl https://api.deerapi.com/suno/fetch \
              -H "Content-Type: application/json" \
              -H "Authorization: Bearer $DEERAPI_KEY" \
              -d '{
                "ids": [
                  "example"
                ],
                "action": "example"
              }'
        - lang: Python
          label: requests
          source: |
            import os
            import requests

            url = "https://api.deerapi.com/suno/fetch"
            headers = {
                "Authorization": "Bearer " + os.environ["DEERAPI_KEY"],
                "Content-Type": "application/json",
            }
            payload = {
              "ids": [
                "example"
              ],
              "action": "example"
            }

            response = requests.post(url, headers=headers, json=payload)
            print(response.json())
        - lang: JavaScript
          label: fetch
          source: |
            const response = await fetch("https://api.deerapi.com/suno/fetch", {
              method: "POST",
              headers: {
                Authorization: `Bearer ${process.env.DEERAPI_KEY}`,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({
                "ids": [
                  "example"
                ],
                "action": "example"
              }),
            });

            console.log(await response.json());
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Use a DeerAPI API Key as a Bearer token.

````