Text routes help you generate, refine, and suggest prompts for image and video workflows.
All routes use application/json.
{"data": ...}| Method | Path | Body |
|---|---|---|
| POST | /v2/text/prompt |
JSON — optional image_url, image2_url, video_url, prompt, mode, option |
| POST | /v2/text/suggest-prompt |
No body required |
| POST | /v2/text/refine-prompt |
JSON — prompt (required) |
| POST | /v2/text/image-2-prompt |
JSON — image_url (shorthand for Image2Prompt) |
Use HTTPS URLs only (no file upload on v2). For video, the API extracts a middle frame and runs the selected option on that frame.
Upload images or video first via POST /v2/image or POST /v2/video if you need hosted URLs.
X-Api-Key: YOUR_API_KEY on every request.
Legacy form-data routes (with data wrapper on some responses) remain at /image/*, /video/*, /audio/*, and /text/* (tagged (Legacy) in the schema).
Generates or transforms prompt text.
| Field | Notes |
|---|---|
option |
InspireMe (default), Image2Prompt, SuggestPrompt, RefinePrompt |
image_url |
Primary image for vision options |
image2_url |
Optional second image |
video_url |
Uses middle frame when no image_url |
prompt |
Seed text; required for RefinePrompt behavior via option |
mode |
scene, video, image, or audio |
import requests
r = requests.post(
"https://api.vimmerse.net/v2/text/prompt",
headers={"X-Api-Key": "YOUR_API_KEY", "Content-Type": "application/json"},
json={
"image_url": "https://media.vimmerse.net/example/product.jpg",
"option": "Image2Prompt",
"mode": "image",
},
timeout=120,
)
r.raise_for_status()
print(r.json()) # JSON string value
Authorization (string) or Authorization (null) (Authorization) | |
Username (string) or Username (null) (Username) | |
X-Client-Type (string) or X-Client-Type (null) (X-Client-Type) |
Generated prompt (JSON string)
Bad Request
Validation Error
"A cinematic wide shot of a futuristic city at dusk, neon reflections on wet streets, soft volumetric light, ultra-detailed, 8K."Returns a creative prompt suggestion. No request body is required.
import requests
r = requests.post(
"https://api.vimmerse.net/v2/text/suggest-prompt",
headers={"X-Api-Key": "YOUR_API_KEY", "Content-Type": "application/json"},
timeout=60,
)
print(r.json())
Authorization (string) or Authorization (null) (Authorization) | |
Username (string) or Username (null) (Username) | |
X-Client-Type (string) or X-Client-Type (null) (X-Client-Type) |
Suggested prompt (JSON string)
Bad Request
Validation Error
"A cinematic wide shot of a futuristic city at dusk, neon reflections on wet streets, soft volumetric light, ultra-detailed, 8K."Describes image_url in one prompt (same as POST /v2/text/prompt with "option": "Image2Prompt").
import requests
r = requests.post(
"https://api.vimmerse.net/v2/text/image-2-prompt",
headers={"X-Api-Key": "YOUR_API_KEY", "Content-Type": "application/json"},
json={"image_url": "https://media.vimmerse.net/example/photo.jpg"},
timeout=120,
)
print(r.json())
Generated prompt (JSON string)
Bad Request
Validation Error
"A cinematic wide shot of a futuristic city at dusk, neon reflections on wet streets, soft volumetric light, ultra-detailed, 8K."Improves the supplied prompt for image/video generation.
import requests
r = requests.post(
"https://api.vimmerse.net/v2/text/refine-prompt",
headers={"X-Api-Key": "YOUR_API_KEY", "Content-Type": "application/json"},
json={"prompt": "Nike shoes on colorful background"},
timeout=60,
)
print(r.json())
Refined prompt (JSON string)
Bad Request
Validation Error
"A cinematic wide shot of a futuristic city at dusk, neon reflections on wet streets, soft volumetric light, ultra-detailed, 8K."