> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.ollang.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an AI Dubbing QC Run

> Start a paid, asynchronous AI Dubbing QC report for an eligible AI Dubbing order

Starts a manual, report-only AI Dubbing QC run. The request is asynchronous: HTTP `202` acknowledges the run; poll its returned `id` for a terminal status. This endpoint does not change the order or edit its media.

## Authorization

Send the integration API key in `x-api-key`. The order must belong to the client identified by the key.

## Path parameters

**orderId** `string` *required*

ID of the AI Dubbing order.

## Request body

The body accepts exactly one field, `requestId`, a UUID. Unknown fields are rejected. The order decides the scope; a request cannot choose the scope, the checked files or the cost.

**requestId** `string` *required*

UUID idempotency key. Generate a new UUID for a deliberate new run. Retry an uncertain request with the **same UUID**; do not create a new key because the response was lost or timed out. The same key returns the existing request/run rather than charging twice.

```bash theme={null}
curl -X POST "https://api-integration.ollang.com/integration/orders/507f1f77bcf86cd799439011/av-qc" \
  -H "x-api-key: $OLLANG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"requestId":"550e8400-e29b-41d4-a716-446655440000"}'
```

The charge is the exact positive AI-credit amount from the unique qualifying AI-credit basket item on the order's original paid checkout. Current pricing is not recomputed. Missing or ambiguous historical billing data fails closed; insufficient credits or the monthly limit blocks a new run. Infrastructure outcomes may be `partial`, `failed`, or `blocked` and are refunded at most once; a completed quality failure remains charged.

## Accepted response

HTTP `202` returns the run resource, including `id`, `status`, `chargeAmount` (AI credits), immutable `scope`, `artifactFingerprint`, and `checkedArtifacts`. Use the returned `id` with the [history](https://api-docs.ollang.com/apis/ollang-api-reference/get-av-qc-history.md), [detail](https://api-docs.ollang.com/apis/ollang-api-reference/get-av-qc-run.md), and [export](https://api-docs.ollang.com/apis/ollang-api-reference/export-av-qc-run.md) endpoints. A server response may be unavailable after acceptance; retry the POST with the same `requestId` or look up the run through history. History does not expose `requestId`.

```json theme={null}
{
  "id": "507f1f77bcf86cd799439012",
  "orderId": "507f1f77bcf86cd799439011",
  "status": "queued",
  "createdAt": "2025-02-03T12:00:00.000Z",
  "chargeAmount": 1800,
  "scope": {
    "modules": { "dubbing": true, "lip_sync": false, "visual_translation": false },
    "sourceLanguage": "en",
    "targetLanguage": "fr",
    "lipSyncMode": "disabled",
    "lipSyncRanges": []
  },
  "artifactFingerprint": "sha256-fingerprint",
  "checkedArtifacts": [],
  "outdated": false
}
```

### Poll a run

Poll only while processing is `queued` or `running`. Treat terminal `partial` as incomplete infrastructure coverage, not as `completed`; a quality verdict is stored in the report and is independent of processing status.

```bash theme={null}
order_id="507f1f77bcf86cd799439011"
request_id="550e8400-e29b-41d4-a716-446655440000"
api="https://api-integration.ollang.com/integration/orders/$order_id/av-qc"

accepted=$(curl --fail-with-body -sS -X POST "$api" \
  -H "x-api-key: $OLLANG_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"requestId\":\"$request_id\"}")
run_id=$(printf '%s' "$accepted" | jq -r '.id')
status=$(printf '%s' "$accepted" | jq -r '.status')

while [[ "$status" == "queued" || "$status" == "running" ]]; do
  sleep 5
  run=$(curl --fail-with-body -sS "$api/$run_id" -H "x-api-key: $OLLANG_API_KEY")
  status=$(printf '%s' "$run" | jq -r '.status')
done

case "$status" in
  completed) echo "Run completed; inspect report.verdict separately." ;;
  partial) echo "Run is partial; do not treat it as a complete assessment." ;;
  failed|blocked) echo "Run ended with status: $status" ;;
  *) echo "Unexpected terminal status: $status"; exit 1 ;;
esac
```

AI Dubbing QC is available for completed AI Dubbing orders that were paid with AI credits. Audio Description orders are not eligible. A video can be up to 240 minutes long and up to 2 GiB per file; a longer or larger order is reported as not eligible. Orders with visual translation are checked on their final video, and their translated on-screen text is checked as a separate section of the report. Orders with LipSync on only some segments are checked without scoring lip-sync accuracy. LipSync on every segment is scored within the dubbing sync dimension. Creating a run requires the `client_owner` or `client_createOrder` role on the API key's user.

A run that cannot start returns `409` with the same reasons the pricing endpoint reports (for example `insufficient_ai_credits` or `monthly_ai_credit_limit_exceeded`), or one of:

| `message` | What to do |
| - | - |
| `An AV QC run is already active for this order` | Wait for the active run to finish; one run per order runs at a time. |
| `AV QC creation encountered a concurrent update; retry with the same requestId` | Retry with the same `requestId`. It never charges twice. |

An unknown or inaccessible order returns `404`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.