Skip to content

Function: useServingInvoke()

useServingInvoke<K>(body, options?): UseServingInvokeResult<InferServingResponse<K>, InferServingRequest<K>>

Hook for non-streaming invocation of a serving endpoint. Calls POST /api/serving/invoke (default) or POST /api/serving/{alias}/invoke (named).

When the type generator has populated ServingEndpointRegistry, the response type is automatically inferred from the endpoint’s OpenAPI schema.

K extends string = string

InferServingRequest<K>

UseServingInvokeOptions<K>

UseServingInvokeResult<InferServingResponse<K>, InferServingRequest<K>>