Skip to content

Expected a base64-encoded data URL with an image MIME type #16605

Open

Description

@johnthompson-pco

Suddenly started getting this error.
{ "type": "error", "error": { "type": "invalid_request_error", "code": "invalid_value", "message": "Invalid 'input[107].content[2].image_url'. Expected a base64-encoded data URL with an image MIME type (e.g. 'data:image/png;base64,aW1nIGJ5dGVzIGhlcmU='), but got empty base64-encoded bytes.", "param": "input[107].content[2].image_url" }, "status": 400 }

Prompt had an image.png attached (see attached) - a screenshot as usual.
Tried same prompt without image.png attached, same error.
Exit Codex and restart.
Same prompt (no image), same error.

Image

Activity

  1. added
    bugSomething isn't working
    CLIIssues related to the Codex CLI
    tool-callsIssues related to tool calling
    on Apr 2, 2026
  2. github-actions commented on Apr 2, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. johnthompson-pco commented on Apr 2, 2026

    @johnthompson-pco
    Author

    not a duplicate... it seems 🤷‍♂️
    Codex 26.325.1654
    GPT 5.4 Extra High, local
    Subscription Business

  4. johnthompson-pco commented on Apr 2, 2026

    @johnthompson-pco
    Author

    Win11
    Intel

  5. etraut-openai commented on Apr 2, 2026

    @etraut-openai
    Contributor

    To confirm, are you using the Codex app?

    If you're able to repro, please use /feedback to upload your logs and session details, then post the thread ID here.

  6. Csiklaoliver commented on Apr 3, 2026

    @Csiklaoliver

    Hi! I'm getting the same issues here as well. Is there any way I could fix it?

  7. dermotos commented on Apr 4, 2026

    @dermotos

    Also getting it after pasting an image from the clipboard synced from my phone (iPhone, HEIC encoded file was copied). Cannot continue the thread

  8. Csiklaoliver commented on Apr 4, 2026

    @Csiklaoliver

    Same issue for me. I pasted form my clipboard and it stopped working.

  9. AlexanderDeutsch commented on Apr 8, 2026

    @AlexanderDeutsch

    I was able to reproduce this bug. The trigger is copy/pasting content from a CSV editor like excel. It completely bricks the instance.

  10. hqhq1025 commented on Apr 12, 2026

    @hqhq1025

    If you're on macOS and hitting clipboard image issues, clipaste may help. It normalizes the screenshot clipboard to include proper PNG data + file URL, which fixes format mismatches that cause "Expected a base64-encoded data URL" errors.

    brew install hqhq1025/clipaste/clipaste
    brew services start clipaste
  11. irfanlai commented on Apr 15, 2026

    @irfanlai

    Is there a fix for this issue? I am experiencing this issue on one of my project on Codex. I am kind of block. I cant even summarize and create another project with my existing project

  12. jeevjyot commented on Apr 20, 2026

    @jeevjyot

    same issue for me. tried adding from the app, copy paste, drag and drop. just doesnt work.

    as a workaround, I generated based64 of the image and pasted that.
    base64 -I image.png

  13. daftu commented on Apr 20, 2026

    @daftu

    Same here, it used to work in the past (copying screenshot from phone and pasting to Codex).

  14. DB-200 commented on Apr 23, 2026

    @DB-200

    Same issue!

  15. svendvd commented on Apr 23, 2026

    @svendvd

    Same issue, fixed it with a restart and let codex in a new context fix the old brocken context.

  16. chanwooyang1 commented on Apr 25, 2026

    @chanwooyang1

    @etraut-openai
    I can reproduce what looks like the same issue in Codex App on macOS with a spreadsheet paste flow.

    Environment:

    • Codex App version: 26.422.30944 (build 2080)
    • macOS version: 26.3.1 (a), build 25D771280a
    • Numbers version: 14.4 (7043.0.93)

    Steps:

    1. Open an .xlsx file in Numbers.
    2. Select and copy a non-empty spreadsheet row.
    3. Paste it into the Codex App composer.
    4. Submit the message.

    Actual behavior:
    The copied row appears to be treated as an image/PNG attachment instead of text/table data, and the request fails with:

    { "type": "error", "error": { "type": "invalid_request_error", "code": "invalid_value", "message": "Invalid 'input[0].content[2].image_url'. Expected a base64-encoded data URL with an image MIME type (e.g. 'data:image/png;base64,aW1nIGJ5dGVzIGhlcmU='), but got empty base64-encoded bytes.", "param": "input[0].content[2].image_url" }, "status": 400 }

    Expected behavior:
    For spreadsheet cell/range paste, Codex App should prefer the clipboard's text/table representation over image-like representations. A copied Numbers row has useful text/TSV clipboard data, so pasting it into the composer should insert the cell values rather than attach an image. If an image representation is used, empty image payloads should be rejected before sending.

    I uploaded diagnostics via /feedback for thread ID: 019dbfc1-90bd-7910-9ea6-fcc2590f14d7.

    Additional impact: after the initial failed paste, the affected thread continues to fail even when I send a new plain-text message without pasting anything. The later request fails with the same error at a previous history item, e.g. input[590].content[2].image_url, which makes the thread effectively unusable until the malformed empty image item is removed or the thread is rolled back.

  17. niodamian commented on May 4, 2026

    @niodamian

    Open a new a chat ~ give codex the session ID and tell him to remove the broken image ~ this happens cause your image is broken restart and you doine :)

    You dont need to restard codex ~ afte codex gives you the ok ~ ARCHIEVE THE CHAT and restore it will do the trick

  18. Honazhu commented on May 11, 2026

    @Honazhu

    same issue, typically occur when copy and pasta a excel or photo directly into the chat box (and the entire chat cannot proceed afterwards), however, if adding the pictures as documents it works, so I guess it is some compatibility issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtool-callsIssues related to tool calling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions