This repository was archived by the owner on Aug 5, 2026. It is now read-only.
feat: add Reve API v2 support - #4
Merged
Merged
Conversation
- v2 create endpoint (client.v2.images.create): ordered references with
{ data: }/{ ref: } objects, <frame>N</frame> prompt tags, the full
18-value aspect-ratio set incl. auto, 4000-char prompts, up to 8
references, and a structured layout in JSON responses
- Experimental v2 layout endpoints (client.v2.layouts.extract/create/render)
- Effects listing via client.effects.list (GET /v1/image/effect)
- postprocessing, test_time_scaling, accept, and breadcrumb options on
the v1 and v2 endpoints
- Binary image responses via Accept: image/* (raw bytes with metadata
in X-Reve-* headers); grey-image error handling via X-Reve-Error-Code
- ImageResponse#layout, LayoutResponse, APIError#params, header-based
error_code fallback
- GET support in the HTTP layer; retries now cover GET
- Fix remix <img>N</img> YARD to 0-based indexing
- Speed up 429 retry tests (middleware honors Retry-After literally)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the v2 migration plan (
docs/plans/260716-01a-v2-api-migration.md, verified against the live docs at https://api.reve.com/console/docs). Zero breaking changes — all v1 methods keep working unchanged; everything new is additive.API v2
client.v2.images.create(POST /v2/image/create) — the unified v2 endpoint covering v1 create/edit/remix workflows:references({ data: }/{ ref: }objects, up to 8) addressed from the prompt as<frame>N</frame>(0-based)auto(new default); prompts up to 4000 charslayout(ImageResponse#layout)client.v2.layouts.extract/.create/.renderwith compound{ image, layout, prompt }references,commandssupport, andLayoutResponseclient.effects.list(GET /v1/image/effect) with optionalsourcefilterv1 backfill (works on v2 too)
postprocessing:(upscale / remove_background / fit_image / effect incl. nestedeffect_parameters)test_time_scaling:(1–15, validated),breadcrumb:query paramaccept: "image/png" | "image/jpeg" | "image/webp"→ raw image bytes with metadata viaX-Reve-*headersHTTP & error handling
APIError#params;#error_codefalls back to theX-Reve-Error-Codeheader (grey-image error responses)Fixes
<img>N</img>YARD corrected to 0-based indexing (API, README, and tests all agree)Retry-Afterliterally); suite time 122s → 2sVerification
bundle exec rake— 238 tests, 461 assertions, 0 failures; RuboCop clean (27 files)