API Reference
Use this reference to look up the HTTP and gRPC inference contracts. For a complete deployment walkthrough, start with the Quickstart.
HTTP Endpoints
The release HTTP server exposes the following routes:
The NIM also exposes a binary gRPC API on port 50051 that mirrors the
/v1/infer payload as harmonizer.v1.Harmonizer/Process.
API Examples
Use the examples in this section to get started with the API.
The examples use localhost because Docker publishes the port on the client
host. For a remote NIM, replace it with the server host name or IP address. From
inside Kubernetes, use the Service DNS name. 0.0.0.0 is a server listen
address and should not be used as a client destination.
Check Health
Use the following command to check server readiness.
cURL Request
Response
For the HTTP entrypoint, model loading and startup warmup complete before the
server begins accepting connections. During that phase a client normally sees a
connection failure or a pending deployment startup probe, not an HTTP 503.
After the server is reachable, 200 with "status": "ready" means the
backend is ready. A running HTTP server can return 503 if its internal
backend readiness state later becomes false.
For the gRPC entrypoint, the model also loads and warms before the gRPC server
starts. The standard grpc.health.v1.Health/Check service changes to
SERVING after server startup and to NOT_SERVING during shutdown or
during the short transition between detecting an unrecoverable CUDA error and
terminating the inference process. Its companion HTTP live and ready
routes query that gRPC health service.
Deployment probes should use /v1/health/ready.
Process Images
Use the process endpoint to enhance one or more images. The images list is
ordered: with context_length=4 the list is treated as a frame sequence and
the temporal lane builds autoregressive context from previously generated
outputs. With context_length=0 each image is processed independently.
Each returned image or tensor has the corresponding input’s original
dimensions. The runtime stretches the input to 1024x576 for inference and
stretches the result back to the original dimensions.
Both processing modes are available through either inference transport. A
container activates one inference transport at startup, so the HTTP and gRPC
tabs below are alternatives rather than simultaneous inference endpoints. See
the Quickstart for the corresponding launch commands.
/v1/infer
gRPC
Use POST /v1/infer for the native Harmonizer schema. HTTP
image payloads are base64-encoded PNG or JPEG bytes.
This example uses an input frame from the NVIDIA Harmonizer
model-publication repository.
The API accepts encoded image data rather than an image URL, so the first
command downloads the frame as input.png. The remaining commands insert
its complete base64 payload into the request.
cURL Request
Response
The dimensions below are for a 1024x576 input image.
Transport Parameter Values
HTTP represents parameter choices as strings. gRPC represents the same choices as protobuf enums.
Request Fields
The following table describes the request fields:
Raw Tensor Response
For HTTP responses, both image and tensor keys are serialized and
exactly one is non-null. gRPC represents the alternatives as a protobuf
oneof. With output_format=raw_tensor, HTTP base64-encodes tensor.data
and gRPC returns it as bytes. The decoded payload contains tightly packed
RGB uint8 values in the [0, 255] range. Output layout is always HWC
and output shape is [height, width, 3].
The following HTTP response is for a 1024x576 input:
Response Fields
The following table describes the response fields:
Model and NIM Information
Use the standard NIM management endpoints rather than inference responses for
service and model information. /v1/version reports the release and API
versions; /v1/metadata combines version, license, model, and selected-profile
information; /v1/models identifies the served model; and /v1/manifest
returns the active model manifest. /v1/license returns the packaged license,
and /v1/metrics returns Prometheus text rather than JSON.
Error Handling
The HTTP API returns standard status codes to indicate success or failure:
- 200 OK: Request successful
- 400 Bad Request: nimlib request-body validation or invalid input parameters
(for example an unsupported
context_lengthor an invalidreturn_policyfor the request shape) - 503 Service Unavailable: A running backend becomes unavailable
- 500 Internal Server Error: Server-side error
Every HTTP error uses the {"error": ...} envelope shown below. The nested
error object always contains the required message, type, and
code fields; the OpenAPI schema defines their types.
A missing model artifact normally fails model loading before the HTTP or gRPC server starts, so clients see startup failure rather than an inference response. The current nimlib configuration includes field-specific validation details. For example, setting both image payload fields returns:
The gRPC API uses standard gRPC status codes:
OK(code0): The RPC completed successfullyINVALID_ARGUMENT: Invalid input parameters or malformed payloadUNAVAILABLE: Model backend is not loadedUNKNOWN: Unhandled server-side error
OpenAPI Specification
The HTTP OpenAPI specification is generated from the release nimlib interface
and packaged at /opt/nim/api_spec.yaml inside the container. The interactive
endpoint reference is available in the API Reference tab.