The Agent API does not output image URLs

Pre-flight checklist

  • This is a Perplexity API feature request, not a Perplexity app, Comet, or web UI request.
  • I have checked whether this already exists in the docs or another forum topic.
  • I have described the developer workflow or API use case this would improve.

Feature type

  • New endpoint or API capability
  • New model, preset, or model behavior
  • New parameter or request option
  • New response field or metadata
  • SDK improvement
  • Dashboard, API key, or auth improvement
  • Billing, credits, rate limit, or usage reporting improvement
  • Docs or examples improvement
  • Other API improvement

Affected API area

  • Agent API
  • Search API
  • Sonar API
  • Embeddings API
  • SDKs
  • Dashboard, API keys, or auth
  • Billing or credits
  • Not sure

Summary

The Agent API does not output image URLs.

Problem

While client.chat.completions.create() returns image URLs,

client.responses.create() does not.

This makes it unusable for our business operations.
Do you have any plans to implement image URL output for client.responses.create()?

Proposed API behavior

Example usage


Workarounds tried

Impact

Additional context

Hello @sato-unity,

Thank you for your note. The team worked hard and added the feature to Agent API. Please try it out and let me know what you think!

Andrew

If you are migrating from Sonar to Agent API, here is the migration guide which now includes this feature - How to migrate from Sonar - Perplexity

Hi Andrew,

Thank you very much for the quick response and for adding the image search feature to the Agent API. I really appreciate you and the team taking the feedback into consideration and implementing it so quickly.

I’ll give it a try right away. This is exactly the functionality I was looking for.

Thanks again to you and the team for your support!

Best regards,
Sato

2026年10月3日(土) 10:02 andrewmadson-pplx <notifications@sonar1.discoursemail.com>:

The Agent API does not support the simultaneous use of multiple tools.

Example:

client = Perplexity()
response = client.responses.create(
preset=“fast”,
input=query,
tools=[{“type”: “web_search”}, {“type”: “image_search”}],
)

Even if you specify multiple tools like this, only one of them will be used.
Consequently, the output will only contain the results from that single tool.

★For the SONAR model:
By specifying return_images=True,
it was possible to return both citation URLs and image URLs.

I tried using “image_search,” but…

Example:

client = Perplexity()
response = client.responses.create(
preset=“fast”,
input=query,
tools=[{“type”: “web_search”}, {“type”: “image_search”}],
)

Even if you specify multiple tools like this, only one of them will be used.
Consequently, the output will only contain the results from that single tool.

★For the SONAR model:
By specifying return_images=True,
it was possible to return both citation URLs and image URLs.

2026年10月3日(土) 10:02 andrewmadson-pplx <notifications@sonar1.discoursemail.com>:

Hi @sato-unity ,

The Agent API can run both web_search and image_search in the same response. I tested the configuration below, and both tools ran in all nine tests.

Please try this with your query. It explicitly asks the model to use both tools and gives it enough steps to complete the searches:

from perplexity import Perplexity

client = Perplexity()

response = client.responses.create(
    model="openai/gpt-6-luna",
    input=query,
    instructions=(
        "Use web_search to find sources for the answer. "
        "Also use image_search to find relevant images. "
        "Call both tools before answering. Cite the web sources."
    ),
    tools=[
        {"type": "web_search"},
        {"type": "image_search", "max_results": 5},
    ],
    max_steps=4,
)

print(response.output_text)

for item in response.output:
    if item.type == "image_search_results":
        for image in item.results:
            print(image.image_url, image.origin_url)

Unlike Sonar’s top-level images field, Agent API image URLs appear in image_search_results items within response.output, separately from the answer text (image-search guide). Your application should still handle empty image results or tool failures.

Let me know if this doesn’t work.

Andrew

That was my mistake. I apologize.

When requesting lengthy output for a complex query using the “fast” preset, setting max_steps=1 resulted in the output containing only one of the two—either the citation URL or the image URL—rather than both.

However, when I set max_steps=2, the output included both the citation URL and the image URL.

I apologize for the inconvenience.

2026年10月7日(水) 3:15 andrewmadson-pplx <notifications@sonar1.discoursemail.com>:

I’m happy it worked! Let me know if you have any other questions.

Andrew