This page documents the available APIs for the Node.js service, detailing endpoints, parameters, and expected responses.
Retrieves a list of available models.
URL:GET /list-modelsResponse:
["Model 1", "Model 2", "Model 3"]
Generates speech audio based on the provided script.
URL:GET /generate/speech?api_key=Parameters:your_api_key
&payload=script_payload
Audio file in MPEG format (served as a response file).
Generates speech audio and streams the response via Server-Sent Events (SSE).
URL:POST /generate/speech/stream?api_key=your_api_key
Headers:
{ "payload": "script_payload" }Response:
audio_segment
: URL to generated audio segment.audio_complete
: URL to the final combined audio file.Generates an image based on the provided prompt.
URL:GET /generate/image?prompt=Parameters:image_prompt
&width=image_width
&height=image_height
&response_format=image
(default)
Generated image or URL to the image.
Generates an image based on a prompt passed in the body of the request.
URL:POST /generate/image?response_format=url
(default)
Headers:
{ "prompt": "A large hamster" }Response:
{ "imageUrl": "https://example.com/generated_image.jpg" }
All generated media (audio and images) can be accessed via:
URL:GET /media/filename