Skip to main content
Every call the client makes, grouped the way the client is. Each method shows its real signature; every type it names is linked to its own section below, with each field’s type and whether it is required. One thing this cannot tell you: the parameters that belong to a MODEL rather than to the endpoint. An image model declares its own sizes, a speech model its voices. Those come from _infery.allowed_params on GET /v1/models and are rendered per model on the live catalogue. Every params type here carries an index signature so they pass straight through.

client.chat.completions

chat.completions.create()

POST /v1/chat/completions — Create chat completion Types: ChatParams · RequestCallOptions · ChatCompletion

chat.completions.stream()

The last chunk before [DONE] carries credits_used and an empty choices array — it is yielded like any other chunk rather than hidden, because it is the only place the cost of a streamed call appears. Types: ChatParams · RequestCallOptions · ChatCompletionChunk

client.embeddings

embeddings.create()

POST /v1/embeddings — Create embeddings Types: EmbeddingParams · RequestCallOptions · EmbeddingResponse

client.images

images.generate()

POST /v1/images/generations — Create image generation Generates images, waiting for the result. Note. Works for the common case. A fal/replicate-routed model can instead answer 504 with a job_id (the request is still running and still billed) — poll GET /v1/images/jobs/{job_id}, which the OpenAI SDK will not do for you. Types: ImageGenerateParams · MediaCallOptions · ImageResult

images.edit()

POST /v1/images/edits — Edit an existing image Edits an image, optionally through a mask. Note. The OpenAI SDK posts multipart; this endpoint takes JSON with image_base64. Types: ImageEditParams · MediaCallOptions · ImageResult

images.upscale()

POST /v1/images/upscale — Upscale an image Upscales an image by URL. Needs an upscale-modality model that accepts an image — a video upscaler is refused with a 400 and points you at videos.upscale. Same deferral behaviour as generate(). Types: ImageUpscaleParams · MediaCallOptions · ImageResult

client.videos

videos.submit()

POST /v1/videos/generations — Create video generation Submits and returns immediately. The job handle is id. Types: VideoSubmitParams · RequestCallOptions · VideoSubmitResult

videos.retrieve()

GET /v1/videos/generations/{jobId} — Get video generation status Types: RequestCallOptions · VideoJobStatus

videos.generate()

Submits and polls to completion. Default interval 5s, deadline one hour — the gateway’s own budget (VideoMediaJobAdapter.deadlineMs). Types: VideoSubmitParams · PollOptions · VideoJobStatus

videos.upscale()

POST /v1/video/upscale — Upscale a video Served by POST /v1/video/upscale — singular, unlike every other video path. Submitted and polled INSIDE the gateway request, so this can take minutes; should the gateway stop waiting, it answers 504 with a job_id (video-upscale.controller.ts:61) — the work continues server-side and is billed either way, and the result is collected from the SAME durable job endpoint every other deferred media call uses (GET /v1/images/jobs/{id}, despite the path — :78). Previously this was a bare request with no deferral recovery at all, so a deferred upscale threw at the caller instead of collecting the result they had already paid for; fixed to match images.upscale()’s handling. Types: VideoUpscaleParams · MediaCallOptions · VideoUpscaleResult

client.music

music.generate()

POST /v1/music/generations — Generate music from text prompt One synchronous call — there is no job to poll. Allow a generous client timeout; a three-minute song takes 60-90 seconds to render. Types: MusicGenerateParams · MediaCallOptions · MusicResult

music.stream()

The same route read as SSE: progress frames while the track renders, then exactly ONE terminal frame — completed or error. Types: MusicGenerateParams · RequestCallOptions · MusicStreamEvent

client.audio.speech

audio.speech.create()

POST /v1/audio/speech — Text-to-speech Returns the Response; the body is audio bytes, not JSON. Note. Works for the common case — answers audio bytes. A fal/replicate-routed voice can instead answer a JSON 504 with a job_id in place of audio (still billed) — poll GET /v1/images/jobs/{job_id} for a signed download URL; the OpenAI SDK has no path for a JSON body where it expects bytes. Types: SpeechParams · MediaCallOptions

