---
title: "Fetch completed AI job results"
method: GET
path: "/ai-jobs/{jobId}/results"
tags: ["AI Jobs"]
---

# Fetch completed AI job results

`GET /ai-jobs/{jobId}/results`

## Request

- Base URL: `https://www.cloudworldmodel.ai/api`
- URL: `https://www.cloudworldmodel.ai/api/ai-jobs/{jobId}/results`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-PAYMENT`
  - API key in header `PAYMENT-SIGNATURE`

Retrieves the full AI output for a completed job. Returns HTTP 400 if
the job is not yet completed. Call `GET /ai-jobs/{jobId}` first to
confirm `status === "completed"`.

Result shape varies by `jobType`:
- `explain` → `{ explanation: string }`
- `troubleshoot` → `{ guidance: string }`
- `analyze_bottlenecks` → `{ analysis: string, doRecommendation: object|null }`
- `optimize` → `{ suggestions: string[] }`

**Authentication:** Requires an API key (`read` scope) or an x402
micro-payment (3 credits — $0.0030 USDC on Base). Pass
`Authorization: Bearer <key>` for API key access, or include a signed
x402 payment header with call type `ai.results` (no account required).
x402 callers that paid to create the job carry a wallet-session JWT that
is accepted here without a second payment round-trip.
Use `GET /api/billing/x402/config` to discover the live price.

## Path parameters

- `jobId` string, required

## Response `200`

AI job results

- object
  - `explanation` string, nullable
  - `guidance` string, nullable
  - `analysis` string, nullable
  - `doRecommendation` object, nullable
    - `suggestedDropletSize` string, required: Recommended Droplet size slug (e.g. "s-2vcpu-4gb")
    - `estimatedHourlyRate` number, required: Hourly rate for the suggested Droplet size in USD
    - `estimatedMonthlyCost` number, required: Estimated monthly cost for all Droplets in USD
    - `currentHourlyCost` number, required: Current compute-tier hourly cost (compute resources only — see savingsBasis)
    - `estimatedHourlySavings` number, required: Estimated hourly savings vs current compute-tier cost
    - `estimatedMonthlySavings` number, required: Estimated monthly savings in USD
    - `savingsPercent` number, required: Savings as a percentage of the compute-tier baseline (0–70)
    - `savingsIsComputed` boolean, required: True when savings are derived from real cost data rather than a default estimate
    - `savingsBasis` 'compute-only', required: Indicates that savings are computed against compute-tier costs only; non-compute resources (managed DB, cache, load balancer) are excluded from the baseline
    - `reason` 'right-sizing' | 'migration' | 'scale-out', required: The primary recommendation category
    - `numDroplets` number, required: Suggested number of Droplets
    - `reversibilityTier` 'instant' | 'minutes' | 'hours' | 'days', required: How hard this recommendation is to reverse — cross-provider migrations classify as "days"
    - `reversibilityReason` string, required: Human-readable explanation of the dominant reversibility factor
    - `estimatedMinutesMin` number, required: Lower bound of estimated rollback time in minutes
    - `estimatedMinutesMax` number, required: Upper bound of estimated rollback time in minutes
    - `basis` 'rule_based', required: Always "rule_based" — reversibility is classified deterministically, not via LLM
  - `suggestions` string[], nullable
  - `recommendations` object[], nullable: Present only when the jobId belongs to an optimization job created via `POST /api/analysis/optimize` — the structured recommendation objects, in addition to the flattened `suggestions` strings.

## Other responses

- `400`: Invalid request data — structured field-level error
- `401`: Authentication required or invalid API key
- `402`: Payment required — the endpoint is metered and no API key was provided. The response body follows the [x402 v2 protocol](https://x402.org) and describes one or more USDC payment options that the caller can select before retrying the request. Base is always the first option and uses `X-PAYMENT`. When an `accepts` entry for Solana is present, it is an additional USDC-SPL option that uses `PAYMENT-SIGNATURE` and its `extra.feePayer` value. The server verifies either payment through the PayAI facilitator at `https://facilitator.payai.network`. The `PAYMENT-REQUIRED` response header carries this entire JSON body as a base64-encoded string for protocol-aware clients. Call `GET /api/billing/x402/config` to retrieve the current price table and wallet address and `paymentOptions` before constructing a payment.
- `403`: Insufficient permissions — the API key lacks the required scope
- `404`: Resource not found
- `500`: Internal server error

---

[API](https://skmtc.dev/cloudworldmodel/apis/cloud-world-model-agent-api.md) · [All operations](https://skmtc.dev/cloudworldmodel/apis/cloud-world-model-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cloudworldmodel/apis/cloud-world-model-agent-api/revisions/ecc3ad1ff07f?raw)
