You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
POST /v1/attachments uploads image files through Perplexity's real attachment pipeline and returns attachment URLs you can send to POST /v1/search or POST /v1/search/stream.
Request shape
Send multipart/form-data with repeated files fields.
Request fields
Field
Type
Required
Description
files
multipart file field
yes
repeated image files to upload
Upload rules
Behavior
Value
accepted file types
image/* only
repeated fields
use repeated files parts
file order
preserved
MIME detection
server validates the actual file bytes and normalizes the upload MIME type
max files per request
10
max file size
10 MB per file
empty files
rejected
unsupported MIME types
rejected
For whole-request protection, configure router-level DefaultBodyLimit or RequestBodyLimitLayer separately.
POST /v1/images generates images through the same upstream Perplexity ask flow used by search, then returns the generated image assets.
Request shape
{
"prompt": "Generate an image of a cinematic red fox in neon rain",
"model": "sonar",
"language": "en-US",
"incognito": true
}
Request fields
Field
Type
Required
Default
Description
prompt
string
yes
none
image generation prompt sent to Perplexity
model
string
no
server default search model
optional search-model override
language
string
no
en-US
language sent upstream
incognito
bool
no
true
whether to run the request in incognito mode
/v1/images is generation-only in this release. It does not accept uploaded input images or image-edit requests.
Model behavior
Behavior
Value
accepted models
search models only
omitted model
uses the configured default search model
reasoning models
rejected
explicit upstream image model selector
not exposed
Search models
Model
Result
turbo
works
sonar
works
sonar-pro
works
gemini-3-flash
works
gpt-5.4
works
gpt-5.2
works
claude-4.6-sonnet
works
grok-4.1
works
Observed behavior
Behavior
Value
omitted model
uses sonar by default
successful generation_model
seedream
successful source
seedream-router
Response shape
{
"id": "req_...",
"model": "sonar",
"prompt": "Generate an image of a cinematic red fox in neon rain",
"image_generation": true,
"images": [
{
"url": "https://...",
"thumbnail_url": "https://...",
"download_url": "https://...",
"mime_type": "image/png",
"source": "seedream-router",
"generation_model": "seedream",
"prompt": "Cinematic red fox in neon rain"
}
],
"answer": "Media generated: '...'",
"follow_up": {
"backend_uuid": "backend-uuid",
"attachments": []
}
}
Response fields
Field
Type
Description
id
string
server-generated request id
model
string
search model used for the request
prompt
string
original generation prompt
image_generation
bool
whether the upstream request was classified as image generation
images
object[]
generated image assets
answer
string | null
upstream text answer, when present
follow_up
object
follow-up values returned by Perplexity
Generated image fields
Field
Type
Description
url
string
direct image URL
thumbnail_url
string | null
thumbnail URL, when present
download_url
string | null
download URL, when present
mime_type
string | null
MIME type, when present
source
string | null
upstream router or image source
generation_model
string | null
upstream generation model name
prompt
string | null
prompt-like description attached to the asset
Example
curl -sS -X POST http://127.0.0.1:3000/v1/images \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{ "prompt": "Generate an image of a cinematic red fox in neon rain", "model": "sonar" }'
Notes
PERPLEXITY_API_KEY is optional. If it is unset, auth is disabled.
GET /v1/models is the source of truth for supported model names.
POST /v1/search/stream?human=1 is intended for terminal use.