client.audio.transcriptions

audio.transcriptions.create()

POST /v1/audio/transcriptions — Speech-to-text Multipart by default, which is what the OpenAI SDK sends and what this endpoint prefers (base64 in JSON costs 33% more bandwidth). Note. Works, but timestamp_granularities is dropped and srt/vtt/text come back as a JSON envelope. Types: TranscriptionParams · TranscriptionCallOptions · TranscriptionResult

client.audio.transformations

audio.transformations.create()

POST /v1/audio/transformations — Transform audio (voice-changer, stem separation, video→audio extraction, …) POST /v1/audio/transformations reaches MediaJobFacade.runToCompletion on the durable path (audio.controller.ts:914), and that facade is what answers 504 with a job_id once it stops waiting (media-job.facade.ts:157-177) — the work continues server-side and is billed either way. This was a bare transport.request with no deferral recovery, so a deferred transformation threw JobDeferredError at the customer for a result they had already paid for: the exact failure the deferral machinery exists to prevent, and the same bug videos.upscale() had. speech and transcriptions in this file already handled it. Types: AudioTransformationParams · MediaCallOptions · AudioTransformationResult

client.media

One call for every media modality.

media.generate()

Produces media of any modality and waits for it. Types: MediaGenerateParams · MediaGenerateOptions · MediaResult

media.wait()

Collects a job started with background: true. Types: MediaModality · MediaGenerateOptions · MediaResult

client.threeD

threeD.generate()

POST /v1/3d/generations — Generate a 3D model from text or an image APIPromise, so withResponse() reaches an envelope on the deferred paths too, carrying the BILLED request’s id — the gateway sets x-request-id on error responses as well now. modelUsed is the one field a deferral does not carry; see deferrable in core/poll.ts. Types: ThreeDGenerateParams · MediaCallOptions · ThreeDResult

client.files

files.create()

POST /v1/files — Upload a file Types: FileCreateParams · RequestCallOptions · FileObject

files.list()

GET /v1/files — List uploaded files Types: FileListParams · RequestCallOptions · FileListResult

files.retrieve()

GET /v1/files/{fileId} — Retrieve file metadata Types: RequestCallOptions · FileObject

files.content()

GET /v1/files/{fileId}/content — Download file contents The raw bytes. Returns the Response so the caller picks the reader. Types: RequestCallOptions

files.del()

DELETE /v1/files/{fileId} — Delete a file Types: RequestCallOptions

client.models

models.list()

GET /v1/models — List available models Note. Reachable, but the _infery extension and client-side modality filtering are ours. Types: ModelListOptions · CatalogModel

models.estimate()

POST /v1/models/{slug}/estimate — Estimate credits for a model request Types: ModelEstimateParams · RequestCallOptions · ModelEstimateResult

client.tools

tools.list()

GET /v1/tools — List available workflow capabilities Types: RequestCallOptions · ToolListResult

client.capabilities

capabilities.run()

POST /v1/capabilities/{id}/run — Run a single capability synchronously Types: CapabilityRunParams · RequestCallOptions · CapabilityRunResult

client.workflows

workflows.list()

GET /v1/workflows — List workflows Types: WorkflowListParams · RequestCallOptions · WorkflowListResult

workflows.create()

POST /v1/workflows — Create a reusable workflow Types: WorkflowCreateParams · RequestCallOptions · WorkflowCreateResult

workflows.retrieve()

GET /v1/workflows/{id} — Get workflow (latest or specific version) Types: WorkflowRetrieveParams · RequestCallOptions · WorkflowRetrieveResult

workflows.update()

PUT /v1/workflows/{id} — Update workflow (creates new version if definition changed) Types: WorkflowUpdateParams · RequestCallOptions · WorkflowUpdateResult

workflows.del()

DELETE /v1/workflows/{id} — Soft-delete workflow Types: RequestCallOptions · WorkflowDeleteResult

workflows.estimate()

POST /v1/workflows/estimate — Dry-run cost estimate for a workflow definition (no execution) Types: WorkflowEstimateParams · RequestCallOptions · WorkflowEstimateResult

client.workflows.runs

