Reference
Results
Reference for TextResult, MediaResult and EmbeddingResult, the values a settled job returns.
handle.result() and the batch methods return one of three dataclasses, chosen by the shape of
the opened result: an embeddings response becomes an EmbeddingResult, a result with images
or video a MediaResult, and anything else a TextResult.
Common attributes
| Attribute | Type | Meaning |
|---|---|---|
.rates | tuple[Decimal | None, Decimal | None] | The order's signed (rate_in, rate_out), in USD per 1M units. |
.cost | str | USD decimal string: ((prompt_tok − cached_tok) × rate_in + cached_tok × rate_in_cached + completion_tok × rate_out) / 1,000,000, rounded up to the atomic unit (0.000001 USD, minimum one) exactly as the chain charges it. Excludes the protocol and gas fees. See Units and cost. |
.prompt_tok | int | Prompt units the job settled on, cached ones included: the model's own count, at most units_in. For media, the declared reference units. From the job row. |
.cached_tok | int | The part of .prompt_tok the model served from its cache. From the job row. |
.completion_tok | int | Output units the job settled on, at most units_out. From the job row. |
.rate_in_cached | Decimal | None | USD per 1M cached prompt units, as settled. None when the row carries none. |
.gas_fee | Decimal | The flat gas fee the job was posted under, in USD, paid on top of .cost. |
.fee | Decimal | The protocol fee settlement took, in USD, paid on top of .cost. |
.provider | int | str | None | Registry id of the provider that settled the job. |
.job_id | str | None | The job that produced the result. |
.custom_id | str | None | Your custom_id, read back from the sealed result. None when you set none. |
.raw | dict | The opened result object. |
TextResult
| Attribute | Type | Meaning |
|---|---|---|
.text | str | The generated text, joined from the output items. |
.output | list | The raw output items: Responses output items, or choices for a chat-completion result. |
.usage | dict | input_tokens, output_tokens and total_tokens, as the model reported them. .cost reads the settled counts, not this. |
MediaResult
The frames travel inside the sealed result as base64, so these methods make no network call.
| Member | Type | Meaning |
|---|---|---|
.frames | list[dict] | The delivered frames in order: one per image, or one entry for a video. Each has b64, content_type, width and height, plus duration_secs for video. |
.seed | int | None | The seed the model used, when reported. |
.bytes() | list[bytes] | The frames decoded, in order. A frame with missing or invalid base64 raises ResultIntegrityError. |
.download(dir) | list[Path] | Creates dir if needed and writes each frame as 0, 1, … with a suffix from its content_type (.png, .jpg, .webp, .mp4, .webm, otherwise .bin). Returns the paths. |
EmbeddingResult
| Member | Type | Meaning |
|---|---|---|
.embeddings | list[dict] | The response's data array, unchanged. |
.model | str | None | The model named in the response. |
.prompt_tokens | int | Input tokens, as the response reported them. |
.bytes() | list[bytes] | The vectors decoded from base64. Raises VorqError when the response used encoding_format="float"; read .embeddings instead. |
JobError
A batch line that never delivered. See Batches.