canonical: https://jentic.com/apis/azure.com/batchai

# Microsoft Azure BatchAI

Jentic publishes the only available OpenAPI specification for BatchAI, keeping it validated and agent-ready. The Azure BatchAI Management API provisions GPU-enabled clusters, file servers, experiments, and jobs for distributed deep-learning training on Azure. Operators model their training environment as workspaces containing clusters and file servers, then submit experiments and jobs that run on the cluster, with operations to terminate jobs and list output files for inspection.

## For AI agents

Provision GPU clusters, file servers, experiments, and training jobs for distributed deep learning on Azure BatchAI workspaces.

## Scope

Does not handle model registry, hyperparameter tuning, or inference deployment - use for BatchAI workspace, cluster, and job lifecycle only.

## Capabilities

- Provision and resize GPU-backed clusters scoped to a BatchAI workspace
- Create file servers that mount as shared storage for training jobs
- Submit, terminate, and inspect training jobs grouped under experiments
- List remote login credentials for cluster nodes during debugging
- List output files for a completed job to retrieve checkpoints and logs
- Manage workspace lifecycle including create, update, and delete with full ARM tagging

## Use cases

### Run a distributed deep-learning experiment

ML platform teams use BatchAI to spin up a GPU cluster, attach a shared file server with training data, and submit jobs grouped under an experiment. The API exposes Workspaces_Create, Clusters_Create, FileServers_Create, and Jobs_Create as ARM operations, so the entire training environment can be provisioned reproducibly without portal clicks.

Example prompt: Create a workspace, provision a 4-node GPU cluster, create a file server, then submit a Jobs_Create call for a PyTorch training script

### Debug a stuck job

When a training job is not progressing, on-call engineers list its remote login credentials via Jobs_ListRemoteLoginInformation, SSH into the node, and inspect logs. If the job needs to be killed, Jobs_Terminate stops execution while preserving any partial output files for later inspection through Jobs_ListOutputFiles.

Example prompt: Call Jobs_ListRemoteLoginInformation for the job, attempt SSH, and if the job is hung call Jobs_Terminate followed by Jobs_ListOutputFiles to capture partial outputs

### Cluster cost control

Finance-aware ML teams resize BatchAI clusters down to zero between training runs to avoid GPU charges. They list workspaces with Workspaces_List, then call Clusters_Update on each cluster with a new scaleSettings target. Combined with experiment cleanup, this keeps idle BatchAI spend close to zero.

Example prompt: Walk every cluster under a workspace and call Clusters_Update with target node count 0 if the cluster has no active jobs

### AI agent integration via Jentic

An ML ops agent uses Jentic to run training jobs on demand without learning ARM. The agent searches Jentic for 'submit a BatchAI training job', loads the Jobs_Create schema, and executes with structured input. Jentic mints AAD tokens for management.azure.com so the agent never holds the underlying client secret.

Example prompt: Use Jentic search 'submit a BatchAI training job', load Jobs_Create, and execute with cluster ID, job script, and input directories

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| PUT | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/clusters/{clusterName} | Create a GPU cluster |
| PUT | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/experiments/{experimentName}/jobs/{jobName} | Create a training job under an experiment |
| POST | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/experiments/{experimentName}/jobs/{jobName}/terminate | Terminate a running job |
| POST | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/experiments/{experimentName}/jobs/{jobName}/listOutputFiles | List the output files for a completed job |
| PUT | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/fileServers/{fileServerName} | Create a file server in a workspace |
| PATCH | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/clusters/{clusterName} | Update a cluster, including resizing nodes |

## Key resources

- **Workspaces** — Top-level container for clusters, experiments, and file servers - supports list, get, create, update, delete.
- **Clusters** — GPU-backed compute clusters with create, get, update, delete and remote login listing.
- **Experiments** — Group jobs together for tracking - supports list, get, create, delete.
- **Jobs** — Training job execution under an experiment - supports list, get, create, delete, terminate, output file listing, and remote login information.
- **FileServers** — NFS file servers mounted into clusters - supports list, get, create, delete.
- **Operations / Usages** — Resource provider metadata and per-region quota usage.

## Why Jentic

- **Setup:** Wiring the BatchAI API by hand means setting up Azure AD OAuth2 against management.azure.com, handling long-running-operation polling for cluster and job provisioning, and threading workspace, experiment, and job ids through every Microsoft.BatchAI path yourself. Through Jentic you install once, import BatchAI from the API Directory, store the Azure AD credential once, and your agent calls it.
- **Permission scoping:** This API puts the workspace, cluster, experiment, and job ids in the URL path (/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/experiments/{experimentName}/jobs/{jobName}), so a rule can pin your agent to one workspace and its jobs. You choose the operations it may call, so destructive ones like terminating a job or deleting a cluster are not included unless you add them.
- **Credential handling:** Your Azure AD credential is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'submit a BatchAI training job' or 'create a training cluster', and Jentic returns the matching Jobs or Clusters operation with its input schema so the agent calls the right ARM path without browsing the Microsoft.BatchAI reference.

## Related APIs

- **Azure Machine Learning Compute Management** — The successor service for ML training compute, replacing BatchAI in most new Azure ML projects.
- **Azure Batch Management** — General-purpose Azure Batch for parallel compute, broader than the BatchAI ML focus.
- **Azure Storage Management** — Provisions blob storage that BatchAI clusters mount for training data.

## FAQ

### Why is there no official OpenAPI spec for BatchAI?

Microsoft Azure does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call BatchAI via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the BatchAI API use?

The API uses Azure Active Directory OAuth 2.0 declared as azure_auth with the implicit flow. Tokens are presented as Bearer headers against management.azure.com. Through Jentic, the AAD client secret stays in the vault and only scoped, short-lived tokens are used by the agent.

### Can I terminate a running training job with this API?

Yes. Call POST on /workspaces/{workspaceName}/experiments/{experimentName}/jobs/{jobName}/terminate (operationId Jobs_Terminate). The job stops and any output files written so far remain available via Jobs_ListOutputFiles.

### What are the rate limits for the BatchAI API?

Azure Resource Manager applies subscription-level throttling, typically 12,000 read and 1,200 write requests per hour, surfaced via x-ms-ratelimit-remaining headers. BatchAI also has GPU vCPU quotas per region returned via Usages_List.

### How do I submit a training job through Jentic?

Run pip install jentic, then use the async client to search 'submit a BatchAI training job', load Jobs_Create, and execute with the workspace name, experiment name, job name, cluster ID, container settings, and input directories. Jentic returns the job resource so you can poll its state.

### Is BatchAI still the recommended Azure ML training service?

BatchAI is the legacy GPU training service for Azure; Microsoft has migrated most users to Azure Machine Learning compute. The API remains usable for existing workspaces, but new projects should evaluate Azure Machine Learning instead.

### Can I limit what my agent is allowed to do with the Microsoft Azure BatchAI API?

Yes. Because you run Jentic One yourself, your own rules decide which BatchAI operations and credentials the agent may use. Since this API carries the workspace, cluster, experiment, and job ids in the URL path, you can pin the agent to a single workspace and its jobs. You also pick exactly which operations it can call, so destructive ones such as Jobs_Terminate or deleting a cluster stay out of reach unless you explicitly add them.
