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

# Microsoft Azure HyperDrive

Jentic publishes the only available OpenAPI specification for HyperDrive, keeping it validated and agent-ready. HyperDrive is the Azure Machine Learning hyperparameter tuning service that submits and tracks parallel training runs against an ARM-scoped workspace. The API exposes two operations under /hyperdrive/v1.0/{armScope}/runs to launch a new tuning experiment and to cancel an in-flight run by runId.

## For AI agents

Submit and cancel Azure Machine Learning HyperDrive hyperparameter tuning runs against an ARM-scoped AML workspace.

## Scope

Does not handle workspace creation, compute target provisioning, or model deployment - use for HyperDrive run submission and cancellation only.

## Capabilities

- Submit a new HyperDrive hyperparameter tuning run scoped to an Azure Machine Learning workspace
- Cancel an active HyperDrive run by its runId before it completes
- Pass workspace and resource group context through the {armScope} path parameter
- Authenticate calls with the Azure AD user_impersonation scope used across AML
- Drive parallel training sweeps from agents or pipelines without the AML Python SDK

## Use cases

### Hyperparameter Sweep from CI

Kick off Azure Machine Learning HyperDrive runs from a CI/CD pipeline by POSTing the run definition to /hyperdrive/v1.0/{armScope}/runs with the workspace ARM scope. This lets ML teams launch tuning experiments on every model change without depending on the AML Python SDK in the build agent. Sweeps then run on the workspace's compute target and report results back into AML.

Example prompt: POST a HyperDrive run definition with a random sampling space over learning_rate and batch_size to /hyperdrive/v1.0/{armScope}/runs and return the runId.

### Cancel Stuck Tuning Runs

Free expensive GPU compute by cancelling HyperDrive runs that exceed their time budget. The API accepts a POST to /hyperdrive/v1.0/{armScope}/runs/{runId}/cancel and stops the parent run plus its child trials. This is the operational lever for ML platform teams whose users frequently mis-configure search spaces.

Example prompt: Call cancel on runId 'HD_abc123' under the workspace armScope and confirm a 200 response.

### Cost-Aware Tuning Orchestration

Build a thin orchestrator that submits a HyperDrive sweep, monitors total elapsed time outside of HyperDrive, and cancels the run once a cost ceiling is reached. Because the API exposes only submit and cancel, an external scheduler enforces the budget and the workspace handles compute. Setup is roughly half a day per orchestrator.

Example prompt: Submit a HyperDrive run, wait 60 minutes, then cancel the runId if it is still active.

### Agent-Triggered Model Tuning via Jentic

An AI agent can launch and stop HyperDrive runs through Jentic without touching Azure AD tokens directly. The agent searches Jentic for 'submit a hyperparameter tuning run', loads the submit-run schema, and executes with the workspace ARM scope and run definition. Jentic's your Jentic One instance holds the OAuth client secret and supplies a scoped bearer token per call.

Example prompt: Use the Jentic MCP tool azure_hyperdrive_submit_run to start a tuning experiment in workspace 'aml-prod' and return the runId.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /hyperdrive/v1.0/{armScope}/runs | Submit a new HyperDrive hyperparameter tuning run |
| POST | /hyperdrive/v1.0/{armScope}/runs/{runId}/cancel | Cancel an active HyperDrive run by runId |

## Key resources

- **Runs** — HyperDrive parent runs containing the hyperparameter search space and its child trials
- **RunCancellation** — Operation to terminate an active run and its trials by runId

## Why Jentic

- **Setup:** Wiring HyperDrive by hand means registering an Azure AD app, obtaining OAuth 2.0 bearer tokens, and constructing the correct ARM scope for every run you submit. Through Jentic you install once, import HyperDrive from the API Directory, store the Azure AD credential once, and your agent calls it.
- **Permission scoping:** HyperDrive puts the run id in the URL path (/hyperdrive/v1.0/{armScope}/runs/{runId}/...), so a rule can pin your agent to run submission for a given scope: it can submit tuning runs and read them. You choose the operations it may call, so cancelling a run is not included unless you add it.
- **Credential handling:** Your Azure AD credential for HyperDrive 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 hyperparameter tuning run' or 'cancel a HyperDrive run', and Jentic returns the matching HyperDrive operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Azure IoT Hub** — IoT Hub feeds device telemetry that AML and HyperDrive can train and tune models against.
- **Azure Key Vault** — Key Vault stores datastore secrets that HyperDrive runs need to access training data.
- **Azure HybridData Management** — HybridData moves on-premises data into Azure storage that an AML workspace then trains on.

## FAQ

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

Microsoft Azure does not publish an OpenAPI specification for the HyperDrive REST surface. Jentic generates and maintains this spec so that AI agents and developers can call HyperDrive 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 HyperDrive API use?

It uses Azure Active Directory OAuth 2.0 with the user_impersonation scope, the same auth used across Azure Machine Learning. Through Jentic the AAD client secret is held in the your Jentic One instance and a scoped bearer token is injected into each call so the agent never sees the raw secret.

### Can I cancel a HyperDrive run mid-flight?

Yes. POST to /hyperdrive/v1.0/{armScope}/runs/{runId}/cancel with the workspace ARM scope and the runId returned from the submit call. The cancel terminates the parent run and all of its child trials.

### What are the rate limits for HyperDrive?

HyperDrive does not publish dedicated limits - it inherits the throughput of the Azure Machine Learning workspace and the underlying compute target. Practical concurrency is capped by the max_concurrent_runs you set in the run definition and by the workspace's compute quota.

### How do I submit a tuning run through Jentic?

Run pip install jentic, then search Jentic with 'submit a hyperparameter tuning run', load the submit-run operation, and execute with the workspace armScope and a run definition that includes the sampling method and parameter space. Jentic returns the runId for tracking.

### Does HyperDrive replace the Azure ML Python SDK?

No - it complements it. The REST API is useful when you cannot run the AML SDK in your environment (for example, lightweight CI jobs or agents) and need only to submit or cancel runs. For richer experiment tracking, metrics, and model registry, continue using the AML SDK or the AML control-plane APIs.

### Can I limit what my agent is allowed to do with the HyperDrive API?

Yes. Because you run Jentic One yourself, you decide which HyperDrive operations your agent may call, and your own rules govern which credentials it uses. Since HyperDrive puts the run id in the URL path, you can pin an agent to submitting and reading tuning runs for a given ARM scope while withholding the cancel operation on /hyperdrive/v1.0/{armScope}/runs/{runId}/cancel until you explicitly add it. The stored Azure AD credential is injected at execution time and never reaches the agent's prompt or logs.
