openai/openai-python · error · ValueError

Expected a non-empty value for `skill_id` but received {skil

Error message

Expected a non-empty value for `skill_id` but received {skill_id!r}

What it means

Sync skill-version content download (GET /skills/{skill_id}/versions/{version}/content) validates skill_id first. Both path parameters are checked in order (skill_id before version), so this variant fires when skill_id is empty even if version is valid.

Source

Thrown at src/openai/resources/skills/versions/content.py:70

        extra_body: Body | None = None,
        timeout: float | httpx2.Timeout | None | NotGiven = not_given,
    ) -> _legacy_response.HttpxBinaryResponseContent:
        """
        Download a skill version zip bundle.

        Args:
          version: The skill version number.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        if not skill_id:
            raise ValueError(f"Expected a non-empty value for `skill_id` but received {skill_id!r}")
        if not version:
            raise ValueError(f"Expected a non-empty value for `version` but received {version!r}")
        extra_headers = {"Accept": "application/binary", **(extra_headers or {})}
        return self._get(
            path_template("/skills/{skill_id}/versions/{version}/content", skill_id=skill_id, version=version),
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                security={"bearer_auth": True},
            ),
            cast_to=_legacy_response.HttpxBinaryResponseContent,
        )


class AsyncContent(AsyncAPIResource):
    @cached_property

View on GitHub (pinned to 9917c6e28e)

Solutions

  1. Populate skill_id from a prior list/create call and retry
  2. Validate both path params before the call
  3. Check the manifest/config producing the empty value

Example fix

# before
data = client.skills.versions.content.retrieve("", "v3")

# after
data = client.skills.versions.content.retrieve("skill-abc123", "v3")
Defensive patterns

Strategy: validation

Validate before calling

if not (isinstance(skill_id, str) and skill_id.strip()):
    raise ValueError("skill_id is required")
if not (isinstance(version, str) and version.strip()):
    raise ValueError("version is required")
data = client.skills.versions.content.retrieve(skill_id, version)

Type guard

def is_valid_skill_version_ref(skill_id: object, version: object) -> bool:
    return (
        isinstance(skill_id, str) and bool(skill_id.strip())
        and isinstance(version, str) and bool(version.strip())
    )

Prevention

When it happens

Trigger: Calling client.skills.versions.content.retrieve(skill_id="", version="v3") — or with None skill_id — when downloading a specific version's binary bundle.

Common situations: Downloading versioned skill bundles in CI or packaging scripts where the skill ID comes from a manifest field that is blank; parameter ordering mistakes when both args are positional.

Related errors


AI-assisted analysis of openai/openai-python@9917c6e28e (2026-08-28). Data as JSON: /api/errors/d879f29cfc05d906. Report an issue: GitHub.