conductor-oss/conductor · error · IOException

OpenAI Video API submit failed with status %d: %s

Error message

OpenAI Video API submit failed with status %d: %s

What it means

Thrown by OpenAIVideoApi.submitVideoJob when POST /v1/videos (Sora) returns non-2xx. IOException carries the status code and the full response body string for diagnosis. This is the initial asynchronous job submission, not the download.

Source

Thrown at ai/src/main/java/org/conductoross/conductor/ai/providers/openai/api/OpenAIVideoApi.java:114

                            ? params.inputReferenceMimeType()
                            : "image/jpeg";
            String ext = extensionForMimeType(mimeType);
            RequestBody fileBody =
                    RequestBody.create(params.inputReference(), MediaType.parse(mimeType));
            bodyBuilder.addFormDataPart("input_reference", "input." + ext, fileBody);
        }

        Request request =
                new Request.Builder()
                        .url(baseUrl + "/v1/videos")
                        .header("Authorization", "Bearer " + apiKey)
                        .post(bodyBuilder.build())
                        .build();

        try (Response response = httpClient.newCall(request).execute()) {
            String responseBody = readResponseBody(response);
            if (!response.isSuccessful()) {
                throw new IOException(
                        "OpenAI Video API submit failed with status %d: %s"
                                .formatted(response.code(), responseBody));
            }
            return objectMapper.readValue(responseBody, VideoStatusResponse.class);
        }
    }

    /**
     * Poll the status of a video generation job.
     *
     * @param videoId The video job ID
     * @return Current status including progress percentage
     */
    public VideoStatusResponse getVideoStatus(String videoId) throws IOException {
        Request request =
                new Request.Builder()
                        .url(baseUrl + "/v1/videos/" + videoId)
                        .header("Authorization", "Bearer " + apiKey)

View on GitHub (pinned to cf7c3e4a8a)

Solutions

  1. Confirm the API key's organization has been granted Sora access (OpenAI returns 403 otherwise).
  2. Match the multipart 'model' field to the exact Sora model id OpenAI expects.
  3. Inspect the %s errorBody for the precise validation error (prompt length, size, seconds).
  4. For 429, throttle submissions and retry with backoff.
Defensive patterns

Strategy: retry

Validate before calling

if (StringUtils.isBlank(params.prompt())) {
    throw new IllegalArgumentException("Video prompt is required");
}
if (StringUtils.isBlank(params.model())) {
    throw new IllegalArgumentException("Video model is required");
}

Try / catch

try {
    VideoStatusResponse resp = videoApi.submitVideoJob(params);
} catch (IOException e) {
    if (e.getMessage().contains("status 429")) {
        // back off and resubmit
    } else if (e.getMessage().contains("status 403")) {
        // Sora access not granted - terminal
        throw e;
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Submitting with an invalid/missing API key (401), an account without Sora access enabled (403), an unsupported model value in the multipart 'model' field (400), an over-length or empty prompt (400), or rate limiting (429).

Common situations: Sora being in limited access so the key lacks permission (403), passing 'sora' vs 'sora-2' model naming mismatch, uploading an input_reference image with the wrong MIME type, or a baseUrl not pointing at the OpenAI host.

Related errors


AI-assisted analysis of conductor-oss/conductor@cf7c3e4a8a (2026-08-14). Data as JSON: /api/errors/74788808f1853125. Report an issue: GitHub.