# Download batch task results

> Common

Download the result file (JSONL) as a byte stream. `file_id` is the
`output_file_id` (successful results) or `error_file_id` (failure
details) returned by the retrieve-batch endpoint. Each line in the
result file corresponds to a request in the input file, linked by
`custom_id`.

## Endpoint

`GET https://api.modelverse.cn/v1/files/{file_id}/content`

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| file_id | path | string | Yes | Result file ID, i.e. `output_file_id` or `error_file_id`. |

## Responses

- **200** — The result file stream. Each line is a JSON object whose `custom_id`
matches the input request, and `response.body` holds that request's
result.

- **404** — File not found or not accessible.
- **default** — Error response.

## OpenAPI Definition

```json
{
  "openapi": "3.1.0",
  "x-language": "en-US",
  "info": {
    "title": "Batch Tasks - Download Results",
    "version": "1.0.0",
    "description": "Step 5 of the ModelVerse **OpenAI-compatible Batch async task** flow:\ndownload the task results. After the task completes, use `output_file_id`\n(successful results) or `error_file_id` (failure details) to download the\ncorresponding JSONL file. Endpoint: `GET /v1/files/{file_id}/content`.\n"
  },
  "servers": [
    {
      "url": "https://api.modelverse.cn",
      "description": "ModelVerse API endpoint."
    }
  ],
  "tags": [
    {
      "name": "Batch Async Tasks",
      "description": "OpenAI-compatible batch async task APIs."
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/files/{file_id}/content": {
      "get": {
        "tags": [
          "Batch Async Tasks"
        ],
        "operationId": "downloadBatchOutput",
        "summary": "Download batch task results",
        "description": "Download the result file (JSONL) as a byte stream. `file_id` is the\n`output_file_id` (successful results) or `error_file_id` (failure\ndetails) returned by the retrieve-batch endpoint. Each line in the\nresult file corresponds to a request in the input file, linked by\n`custom_id`.\n",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "description": "Result file ID, i.e. `output_file_id` or `error_file_id`.",
            "schema": {
              "type": "string"
            },
            "example": "file-out456"
          }
        ],
        "responses": {
          "200": {
            "description": "The result file stream. Each line is a JSON object whose `custom_id`\nmatches the input request, and `response.body` holds that request's\nresult.\n",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Raw byte stream of the JSONL result file."
                }
              },
              "application/jsonl": {
                "schema": {
                  "type": "string",
                  "description": "JSONL text, one result object per line. Example (single line):\n`{\"id\":\"batch_req_1\",\"custom_id\":\"request-1\",\"response\":{\"status_code\":200,\"request_id\":\"req_aaa\",\"body\":{\"id\":\"chatcmpl-1\",\"object\":\"chat.completion\",\"model\":\"gpt-5-batch\",\"choices\":[{\"index\":0,\"finish_reason\":\"stop\",\"message\":{\"role\":\"assistant\",\"content\":\"Hangzhou is the capital of Zhejiang.\"}}],\"usage\":{\"prompt_tokens\":30,\"completion_tokens\":8,\"total_tokens\":38}}},\"error\":null}`\n"
                },
                "examples": {
                  "success": {
                    "summary": "Result file (two lines shown)",
                    "value": "{\"id\":\"batch_req_1\",\"custom_id\":\"request-1\",\"response\":{\"status_code\":200,\"request_id\":\"req_aaa\",\"body\":{\"id\":\"chatcmpl-1\",\"object\":\"chat.completion\",\"model\":\"gpt-5-batch\",\"choices\":[{\"index\":0,\"finish_reason\":\"stop\",\"message\":{\"role\":\"assistant\",\"content\":\"Hangzhou is the capital of Zhejiang, famous for West Lake and its digital economy.\"}}],\"usage\":{\"prompt_tokens\":30,\"completion_tokens\":18,\"total_tokens\":48}}},\"error\":null}\n{\"id\":\"batch_req_2\",\"custom_id\":\"request-2\",\"response\":{\"status_code\":200,\"request_id\":\"req_bbb\",\"body\":{\"id\":\"chatcmpl-2\",\"object\":\"chat.completion\",\"model\":\"gpt-5-batch\",\"choices\":[{\"index\":0,\"finish_reason\":\"stop\",\"message\":{\"role\":\"assistant\",\"content\":\"1 plus 1 equals 2.\"}}],\"usage\":{\"prompt_tokens\":12,\"completion_tokens\":6,\"total_tokens\":18}}},\"error\":null}\n"
                  }
                }
              }
            }
          },
          "404": {
            "description": "File not found or not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "$ref": "#/components/examples/BatchError"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "error": {
                    "$ref": "#/components/examples/BatchError"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API key",
        "description": "Provide the API key via the `Authorization` header as\n`Bearer <your_api_key>`.\n"
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "Error": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "message",
          "type"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message."
          },
          "type": {
            "type": "string",
            "description": "Error type.",
            "examples": [
              "invalid_request_error"
            ]
          },
          "code": {
            "type": "string",
            "description": "Machine-readable error code."
          },
          "param": {
            "type": "string",
            "description": "The offending parameter name or request ID."
          }
        }
      }
    },
    "examples": {
      "BatchError": {
        "summary": "Standard JSON error response",
        "value": {
          "error": {
            "message": "file not found",
            "type": "invalid_request_error",
            "code": "not_found",
            "param": "file_id"
          }
        }
      }
    }
  }
}
```
