# Has any one successfully used Spring AI with Perplexity Agent API?

**URL:** <https://community.perplexity.ai/t/has-any-one-successfully-used-spring-ai-with-perplexity-agent-api/5152>\
**Category:** General\
**Tags:** agent-api\
**Created:** [May 16, 2026, 7:35am UTC](https://community.perplexity.ai/t/has-any-one-successfully-used-spring-ai-with-perplexity-agent-api/5152 "2026-05-16T07:35:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![deleSerna](https://sea1.discourse-cdn.com/flex001/user_avatar/community.perplexity.ai/deleserna/32/3129_2.png) [@deleSerna](https://community.perplexity.ai/u/deleSerna)\
**Post date:** [May 16, 2026, 7:35am UTC](https://community.perplexity.ai/t/has-any-one-successfully-used-spring-ai-with-perplexity-agent-api/5152/1 "2026-05-16T07:35:36Z")

</div>

Hello,  
Has anyone used the Perplexity Agent API with Spring AI?  
I am trying to add Perplexity support in [embabel](https://github.com/embabel/embabel-agent/pull/1649) . Since `/chat/completions/` does not support agent, I have to use `v1/agent` but then I use the Spring AI’s OpenAI api’s but I ran into the below error.

```json
{

  "error": {

    "message": "validation failed: input array cannot be empty",

    "type": "invalid_request",

    "code": 400

  }

}

```

After debugging further, what I understood is, it is because of the request format used by Spring AI.  
I can reproduce the same error using the curl if I use the same request format.  
curl [https://api.perplexity.ai/v1/agent](https://api.perplexity.ai/v1/agent) \

-H “Authorization: Bearer $PERPLEXITY\_API\_KEY” \

-H “Content-Type: application/json” \

-d '{

```
"model": "perplexity/sonar",           

"messages": \[

  {"role": "system", "content": "Say OK"},

  {"role": "user", "content": "test"}

\],

"temperature": 0.6,

"max_tokens": 100

```

}’ | jq

For eg: if I change the URL to `https://api.perplexity.ai/chat/completions` and the model , it works fine. Therefore, the issue is the way currently Spring AI send the request to the Perplexity .

Before digging further into the Spring AI request model, I am wondering whether anyone has really successfully been able to use Spring AI to use the agent API?

Just changing the URL to [https://api.perplexity.ai/v1/responses](https://api.perplexity.ai/v1/responses) as mentioned in the doc [OpenAI Compatibility - Perplexity](https://docs.perplexity.ai/docs/agent-api/openai-compatibility) also did not work.