workflows.runs.create()

POST /v1/workflows/runs — Run a workflow (sync default; mode=async returns job id; mode=stream returns SSE) Note. mode: “stream” is refused here at compile time; workflows.runs.stream() is the SAME route, read as SSE. Types: RunCreateCallParams · RunOptions · RunCreateResult

workflows.runs.stream()

mode: 'stream' — the thirteen named SSE events on WorkflowRunEvent, terminated on the wire by data: [DONE] (not yielded). Same Idempotency-Key default and forwarding as create() — see the comment there — because this is the SAME route (POST /pipelines/runs), just read as a stream instead of awaited as JSON. A completed run under a reused key replays as a synthetic event sequence, exactly as it would answer a fresh sync call for that key; a run still IN FLIGHT under that key is refused with 409 (idempotency_in_progress) — requestStream throws for any non-2xx response, so that surfaces as a rejected promise before this generator yields anything, not as an event. Types: RunCreateParams · RunOptions · WorkflowRunEvent

workflows.runs.retrieve()

GET /v1/workflows/runs/{id} — Get workflow run by id Types: RequestCallOptions · RunRetrieveResult

workflows.runs.logs()

GET /v1/workflows/runs/{id}/logs — Get per-step model_call_logs for a workflow run Types: RequestCallOptions · RunLogsResult

workflows.runs.cancel()

POST /v1/workflows/runs/{id}/cancel — Best-effort cancel of a running or queued workflow run Types: RequestCallOptions · RunCancelResult

client.workflows.templates

workflows.templates.list()

GET /v1/workflows/templates — List workflow templates (paginate + filter) Types: TemplateListParams · RequestCallOptions · TemplateListResult

workflows.templates.retrieve()

GET /v1/workflows/templates/{slug} — Get a single workflow template (full, with definition + sample_input) Types: RequestCallOptions · TemplateRetrieveResult

client.jobs

jobs.retrieve()

GET /v1/images/jobs/{id} — Poll an image generation job Serves media jobs of EVERY modality despite the /v1/images path — image, video, 3D, upscale, speech and transcription alike. Types: RequestCallOptions · MediaJobStatus

jobs.wait()

Polls until the job reaches a terminal state. Types: PollOptions · MediaJobStatus

Types

Every type the signatures above name, alphabetically. A field marked required must be present; the rest are optional. Notes are the type’s own documentation, so they say what the field means rather than restating its name.

AsyncRunAccepted

The queued run’s identity, as answered by an async run.

AudioTransformationParams

AudioTransformationResult

BinaryInput

CapabilityRunParams

CapabilityRunResult

CatalogModel

ChatAnnotation

Mirrors ChatAnnotationDto. A web-search url_citation annotation — every field optional because the translator only fills in what the upstream provider returned.

ChatCompletion

ChatCompletionChoice

ChatCompletionChunk

ChatCompletionChunkChoice

ChatCompletionChunkDelta

ChatCompletionMessage

ChatCompletionTokensDetails

reasoning_tokens is set on the native OpenAI Responses-API streaming path (apps/gateway/src/providers/openai-responses/stream-translator.ts:204-206). audio_tokens is read off the same block on both the non-streaming and streaming paths in apps/gateway/src/modules/chat/chat.controller.ts:475-476,722-723 (audio chat models split prompt/completion tokens into text + audio here). Both optional — no single provider path sets both at once.

ChatContentPart

ChatFileContentPart

ChatFilePayload

Mirrors ChatFilePayloadDto. Exactly one of data+mime_type, file_id, or url is the intended way to supply the file — all three are optional here because the wire does not enforce which one at the type level.

ChatFunctionDefinition

ChatFunctionTool

ChatImageUrl

Mirrors ChatImageUrlDto.

ChatImageUrlContentPart

ChatInputAudio

Mirrors ChatInputAudioDto.

ChatInputAudioContentPart

ChatMessage

ChatParams

ChatPromptTokensDetails

