class

MJ::Arcana::OpenAIDirectTransport

Inherits MJ::Arcana::Transport < Reference < Object

OpenAI's image API, direct — a genuinely independent capacity pool.

The point is throughput, not quality or price. gpt-image-2.5-flare and -sunburst are the SAME models Runware fronts as openai:gpt-image@2.5-*, so a picture drawn here is the picture you would have got anyway. What differs is the door: these requests are admitted against our own OpenAI account quota instead of queueing behind every other Runware customer. A congestion episode on one cannot stall the other, which is the property cameras's pools now reports and the reason this file exists.

Size rules were probed against the live API, not read off a page:

gpt-image-2.5-* width and height divisible by 16; longest edge <= 3840; and a minimum TOTAL pixel budget rather than a per-side floor (16x16 is rejected as "below the current minimum pixel budget"). gpt-image-1.5 exactly 1024x1024, 1024x1536, 1536x1024, auto.

Both agree with what the Runware-side probing found, which is a good sign that the registry's geometry is a property of the model rather than of the aggregator.

Note the probe technique differs from Runware's: OpenAI validates the PROMPT FIRST, so the empty-prompt trick that makes Runware answer size questions for free does not work here. Use a real prompt with a size you expect to be refused — a 400 is unbilled, but a size that happens to be VALID will generate and charge you.

Constants

DEFAULT_COMPRESSION = 80

Left to itself this API returns LOSSLESS webp (a VP8L chunk, ~0.9 bytes/pixel), where Runware returns lossy VP8 at ~0.11. Same request, 8x the bytes — which would ambush anyone treating the two pools as interchangeable, since the whole point of the second pool is that you can move load onto it without anything else changing. output_compression brings it into line. 80 is the default rather than 100 because comparable panel sizes across pools matter more here than the last few percent of fidelity; pass output_compression in extra to override, or 100 for lossless.

ENDPOINT = "https://api.openai.com/v1"
KNOWN_EXTRA = ["quality", "background", "output_compression", "input_fidelity"]

Only pass through parameters this API actually defines. OpenAI rejects unknown fields outright — which is friendlier than Runware, where an unknown parameter is accepted silently and a 200 proves nothing about whether it engaged.

Constructors

new(api_key : String, retries : Int32 = 2, read_timeout : Float64 = 180.0, compression : Int32 = DEFAULT_COMPRESSION)
Source

Instance methods

edit(references : Array(Bytes), prompt : String, width : Int32, height : Int32, model : String, extra : Hash(String, JSON::Any) | Nil, format : String) : GenerationResult
Source
name

A short stable name a Camera refers to, e.g. "runware".

Source