{"record":{"id":"74788808f1853125","repo":"conductor-oss/conductor","slug":"openai-video-api-submit-failed-with-status-d-s","errorCode":null,"errorMessage":"OpenAI Video API submit failed with status %d: %s","messagePattern":"OpenAI Video API submit failed with status (.+?): (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"ai/src/main/java/org/conductoross/conductor/ai/providers/openai/api/OpenAIVideoApi.java","lineNumber":114,"sourceCode":"                            ? params.inputReferenceMimeType()\n                            : \"image/jpeg\";\n            String ext = extensionForMimeType(mimeType);\n            RequestBody fileBody =\n                    RequestBody.create(params.inputReference(), MediaType.parse(mimeType));\n            bodyBuilder.addFormDataPart(\"input_reference\", \"input.\" + ext, fileBody);\n        }\n\n        Request request =\n                new Request.Builder()\n                        .url(baseUrl + \"/v1/videos\")\n                        .header(\"Authorization\", \"Bearer \" + apiKey)\n                        .post(bodyBuilder.build())\n                        .build();\n\n        try (Response response = httpClient.newCall(request).execute()) {\n            String responseBody = readResponseBody(response);\n            if (!response.isSuccessful()) {\n                throw new IOException(\n                        \"OpenAI Video API submit failed with status %d: %s\"\n                                .formatted(response.code(), responseBody));\n            }\n            return objectMapper.readValue(responseBody, VideoStatusResponse.class);\n        }\n    }\n\n    /**\n     * Poll the status of a video generation job.\n     *\n     * @param videoId The video job ID\n     * @return Current status including progress percentage\n     */\n    public VideoStatusResponse getVideoStatus(String videoId) throws IOException {\n        Request request =\n                new Request.Builder()\n                        .url(baseUrl + \"/v1/videos/\" + videoId)\n                        .header(\"Authorization\", \"Bearer \" + apiKey)","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/ai/src/main/java/org/conductoross/conductor/ai/providers/openai/api/OpenAIVideoApi.java#L96-L132","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Confirm the API key's organization has been granted Sora access (OpenAI returns 403 otherwise).","Match the multipart 'model' field to the exact Sora model id OpenAI expects.","Inspect the %s errorBody for the precise validation error (prompt length, size, seconds).","For 429, throttle submissions and retry with backoff."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if (StringUtils.isBlank(params.prompt())) {\n    throw new IllegalArgumentException(\"Video prompt is required\");\n}\nif (StringUtils.isBlank(params.model())) {\n    throw new IllegalArgumentException(\"Video model is required\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    VideoStatusResponse resp = videoApi.submitVideoJob(params);\n} catch (IOException e) {\n    if (e.getMessage().contains(\"status 429\")) {\n        // back off and resubmit\n    } else if (e.getMessage().contains(\"status 403\")) {\n        // Sora access not granted - terminal\n        throw e;\n    } else {\n        throw e;\n    }\n}","preventionTips":["Confirm the API key's org has Sora access before relying on video tasks.","Validate prompt and model fields before submission.","Throttle concurrent video submissions to avoid 429.","Inspect the errorBody for OpenAI's specific validation message."],"tags":["openai","video","sora","http","async","api-key"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}