API Documentation

Interactive API reference for Image Testing endpoints
← Back to Home
GET /health
Health check endpoint to verify the server is running.

Try it out

POST /api/generate-image
Generate an image from a text prompt using OpenAI's image generation API. Optionally generates a short descriptive text to pair with the image.

Request Body (JSON)

Parameter Type Required Description
prompt string Required Text description of the image to generate
apiKey string Optional OpenAI API key (or use x-api-key header or .env)
model string Optional Image model to use (default: gpt-image-1)
size string Optional Image size: 512x512, 1024x1024, or 2048x2048 (default: 1024x1024)
filename string Optional Custom filename (without extension) for saved images

Try it out

POST /api/edit-image
Edit an existing image by providing a prompt describing the desired changes. Provide either an image file (upload) or an image URL. Supports optional mask file for precise editing control.

Request (multipart/form-data)

Parameter Type Required Description
image file One of image / imageUrl Image file to edit (PNG or JPEG)
imageUrl string One of image / imageUrl URL of image to edit (must be http(s) and return PNG or JPEG)
prompt string Required Text description of the edit to make
mask file Optional Mask file (PNG) specifying areas to edit
apiKey string Optional OpenAI API key (or use x-api-key header)
model string Optional Image model to use (default: gpt-image-1)
size string Optional Image size (default: 1024x1024)
filename string Optional Custom filename for saved images

Try it out

POST /api/generate-video
Generate a short video from a text prompt using Google Gemini (Veo). Returns the same response shape as the image API: trusys.output with video_url and text. Uses a Gemini API key (not OpenAI).

Request Body (JSON)

Parameter Type Required Description
prompt string Required Text description of the video to generate
apiKey string Optional Gemini API key (or use x-api-key header or GEMINI_API_KEY in .env)
model string Optional Video model (default: veo-3.1-generate-preview)
durationSeconds number Optional Video duration in seconds: 4, 6, or 8 (default: 8)
aspectRatio string Optional 16:9 or 9:16 (default: 16:9)
resolution string Optional 720p, 1080p, or 4k
filename string Optional Custom filename (without extension) for saved video

Try it out

POST /api/generate-text-image
Generate both descriptive text and an accompanying image from a single prompt. Uses Chat Completions for text and Image Generation for the image.

Request Body (JSON)

Parameter Type Required Description
prompt string Required Text description for both text and image generation
apiKey string Optional OpenAI API key
textModel string Optional Model for text generation (default: gpt-4o-mini)
imageModel string Optional Model for image generation (default: gpt-image-1)
size string Optional Image size (default: 1024x1024)
filename string Optional Custom filename for saved images

Try it out

POST /api/rag/add-pdf
Process a PDF document by extracting text and rendering pages as images. Pages are captioned and combined with text for embedding.

Request (multipart/form-data)

Parameter Type Required Description
pdf file Required PDF file to process
title string Optional Document title (default: "PDF Document")
maxPages number Optional Maximum pages to render (1-5, default: 3)
apiKey string Optional OpenAI API key

Try it out

POST /api/rag/query
Query the RAG store to retrieve relevant documents and images based on semantic similarity. Returns an answer generated from the retrieved context.

Request Body (JSON)

Parameter Type Required Description
prompt string Required Query/question to search for
apiKey string Optional OpenAI API key
topK number Optional Number of top documents to retrieve (default: 3)

Try it out