Skip to content

responses.create input types are not Responses API content parts #13

Closed

Description

@theQuert

ResponseInputItem.content is typed as ResponseInputTextContent (type: "text") or ResponseInputImageContent (type: "image" with an Anthropic-style source). Neither is a Responses API content part. The spec uses:

  • {"type": "input_text", "text": ...}
  • {"type": "input_image", "image_url": ..., "detail": ...} or {"type": "input_image", "file_id": ...}
  • {"type": "input_file", "file_id" | "file_data" | "file_url", "filename": ...}

A type-checked caller who follows the Responses API docs gets a type error. A caller who follows the SDK types sends parts that OpenAI rejects.

Fix: add ResponseInputText, ResponseInputImage and ResponseInputFile TypedDicts, and accept them in ResponseInputItem.content. Keep the old two in the union, so existing code still type-checks. Parts are sent unchanged either way.

Note: the gateway currently passes these parts through to OpenAI channels, but drops them when it converts a request for other providers. That is tracked separately, on the gateway side.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Uy5vXsRpMhug7v3XwTMZHv

Activity

  1. theQuert commented on Oct 7, 2026

    @theQuert
    MemberAuthor

    Fixed by #16.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions