Azure Openai Responses API - File Input Not Working

Gareth Jayne 35 Reputation points

Hi everyone

I'm trying to add files via the Azure Open AI responses API so my GPT5.1 model can answer questions about them. I'm using the instructions at the link below:

https://learn.microsoft.com/en-us/azure/foundry/openai/how-to/responses?tabs=rest#file-input

However, whether I use the inline base64 method or the file upload method I get the following response from the model:

I don’t see the PDF file or its contents attached yet.\n\nPlease either:\n- Upload the PDF file, or \n- Paste its text (or screenshots) here,\n\nand I’ll provide a concise summary.

I'm not sure why this is happening as the file is being added with no errors but for some reason the model doesn't seem to see it. Has anyone tried using this and if so have you come across the same issue?

Thanks in advance for your help.

  1. Anshika Varshney 13,405 Reputation points Microsoft External Staff Moderator

    Hi @Gareth Jayne

    If the file upload succeeds but the model responds that it cannot see the PDF, the issue is often related to how the file is being passed to the Responses API request.

    A few things to verify:

    1. Use the Responses API file input format

    After uploading the file and obtaining the file_id, include it in the input payload as documented for file inputs. Simply uploading the file is not enough—the file must also be referenced in the request sent to the model.

    1. Verify the file upload completed successfully

    Confirm that:

    • The file upload returned a valid file_id
    • The file status shows as available/processed before invoking the model
    • The PDF size is within the supported limits
    1. Confirm the model supports file inputs

    Not all model deployments support the same input modalities. Please verify that the deployed model supports PDF/file input with the Responses API.

    1. Double-check the API endpoint

    Make sure you're using the current /openai/v1/responses workflow described in the documentation and that the request format matches the file input examples.

    To help narrow this down, could you share:

    • The model/deployment name you're using
    • The file upload request (with sensitive values removed)
    • The Responses API request body referencing the file
    • The exact error or response you receive from the model

    Reference

    Note: I would avoid suggesting POST /openai/v1/chat/completions and the files array in the request body, as the question is specifically about the Responses API, which uses a different request format for file inputs.

    I Hope this helps. Do let me know if you have any further queries.

    Thankyou!

  2. Anshika Varshney 13,405 Reputation points Microsoft External Staff Moderator

    Hello @Gareth Jayne

    Did you get any chance to review the response.

    Thankyou!

  3. Gareth Jayne 35 Reputation points

    @Anshika Varshney thanks for your response. I've gone through everything and I can't see any reason why the responses API request can't see the file I'm uploading.

    The model I'm using is gpt-5.1.

    File Upload Request

    POST /openai/files?api-version=2024-10-21 HTTP/1.1
    Host: redacted.openai.azure.com
    api-key: 
    Content-Length: 368
    Content-Type: multipart/form-data; boundary=----WebKitFormBoundary
    ------WebKitFormBoundary
    Content-Disposition: form-data; name="file"; filename="/C:/Users/Documents/Test Docs/Test pdf.pdf"
    Content-Type: <Content-Type header here>
    (data)
    ------WebKitFormBoundary
    Content-Disposition: form-data; name="purpose"
    assistants
    ------WebKitFormBoundary
    

    Responses API Request

    {
     "model": "gpt-5.1",
     "input": [
     {
     "role": "user",
     "content": [
     {"type": "input_file", "file_id": "assistant-WaEzwHM8UKAbJgUaLwfRHr"},
     {"type": "input_text", "text": "Summarize this PDF."}
     ]
     }
     ]
     }
    

    Error

    "content": [
     {
     "type": "output_text",
     "annotations": [],
     "logprobs": [],
     "text": "I don’t see the PDF file or its text content attached yet.\n\nPlease either:\n- Upload the PDF file, or \n- Paste the text or key sections you want summarized\n\nOnce I have access to the content, I’ll provide a concise summary."
     }
     ]
    

    Thanks for your help with this issue, it's really appreciated.


Sign in to comment

1 answer

  1. AI answer

    The model response indicates that the PDF isn’t actually being passed into the model’s input content, even though the file upload itself succeeds. For the Responses API, files must be both uploaded correctly and referenced in the request in a way that vision-capable models can consume.

    Key points to verify:

    1. Use a vision-capable model
    • Only models that support both text and image inputs can accept PDF files as input.
    • Ensure the deployment is one of the vision-enabled models listed under the Responses API (for example, gpt-4o or other models explicitly documented as supporting image/PDF input).
    • If a non-vision model is used, the PDF will not be interpreted and the model will behave as if no file was attached.
    1. Respect PDF size and request limits
    • Each PDF must be under 50 MB.
    • The combined size of all files in a single request must also be under 50 MB.
    • If limits are exceeded, the file will not be processed even if upload appears successful.
    1. Use the correct purpose when uploading files
    • For PDF input with the Responses API, the file must be uploaded with purpose="assistants".
    • A purpose of user_data is currently not supported for PDFs; using user_data will prevent the file from being usable by the Responses API.
    1. Ensure the file is actually referenced in the Response request
    • For inline Base64: the PDF must be included in the request content as a base64 data URI so that the model receives both extracted text and rendered page images.
    • For uploaded files: the file ID returned from the Files API must be referenced in the Responses API request in the way shown in the documentation (for example, as a file input in the content/tool configuration). If the file is only uploaded but never referenced by ID in the Response creation call, the model will not see it.
    1. Combine file input with text
    • When using file inputs, include a text prompt in the same request (for example, “Summarize the attached PDF”). Some flows require that there is text content along with the file reference so the model has both the instruction and the file in a single call.
    1. Confirm the model supports PDFs (not just images)
    • PDF support is specifically called out for models with vision capabilities. If using a model or version that does not yet support PDF input, the file will be ignored.

    If all of the above are satisfied (vision-enabled model, purpose="assistants", size limits respected, file ID or base64 correctly embedded in the Response request, and a text instruction included), the model should receive both the extracted text and rendered images of each PDF page and be able to answer questions about the file instead of replying that it cannot see it.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.
Sign in to answer

Your answer