confidential-images
Handles confidential image generation requests
Changed onThis handler processes image generation requests with confidential computing requirements, tracking metrics and managing the encryption of responses. It follows the same core flow as the standard image generations handler but ensures the response is encrypted according to the client's confidential computing requirements.
Arguments
- request_metadata - Extension containing request context including encryption metadata
- state - Application state containing service URLs and shared resources
- payload - The image generation request body as JSON
Returns
Returns a Result containing either:
- Ok(Json<Value>) - The encrypted response from the image service
- Err(AtomaServiceError) - An error if the request processing fails
Metrics
- Increments IMAGE_GEN_NUM_REQUESTS counter with model label
- Records request duration in IMAGE_GEN_LATENCY_METRICS histogram
Errors
Returns AtomaServiceError::InternalError if:
- Image generation request fails
- Response encryption fails
- Stack compute units update fails
post/v1/confidential/images/generations
Request
- Base URLhttp://localhost:8080
- Authnone declared
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Response
Confidential images generated successfully
Example response
{
"usage": {
"completion_tokens": 12,
"prompt_tokens": 9,
"prompt_tokens_details": {
"cached_tokens": 1
},
"total_tokens": 21
}
}Changes
- breaking
added to the
response propertyoneOflist for the response status - info
removed from the
response propertyoneOflist for the response status
- breaking
- info
endpoint added
- info