Mirrors PromptTokensDetails in apps/gateway/src/common/cache-usage.ts:35-41 — the OpenAI-shaped usage.prompt_tokens_details block the gateway both emits and consumes. cached_tokens/cache_write_tokens are OpenAI’s own fields; cache_write_1h_tokens is this gateway’s extension carrying Anthropic’s 1-hour TTL cache writes, which OpenAI’s shape has no field for.

ChatResponseFormat

ChatResponseFormatJsonObject

ChatResponseFormatJsonSchema

ChatResponseFormatText

ChatTextContentPart

ChatTool

A tool definition on ChatParams.tools. The gateway translates ONLY entries shaped {type:"function", function:{name, description?, parameters?}} into each provider’s native tool-calling form; any other entry is forwarded upstream byte-identical — provider-native tools (web search, grounding, …) already arrive in their own shape, hence the escape hatch to a bare record alongside ChatFunctionTool.

ChatToolCall

ChatToolCallDelta

A tool call as it appears on a STREAMING chunk’s delta.tool_calls. Mirrors ChatCompletionChunkToolCallDeltaDto (bound in types.spec.ts, see ChatCompletionChunk below for how the wider chunk graph is now bound). index is how a caller DEMULTIPLEXES calls that may be CONCURRENT, not merely how it reassembles the pieces of one: the native OpenAI Responses-API path assigns it from the upstream output_index (apps/gateway/src/providers/openai-responses/stream-translator.ts:93,98,113), so a web_search_call at output position 0 pushes a genuine function call to index 1+, and a pass-through provider forwards whatever concurrent-call indices the upstream model itself used, untouched. Every other field is partial because a call’s id/name typically arrive on the first chunk and its arguments accumulate over the following ones.

ChatToolCallFunction

ChatToolChoice

Controls whether/which tool the model must call: "none", "auto", "required", or an object naming one specific function tool to force.

ChatToolChoiceFunctionName

ChatToolChoiceObject

ChatUsage

ChatWebSearchOptions

web_search on ChatParams — the REQUEST shorthand that opts a completion into grounded web search. Distinct from the RESPONSE block infery_web_search, which reports what a search actually did; the two are different shapes and only this one is sent.

ClientOptions

EmbeddingParams

EmbeddingResponse

FileCreateParams

FileListParams

FileListResult

FileObject

FilePurpose

ImageEditParams

ImageGenerateParams

ImageItem

ImageResult

ImageUpscaleParams

MediaArtifact

One produced artifact, normalised across modalities.

MediaCallOptions

Extends PollOptions, RequestCallOptions.

MediaGenerateOptions

Extends Omit<MediaCallOptions, 'onProgress'>.

MediaGenerateParams

A request for any media modality.

MediaJobArtifact

One produced artifact on a completed media job — the shape of each data[] element.

MediaJobStatus

The cross-modality media job — served by GET /v1/images/jobs/{id} for EVERY durable media job despite the /v1/images path: image, video (only when deferred), 3D, upscale, speech and transcription alike. Bound to MediaJobResponseDto (ApiMediaJob in src/types.ts) — see the whole-type and per-field assertions in types.spec.ts.

MediaModality

The modalities media.generate() can produce.

MediaProgress

Progress across modalities. Only video reports a percentage today.

MediaResult

ModelEstimateParams

ModelEstimateResult

ModelListOptions

Extends RequestCallOptions.

MusicGenerateParams

No duration parameter exists — length follows the model and the material.

MusicOperation

MusicReferenceImage

One Lyria 3 reference image (images, up to 10 per request).

MusicResult

MusicStreamError

The error frame’s payload — an object, unlike a progress frame’s error, which is a bare string.

MusicStreamEvent

One data: payload on music.stream(), discriminated on type.

MusicTrack

PollOptions

Type parameters: <J extends Pollable = MediaJobStatus>.

RequestCallOptions

Per-call knobs every request-making method accepts.

RunCancelResult

RunCreateCallParams

