# The Batch object

The AI Functions Asynchronous API lets you process large volumes of requests as a batch in a single call.

## Attributes

- `name` (string, Beta, Output only, ID, Immutable)
  Output only. Identifier. Resource name of the batch, returned by create. Format: `batch_<id>`.
- `endpoint` (string, Beta)
  The AI function, for example `ai_parse_document`.
- `input_ref` (string, Beta)
  Unity Catalog volume path of the JSONL input file. Each line is one request, in the form `{"custom_id": ..., "body": ...}`. The file can hold up to 50,000 requests and be up to 200 MiB.
- `params` (object, Beta)
  Parameters of the function other than its input, applied to every request in the batch, for example
   `schema` for `ai_extract`. Put function options, such as `version`, in a nested `options` object. For
   the parameters of each function, see [AI Functions](https://docs.databricks.com/large-language-models/ai-functions).
- `output_ref` (string, Beta)
  Unity Catalog volume path to write the JSONL output file to. If the path is a directory, the file is `<path>/<name>_output.jsonl`.
- `status` (string, Beta, Output only)
  Output only. The status of the batch.
  Possible values:
  - `PENDING`
  - `IN_PROGRESS`
  - `FINALIZING`
  - `COMPLETED`
  - `CANCELLING`
  - `CANCELLED`
  - `FAILED`
- `create_time` (string, Beta, Output only)
  Output only. The time when the batch was created.
- `request_counts` (object, Beta, Output only)
  Output only. The number of requests in the batch, by result. Returned when you get a batch, not when you list
   batches.
  - `total` (int64, Beta, Output only)
    Output only. The number of requests in the batch.
  - `succeeded` (int64, Beta, Output only)
    Output only. The number of requests that were processed successfully.
  - `failed` (int64, Beta, Output only)
    Output only. The number of requests that failed. The service does not retry them.
- `percent_complete` (double, Beta, Output only)
  Output only. The percentage of requests that are processed, from 0 to 100. Returned when you get a batch, not when you
   list batches.

## Example

```json
{
  "name": "string",
  "endpoint": "string",
  "input_ref": "string",
  "params": {},
  "output_ref": "string",
  "status": "PENDING",
  "create_time": "string",
  "request_counts": {
    "total": 0,
    "succeeded": 0,
    "failed": 0
  },
  "percent_complete": 0
}
```


