Skip to content
This repository was archived by the owner on Aug 5, 2026. It is now read-only.

feat: add Reve API v2 support - #4

Merged
dpaluy merged 5 commits into
masterfrom
feature/api-v2
Jul 17, 2026
Merged

feat: add Reve API v2 support#4
dpaluy merged 5 commits into
masterfrom
feature/api-v2

Conversation

@dpaluy

@dpaluy dpaluy commented Jul 17, 2026

Copy link
Copy Markdown
Owner

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:
    • ordered references ({ data: } / { ref: } objects, up to 8) addressed from the prompt as <frame>N</frame> (0-based)
    • the full 18-value aspect-ratio set including auto (new default); prompts up to 4000 chars
    • JSON responses include the generated layout (ImageResponse#layout)
  • Experimental layout endpointsclient.v2.layouts.extract / .create / .render with compound { image, layout, prompt } references, commands support, and LayoutResponse
  • client.effects.list (GET /v1/image/effect) with optional source filter

v1 backfill (works on v2 too)

  • postprocessing: (upscale / remove_background / fit_image / effect incl. nested effect_parameters)
  • test_time_scaling: (1–15, validated), breadcrumb: query param
  • accept: "image/png" | "image/jpeg" | "image/webp" → raw image bytes with metadata via X-Reve-* headers

HTTP & error handling

  • GET support in the HTTP layer; retries now cover GET
  • APIError#params; #error_code falls back to the X-Reve-Error-Code header (grey-image error responses)

Fixes

  • Remix <img>N</img> YARD corrected to 0-based indexing (API, README, and tests all agree)
  • 429 tests no longer sleep 60s per retry (the retry middleware honors Retry-After literally); suite time 122s → 2s

Verification

  • bundle exec rake238 tests, 461 assertions, 0 failures; RuboCop clean (27 files)
  • Docs reviewed for request/response fidelity against the live API docs
  • README: new "API v2" section, official v1→v2 migration mapping, postprocessing/effects/constraint tables; CHANGELOG: 0.2.0 entry; version bumped to 0.2.0

dpaluy added 5 commits July 16, 2026 23:20
- 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)
@dpaluy
dpaluy merged commit 0d8e856 into master Jul 17, 2026
2 checks passed
@dpaluy
dpaluy deleted the feature/api-v2 branch July 17, 2026 14:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant