# Deploy a production-ready artifact

> Deploy a production-ready artifact - Deploy a containerized AI service via the Workload API and link
> it to a DataRobot Deployment for governance.

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-05-06T18:17:09.611067+00:00` (UTC).

## Primary page

- [Deploy a production-ready artifact](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/tutorials/tutorial-production.html): Full documentation for this topic (HTML).

## Sections on this page

- [What you'll deploy](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/tutorials/tutorial-production.html#what-were-deploying): In-page section heading.
- [Workflow overview](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/tutorials/tutorial-production.html#workflow-overview): In-page section heading.
- [API base URLs](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/tutorials/tutorial-production.html#api-base-urls): In-page section heading.
- [Step 1: Create a workload](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/tutorials/tutorial-production.html#step-1-create-workload): In-page section heading.
- [Step 2: Monitor status](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/tutorials/tutorial-production.html#step-2-monitor-status): In-page section heading.
- [Step 3: Test the workload](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/tutorials/tutorial-production.html#step-3-test-workload): In-page section heading.
- [Step 4: Create a deployment](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/tutorials/tutorial-production.html#step-4-create-deployment): In-page section heading.
- [Step 5: Invoke via deployment endpoint](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/tutorials/tutorial-production.html#step-5-invoke-via-deployment): In-page section heading.

## Related documentation

- [Developer documentation](https://docs.datarobot.com/en/docs/api/index.html): Linked from this page.

## Documentation content

This tutorial walks you through deploying a containerized AI service via the Workload API and linking it to a DataRobot Deployment for governance.

## What you'll deploy

This tutorial deploys a FastAPI-based agent service that provides:

- OpenAI-compatible/chat/completions —Proxies requests to a DataRobot-deployed LLM.
- LangGraph/agentendpoint —A ReAct agent with arXiv search for research queries.
- Health endpoints — /healthz (liveness), /readyz (readiness), /health (detailed status).
- OpenTelemetry logging —Structured logs exported via OTLP for observability.

## Workflow overview

1. Create a workload → Returns workloadId and artifactId
2. Monitor status → Use workloadId to poll until running
3. Test the workload → Invoke endpoints using workloadId
4. Create a deployment → Pass workloadId , returns deploymentId

## API base URLs

| API group | Base path |
| --- | --- |
| Workloads | /api/v2/console/workloads/ |
| Deployments | /api/v2/console/deployments/ |
| Workload invoke | /api/v2/endpoints/workloads/{workloadId}/ |
| Deployment invoke | /api/v2/endpoints/deployments/{deploymentId}/ |

## Step 1: Create a workload

Deploy your container by calling the Workload API. This creates a registered artifact and schedules the container on Kubernetes.

```
curl -X POST "${DATAROBOT_ENDPOINT}/console/workloads/" \
  -H "Authorization: Bearer ${DATAROBOT_API_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "agent-service",
    "artifact": {
      "name": "agent-service-artifact",
      "status": "registered",
      "spec": {
        "containerGroups": [{
          "containers": [{
            "imageUri": "<your-registry>/agent-service:1.0.0",
            "port": 8080,
            "primary": true,
            "entrypoint": ["python", "server.py"],
            "resourceRequest": {"cpu": 1, "memory": 536870912},
            "environmentVars": [
              {"name": "MODEL", "value": "openai/gpt-oss-20b"},
              {"name": "DEPLOYMENT_ID", "value": "<your-llm-deployment-id>"}
            ],
            "readinessProbe": {"path": "/readyz", "port": 8080}
          }]
        }]
      }
    },
    "runtime": {"replicaCount": 1}
  }'
```

## Step 2: Monitor status

Poll until status transitions to running:

```
curl -s "${DATAROBOT_ENDPOINT}/console/workloads/${WORKLOAD_ID}" \
  -H "Authorization: Bearer ${DATAROBOT_API_TOKEN}" | jq '.status'
```

## Step 3: Test the workload

Once running, test the endpoints:

Chat completions:

```
curl -X POST "${DATAROBOT_ENDPOINT}/endpoints/workloads/${WORKLOAD_ID}/chat/completions" \
  -H "Authorization: Bearer ${DATAROBOT_API_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{"model": "openai/gpt-oss-20b", "messages": [{"role": "user", "content": "Hello!"}]}'
```

## Step 4: Create a deployment

Link the workload to a Deployment for monitoring, sharing, and audit trails:

```
curl -X POST "${DATAROBOT_ENDPOINT}/console/deployments/" \
  -H "Authorization: Bearer ${DATAROBOT_API_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "workloadId": "'${WORKLOAD_ID}'",
    "name": "agent-service-deployment",
    "importance": "moderate"
  }'
```

## Step 5: Invoke via deployment endpoint

After creating the deployment, invoke your service through the governed deployment endpoint:

```
curl -X POST "${DATAROBOT_ENDPOINT}/endpoints/deployments/${DEPLOYMENT_ID}/chat/completions" \
  -H "Authorization: Bearer ${DATAROBOT_API_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{"model": "openai/gpt-oss-20b", "messages": [{"role": "user", "content": "Hello!"}]}'
```
