image-agent
Image Agent

Upload Session References

Upload reference images for session-based image generation.

Images are uploaded to S3 and tracked in the database linked to a session. When the session is deleted, the reference records are automatically deleted (CASCADE), enabling future S3 cleanup.

Usage Flow:

  1. Upload images via this endpoint (optionally with existing session_id)
  2. Use the returned session_id and reference_image_urls in the chat request
  3. Images persist as long as the session exists

Request:

  • session_id: Optional existing session ID (creates new session if not provided)
  • images: List of base64-encoded images (first is logo, rest are style refs)
  • formats: Optional list of formats (png, jpg, etc.)

Response:

  • session_id: The session ID (new or existing)
  • reference_image_urls: List of S3 URLs to pass as context.reference_images
  • images_uploaded: Count of successfully uploaded images
post/api/v1/image-agent/session-references

Request

  • Base URL: https://api.trylapis.com (the document declares no server; this is the origin it was published from)
  • URL: https://api.trylapis.com/api/v1/image-agent/session-references
  • Auth: HTTP bearer

Request body

session_idinteger nullable

Existing session ID to add references to. If not provided, a new session is created.

imagesstring[] required

List of base64-encoded images. First is logo, rest are style references.

formatsstring[] nullable

Optional list of image formats (png, jpg, etc.) - must match images length if provided

Response

Successful Response

session_idinteger required

Session ID (new or existing)

images_uploadedinteger required

Number of images uploaded

reference_image_urlsstring[] required

List of S3 URLs to pass as context.reference_images

Changes

No recorded changes to this operation across all 1 revision of this API.