---
title: Batch 만들기 | RunAPI
description: 유효한 purpose=batch File을 기반으로 하는 Moderation Batch를 제출합니다.
url: https://runapi.ai/ko/docs/api/protocol/batches/create.md
canonical: https://runapi.ai/ko/docs/api/protocol/batches/create
locale: ko
---

> HTML 버전: https://runapi.ai/ko/docs/api/protocol/batches/create
> 에이전트용 사이트 색인: https://runapi.ai/llms.txt

# Batch 만들기

유효한 purpose=batch File을 기반으로 하는 Moderation Batch를 제출합니다.

## 엔드포인트

POST /v1/batches

Base URL: https://runapi.ai

API 버전: v1

인증: Authorization: Bearer YOUR_API_KEY

## 요청

나열된 요청 위치에만 값을 전송하세요.

### application/json

```json
{
  "completion_window": {
    "description": "이 Batch 기능의 완료 기간.",
    "required": true,
    "type": "string"
  },
  "endpoint": {
    "description": "이 배치 기능이 처리하는 Moderation 엔드포인트.",
    "required": true,
    "type": "string"
  },
  "input_file_id": {
    "description": "purpose=batch 입력 파일에 대한 RunAPI 파일 ID.",
    "required": true,
    "type": "string"
  },
  "metadata": {
    "description": "배치 객체와 함께 반환되는 선택적 호출자 메타데이터.",
    "required": false,
    "type": "object"
  }
}
```

## 성공 응답

HTTP 200 - POST /v1/batches

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

## 오류 응답 (401)

HTTP 401

### 응답 스키마

```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"
}
```

### 응답 예시

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

## 오류 응답 (400)

HTTP 400

### 응답 스키마

```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"
}
```

### 응답 예시

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

## 오류 응답 (404)

HTTP 404

### 응답 스키마

```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"
}
```

### 응답 예시

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

## 오류 응답 (409)

HTTP 409

### 응답 스키마

```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"
}
```

### 응답 예시

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

## 오류 응답 (402)

HTTP 402

### 응답 스키마

```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"
}
```

### 응답 예시

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

## 오류 응답 (422)

HTTP 422

### 응답 스키마

```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"
}
```

### 응답 예시

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

## 오류 응답 (502)

HTTP 502

### 응답 스키마

```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"
}
```

### 응답 예시

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

## cURL 예시



### curl

```curl
curl -X POST https://runapi.ai/v1/batches \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"input_file_id":"file_batch123","endpoint":"/v1/moderations","completion_window":"24h","metadata":{"customer_tag":"demo"}}'
```

## 관련 참조

- [배치](https://runapi.ai/ko/docs/api/protocol/batches.md)
- [Batch 객체](https://runapi.ai/ko/docs/api/protocol/batches/object.md)

---

## RunAPI의 더 많은 정보

- [홈](https://runapi.ai/ko/.md)
- [모델 카탈로그](https://runapi.ai/ko/models.md)
- [요금](https://runapi.ai/ko/pricing.md)
- [제공사](https://runapi.ai/ko/models)
- [문서](https://runapi.ai/ko/docs/guides)
- [SDK](https://runapi.ai/ko/sdk.md)
- [CLI](https://runapi.ai/ko/cli.md)
- [MCP Server](https://runapi.ai/ko/mcp.md)
- [Claude Code와 Cursor](https://runapi.ai/ko/claude-code-vs-cursor.md)
- [Cursor API 설정](https://runapi.ai/ko/cursor-api-setup.md)
- [RunAPI와 OpenRouter 비교](https://runapi.ai/ko/openrouter-alternative.md)
- [엔터프라이즈](https://runapi.ai/ko/contact.md)
- [문의](https://runapi.ai/ko/contact.md)
- [약관](https://runapi.ai/ko/terms.md)
- [개인정보](https://runapi.ai/ko/privacy.md)
- [에이전트용 사이트 색인](https://runapi.ai/llms.txt)

문의: contact@runapi.ai

## 구조화된 데이터

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "ko",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/ko",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/ko/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "ko",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/ko",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/koicon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "ko",
    "@type": "TechArticle",
    "headline": "Batch 만들기",
    "description": "유효한 purpose=batch File을 기반으로 하는 Moderation Batch를 제출합니다.",
    "url": "https://runapi.ai/ko/docs/api/protocol/batches/create",
    "mainEntityOfPage": "https://runapi.ai/ko/docs/api/protocol/batches/create"
  }
]
```
