---
title: Retrieve a Batch | RunAPI
description: Retrieve the current Batch status and request counts.
url: https://runapi.ai/docs/api/protocol/batches/retrieve.md
canonical: https://runapi.ai/docs/api/protocol/batches/retrieve
locale: en
---

> HTML version: https://runapi.ai/docs/api/protocol/batches/retrieve
> Site index for agents: https://runapi.ai/llms.txt

# Retrieve a Batch

Retrieve the current Batch status and request counts.

## Endpoint

GET /v1/batches/:batch_id

Base URL: https://runapi.ai

API version: v1

Authentication: Authorization: Bearer YOUR_API_KEY

## Request

Send values only in the listed request location.

### Path parameters

```json
{
  "batch_id": {
    "description": "RunAPI Batch ID.",
    "required": true,
    "type": "string"
  }
}
```

## Success response

HTTP 200 - GET /v1/batches/:batch_id

```json
{
  "completed_at": 1785198600,
  "completion_window": "24h",
  "created_at": 1785196800,
  "endpoint": "/v1/moderations",
  "id": "batch_abc123",
  "input_file_id": "file_batch123",
  "metadata": {
    "customer_tag": "demo"
  },
  "object": "batch",
  "output_file_id": "file_output123",
  "request_counts": {
    "completed": 3,
    "failed": 0,
    "total": 3
  },
  "status": "completed"
}
```

## Error response (401)

HTTP 401

### Response schema

```json
{
  "additionalProperties": true,
  "properties": {
    "error": {
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "message",
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "error"
  ],
  "type": "object"
}
```

### Response example

```json
{
  "error": {
    "code": "authentication_error",
    "message": "Missing API key",
    "param": null,
    "type": "authentication_error"
  }
}
```

## Error response (400)

HTTP 400

### Response schema

```json
{
  "additionalProperties": true,
  "properties": {
    "error": {
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "message",
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "error"
  ],
  "type": "object"
}
```

### Response example

```json
{
  "error": {
    "code": "invalid_request_error",
    "message": "Malformed request",
    "param": null,
    "type": "invalid_request_error"
  }
}
```

## Error response (404)

HTTP 404

### Response schema

```json
{
  "additionalProperties": true,
  "properties": {
    "error": {
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "message",
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "error"
  ],
  "type": "object"
}
```

### Response example

```json
{
  "error": {
    "code": "not_found",
    "message": "File not found",
    "param": null,
    "type": "invalid_request_error"
  }
}
```

## Error response (409)

HTTP 409

### Response schema

```json
{
  "additionalProperties": true,
  "properties": {
    "error": {
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "message",
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "error"
  ],
  "type": "object"
}
```

### Response example

```json
{
  "error": {
    "code": "upload_state_conflict",
    "message": "Upload state conflict",
    "param": null,
    "type": "invalid_request_error"
  }
}
```

## Error response (402)

HTTP 402

### Response schema

```json
{
  "additionalProperties": true,
  "properties": {
    "error": {
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "message",
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "error"
  ],
  "type": "object"
}
```

### Response example

```json
{
  "error": {
    "code": "payment_required",
    "message": "Insufficient balance",
    "param": null,
    "type": "insufficient_balance"
  }
}
```

## Error response (422)

HTTP 422

### Response schema

```json
{
  "additionalProperties": true,
  "properties": {
    "error": {
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "message",
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "error"
  ],
  "type": "object"
}
```

### Response example

```json
{
  "error": {
    "code": "invalid_upload",
    "message": "Upload request rejected",
    "param": null,
    "type": "invalid_request_error"
  }
}
```

## Error response (502)

HTTP 502

### Response schema

```json
{
  "additionalProperties": true,
  "properties": {
    "error": {
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "message",
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "error"
  ],
  "type": "object"
}
```

### Response example

```json
{
  "error": {
    "code": "storage_write_failed",
    "message": "File storage failed",
    "param": null,
    "type": "server_error"
  }
}
```

## cURL example



### curl

```curl
curl -X GET https://runapi.ai/v1/batches/batch_abc123 \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

## Related reference

- [Batches](https://runapi.ai/docs/api/protocol/batches.md)
- [Batch object](https://runapi.ai/docs/api/protocol/batches/object.md)

---

## More from RunAPI

- [Home](https://runapi.ai/.md)
- [Models](https://runapi.ai/models.md)
- [AI Video API Comparison](https://runapi.ai/ai-video-api-comparison.md)
- [OpenClaw Integration](https://runapi.ai/openclaw.md)
- [Best API for OpenClaw](https://runapi.ai/best-api-for-openclaw.md)
- [OpenClaw Image Generation](https://runapi.ai/openclaw-image-generation.md)
- [Hermes Agent Integration](https://runapi.ai/hermes-agent.md)
- [Pricing](https://runapi.ai/pricing.md)
- [Claude API Pricing](https://runapi.ai/claude-api-pricing.md)
- [ChatGPT API Pricing](https://runapi.ai/chatgpt-api-pricing.md)
- [OpenAI API Pricing](https://runapi.ai/openai-api-pricing.md)
- [Gemini API Pricing](https://runapi.ai/gemini-api-pricing.md)
- [Claude Code Pricing](https://runapi.ai/claude-code-pricing.md)
- [Claude Code API](https://runapi.ai/claude-code-api.md)
- [Claude Code vs Cursor](https://runapi.ai/claude-code-vs-cursor.md)
- [Claude Max vs API](https://runapi.ai/claude-max-vs-api.md)
- [Requesty Alternative](https://runapi.ai/requesty-alternative.md)
- [Docs](https://runapi.ai/docs/guides)
- [SDK](https://runapi.ai/sdk.md)
- [Skills](https://runapi.ai/skills.md)
- [MCP Server](https://runapi.ai/mcp.md)
- [CLI](https://runapi.ai/cli.md)
- [Feedback](https://runapi.ai/)
- [Contact](mailto:support@runapi.ai)
- [Terms](https://runapi.ai/terms.md)
- [Privacy](https://runapi.ai/privacy.md)
- [Site index for agents](https://runapi.ai/llms.txt)

Contact: contact@runapi.ai

## Structured data

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/icon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "TechArticle",
    "headline": "Retrieve a Batch",
    "description": "Retrieve the current Batch status and request counts.",
    "url": "https://runapi.ai/docs/api/protocol/batches/retrieve",
    "mainEntityOfPage": "https://runapi.ai/docs/api/protocol/batches/retrieve"
  }
]
```
