Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/openrouter/video_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ def get_video_content(
request_has_path_params=True,
request_has_query_params=True,
user_agent_header="user-agent",
accept_header_value="application/octet-stream",
accept_header_value="application/octet-stream, video/mp4",
http_headers=http_headers,
_globals=operations.ListVideosContentGlobals(
http_referer=self.sdk_configuration.globals.http_referer,
Expand Down Expand Up @@ -769,6 +769,8 @@ def get_video_content(
response_data: Any = None
if utils.match_response(http_res, "200", "application/octet-stream"):
return http_res
if utils.match_response(http_res, "200", "video/mp4"):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] video_generation.py — this file is Speakeasy-generated (DO NOT EDIT); a direct edit will be reverted on the next speakeasy run

Details

Why: The file header reads """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" and the repo CONTRIBUTING.md states "we do not accept direct changes or pull requests" and "fixes will be included in the next generation of the generated code." The .speakeasy/out.openapi.yaml spec only declares application/octet-stream as the 200 response media type for GET /videos/{jobId}/content (line 31700). When speakeasy run is run again, it will regenerate this file from the spec and overwrite both the Accept header change and the video/mp4 match-response block.

The correct approach is one of:

  1. Update .speakeasy/out.openapi.yaml to add video/mp4 as a valid 200 response content type alongside application/octet-stream, then re-run speakeasy run to regenerate the SDK. This produces a verified fix that survives future codegen runs.
  2. Open an issue/overlay in the upstream OpenRouter API spec (.speakeasy/in.openapi.yaml) and apply the fix via a Speakeasy overlay, letting the SDK regenerate from source.

The fix logic itself is correct — Accept header update plus symmetric match_response checks on both sync and async variants — so the fix needs a codegen-compatible home, not code changes.

Prompt for agents
In `.speakeasy/out.openapi.yaml` at around line 31700 (the `listVideosContent` endpoint's 200 response), add `video/mp4` as a second accepted content type alongside `application/octet-stream`. Then run `speakeasy run` (or equivalent) to regenerate `src/openrouter/video_generation.py` from the updated spec. Do NOT edit `video_generation.py` directly — it is auto-generated and direct edits will be overwritten on the next regeneration cycle.

Reviewed at d9de7a9

return http_res
if utils.match_response(http_res, "400", "application/json"):
http_res_text = utils.stream_to_text(http_res)
response_data = unmarshal_json_response(
Expand Down Expand Up @@ -878,7 +880,7 @@ async def get_video_content_async(
request_has_path_params=True,
request_has_query_params=True,
user_agent_header="user-agent",
accept_header_value="application/octet-stream",
accept_header_value="application/octet-stream, video/mp4",
http_headers=http_headers,
_globals=operations.ListVideosContentGlobals(
http_referer=self.sdk_configuration.globals.http_referer,
Expand Down Expand Up @@ -921,6 +923,8 @@ async def get_video_content_async(
response_data: Any = None
if utils.match_response(http_res, "200", "application/octet-stream"):
return http_res
if utils.match_response(http_res, "200", "video/mp4"):
return http_res
if utils.match_response(http_res, "400", "application/json"):
http_res_text = await utils.stream_to_text_async(http_res)
response_data = unmarshal_json_response(
Expand Down