Azure OpenAI Batch file failing through API, but working fine through UI

Divyam Singal 0 Reputation points
2026-07-02T06:57:34.6966667+00:00

Hi,

I had created 2 batch files in Azure OpenAI, one through the API (batch ID: batch_74ae4acc-d865-4f5b-937c-7359bbcc0ad9) and the other through the Foundry's Batch UI (batch ID: batch_0b89170c-2e5d-4ffd-9a33-30bbeb0b531d). The input JSONL file for both batches was the same. After the batch was processed, the one through the API gave error, and the one through UI succeeded.

This is the code snippet for creation through API -

api_version = "2024-10-21"
client = AzureOpenAI(
        api_key=api_key,
        azure_endpoint=endpoint,
        api_version=api_version,
    )
    uploaded_file = client.files.create(file=payload_stream, purpose="batch")
    batch_job = client.batches.create(
        input_file_id=uploaded_file.id,
        endpoint="/v1/responses",
        completion_window="24h",
    )

The following is the error JSONL file -

{"custom_id": "6a43974b2b6353d52750bdaf", "response": {"request_id": "", "status_code": 404}, "error": {"code": null, "message": {"error": {"code": "404", "message": "Resource not found"}}}}

Please help me know what the issue could be.

Microsoft Foundry
Microsoft Foundry

A unified Azure platform for creating and managing AI models, agents, and applications with built‑in enterprise security, monitoring, and governance

0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.