The params runs.create() actually accepts — RunCreateParams minus 'stream' on mode. A caller who sends mode: 'stream' here would get back an APIPromise<RunCreateResult> that promises JSON which never arrives on the wire; create() refuses it at COMPILE TIME instead — the same GOAL as VideoSubmitParams.duration_seconds?: never (refuse a value that costs money if it silently slips through), but NOT the same mechanism: that field is declared never directly inside an interface that also carries an index signature, which works because the named field wins over the index signature for THAT key specifically. mode has two legitimate values here, not zero, so a bare never would refuse everything; see below for the mechanism this type actually uses instead. Use runs.stream() for mode: 'stream' — it returns the typed AsyncGenerator<WorkflowRunEvent> this method’s return type cannot.

RunCreateParams

TWO VOCABULARIES, ON PURPOSE.

RunCreateResult

sync (default) answers the completed run; async answers the queued run’s identity. stream answers text/event-stream and matches neither JSON shape — callers using mode: 'stream' read the response as a stream, not through this type.

RunError

Failure recorded against a run. Absent from a run that was cancelled rather than failed.

RunLogEntry

RunLogsResult

RunOptions

Extends RequestCallOptions.

RunRetrieveResult

RunStepError

Failure recorded against a single step attempt.

RunStepResult

SpeechParams

StreamStepResult

The step-run shape inside a STREAMING run’s terminal events — RunStepResult minus childRunIds, which the SSE path never sets.

TemplateListParams

TemplateListResult

TemplateRetrieveResult

Extends TemplateSummary.

TemplateSummary

TemplateUnavailable

ThreeDGenerateParams

ThreeDResult

Tool

ToolExample

ToolListResult

ToolPricing

TranscriptionCallOptions

Everything MediaCallOptions offers except background, spelled as an Omit so it cannot drift from it. background: true is excluded because this method returns a document string or a transcription object and neither can carry a job id — see the note on create.

TranscriptionFormat

TranscriptionParams

TranscriptionResult

VideoJobStatus

A video generation job — served by GET /v1/videos/generations/{jobId}. Disjoint from MediaJobStatus: no data, no payload, no artifacts_expired; carries created/model instead of them.

VideoSubmitParams

VideoSubmitResult

Immediate answer to POST /v1/videos/generations — a submitted job’s identity, not a completed result. A DIFFERENT wire shape from VideoJobStatus (the polling GET’s response): never carries result, credits_used or error, because VideoController.submit (video.controller.ts) ends with a reply.send({ id, status, progress, created, model }) that names only these five keys, always. The document types all five optional on this operation’s 200 too (same spec gap as VideoJobStatus), but the same unconditional literal justifies requiring them here for the same reason — see the comment on VideoJobStatus in core/poll.ts.

VideoUpscaleParams

VideoUpscaleResult

WorkflowCreateParams

WorkflowCreateResult

WorkflowDeleteResult

WorkflowEstimateParams

WorkflowEstimateResult

WorkflowInputDeclaration

WorkflowListParams

WorkflowListResult

WorkflowRetrieveParams

WorkflowRetrieveResult

Extends WorkflowSummary.

WorkflowRunEvent

One event of a mode: 'stream' pipeline run, as yielded by runs.stream(). See the block comment above for why type is reconstructed rather than read off the wire, and WorkflowStepDelta for why step.delta.delta is not the chat SDK’s chunk type.

WorkflowRunResult

A completed (or in-progress) run, as answered by a sync run and by GET /pipelines/runs/{id}.

WorkflowStepDelta

step.delta’s own delta shape — the gateway’s OWN ChatCompletionChunkDelta interface, declared in the same pipeline-event.types.ts file as PipelineEvent. Deliberately NOT this SDK’s chat ChatCompletionChunk: the two have diverged since PR #766 required object on a chat chunk and index on each of its choices, neither of which this step-local shape has — it comes from inside a pipeline model step, not a top-level chat completion. Reusing the chat type here would claim fields a step delta does not actually carry. One more divergence worth naming explicitly: this SDK’s OWN ChatCompletionChunkDelta (chat.ts) is a PER-CHOICE delta (one entry of ChatCompletionChunkChoice.delta), while the gateway’s same-named interface here is a WHOLE-CHUNK shape (it has its own choices array, id, object, usage) — same name, unrelated shape, on both sides of this divergence.

WorkflowStepEstimate

WorkflowSummary

WorkflowUpdateParams

WorkflowUpdateResult