Skip to content

AI_APICallError - base64 encoded image pasted #4983

Closed

Description

@paka63

Description

After pasting an image into the chat which was encoded to base64, the original image was transferred to Anthropic Claude, but was being included in subsequent messages causing an AI_APICallError. Either we need to save the image locally and transmit a temporary path or use the path of the original file rather than encoding it in the message chat. Also, Opencode froze afterwards with no error messages or response so we are not handling the error gracefully.

OpenCode version

1.0.126

Steps to reproduce

  1. Select an image
  2. Clipboard copy image
  3. Paste image in opencode chat
  4. Continue to interact with model until it no longer continues.

Screenshot and/or share link

No response

Operating System

Ubuntu 25.04

Terminal

GNOME Terminal

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Dec 2, 2025
  2. github-actions commented on Dec 2, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    The key issues are:

    1. Image pasting/handling may not be properly managed across subsequent messages
    2. Content with certain data types (like base64 images) might cause props.input.content validation failures
    3. Error handling and graceful failure when API calls fail with image data needs improvement

    Feel free to ignore if none of these address your specific case.

  3. self-assigned this
    on Dec 2, 2025
  4. removed
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Dec 2, 2025
  5. rekram1-node commented on Dec 2, 2025

    @rekram1-node
    Contributor

    ill check it out

  6. cvakiitho commented on Jan 15, 2026

    @cvakiitho

    I think I have a similar issue, where thought chain just completely stops with 0 issues displayed in export/logs. BTW is there another option to pass images then base64?

  7. github-actions commented on Mar 26, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions