# Invoke a Workload

> Invoke a Workload - Use the Inference sub-tab to view copy-ready API example code for calling a
> deployed Workload.

This Markdown file sits beside the HTML page at the same path (with a `.md` suffix). It summarizes the topic and lists links for tools and LLM context.

Companion generated at `2026-06-22T16:50:38.252696+00:00` (UTC).

## Primary page

- [Invoke a Workload](https://docs.datarobot.com/en/docs/workload-api/operate-workloads/endpoints-ui/inference.html.md): Full documentation for this topic (Markdown sidecar).

## Sections on this page

- [Invoke URL pattern](https://docs.datarobot.com/en/docs/workload-api/operate-workloads/endpoints-ui/inference.html.md#invoke-url-pattern): In-page section heading.
- [Choose Python or cURL](https://docs.datarobot.com/en/docs/workload-api/operate-workloads/endpoints-ui/inference.html.md#choose-language): In-page section heading.
- [GET request example](https://docs.datarobot.com/en/docs/workload-api/operate-workloads/endpoints-ui/inference.html.md#get-request-example): In-page section heading.
- [POST request example](https://docs.datarobot.com/en/docs/workload-api/operate-workloads/endpoints-ui/inference.html.md#post-request-example): In-page section heading.
- [Invocation during replacements](https://docs.datarobot.com/en/docs/workload-api/operate-workloads/endpoints-ui/inference.html.md#invocation-during-replacements): In-page section heading.

## Related documentation

- [Workload API](https://docs.datarobot.com/en/docs/workload-api/index.html.md): Linked from this page.
- [Operate running Workloads](https://docs.datarobot.com/en/docs/workload-api/operate-workloads/index.html.md): Linked from this page.
- [Access Workload endpoints](https://docs.datarobot.com/en/docs/workload-api/operate-workloads/endpoints-ui/index.html.md): Linked from this page.
- [Replace and roll out](https://docs.datarobot.com/en/docs/workload-api/update-workloads/replace-artifact-rollouts.html.md): Linked from this page.

## Documentation content

The Endpoints > Inference sub-tab generates copy-ready API example code for invoking the Workload. Use it to start a quick test from your terminal or to bootstrap a client integration.

To open the Inference sub-tab, on the deployed Workload, click the Endpoints tab, then click Inference in the left navigation bar.

## Invoke URL pattern

Each Workload exposes a stable invoke URL keyed by Workload ID:

```
{base_url}/api/v2/endpoints/workloads/{workloadId}/
```

The URL is a base prefix. Append your application's path to reach specific endpoints (for example, `/chat/completions` or `/health`); requests are forwarded to the container with the same path and method.

The base URL also lives on the Workload payload (the `endpoint` field) and can be fetched programmatically with `GET /workloads/{workload_id}`.

## Choose Python or cURL

Toggle Language between Python and cURL to switch between example formats. Each generates a complete request snippet for the Workload's invoke URL.

## GET request example

The GET example shows the minimum request shape—the Workload's invoke URL plus a Bearer-token authorization header:

```
curl -X GET "{base_url}/api/v2/endpoints/workloads/{workloadId}/" \
    -H "Authorization: Bearer *****"
```

By default the bearer token is masked. To reveal the actual value before copying, toggle Show secrets in the upper-right corner.

## POST request example

The POST example adds the standard JSON content-type and accept headers, plus a placeholder for the request payload:

```
curl -X POST "{base_url}/api/v2/endpoints/workloads/{workloadId}/" \
    -H "Authorization: Bearer *****" \
    -H "Content-Type: application/json; charset=UTF-8" \
    -H "Accept: application/json" \
    --data '{ /* Add your request payload here */ }'
```

Replace the payload placeholder with the JSON body your application expects.

> [!TIP] Copy the example script
> Click the Copy script to clipboard button in the top right corner of the panel to copy the full example.

## Invocation during replacements

The Workload's invoke URL is stable across artifact replacements. During a replacement, the platform routes traffic between the active and candidate protons according to the configured rollout strategy without changing the URL. Callers don't need to know which proton serves their request. For the underlying strategies and timing controls, see [Replace and roll out](https://docs.datarobot.com/en/docs/workload-api/update-workloads/replace-artifact-rollouts.html.md).
