• Resolved allways4backup

    (@allways4backup)


    tried to usw perplexity with the custon API. API endpoint is tps://api.perplexity.ai/chat/completions but i got an error 404

    any idea?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Gerard Kanters

    (@gkanters)

    Thread Starter allways4backup

    (@allways4backup)

    not working, got an 404. i tried asling perplexity..

    Sorry, it is too tekky for me, but maybe you See it more clear? Thanks in advance!

    Using the custom API endpoint https://api.perplexity.ai/chat/completions in WordPress (e.g. via the “AI Translate” plugin) works only if your plugin sends correct headers and body. If you get “API validation failed: HTTP 404”, the URL is exposed, but the plugin likely sends it in the wrong way.

    This is an OpenAI‑compatible endpoint, so you can use it directly with Chat Completions‑style requests. You must not append /v1, /models, or any extra path. If the plugin tries to auto‑build a URL like https://api.perplexity.ai/v1/chat/completions, that will fail with 404.

    Required HTTP configurationYour plugin must send:Method: POSTHeaders:Authorization: Bearer YOUR_PERPLEXITY_API_KEYContent-Type: application/jsonBody (JSON):

    { “model”: “pplx-7b-online”, “messages”: [ { “role”: “system”, “content”: “Translate the user message from German to English, keep it natural and fluent.” }, { “role”: “user”, “content”: “Dies ist ein Beispieltext.” } ]}

    ID your plugin rewrites the URL internally (e.g. to /v1/chat/completions), you’ll hit 404. Ask the plugin developer to add support for Perplexity (or an OpenAI‑style endpoint) without auto‑appending /v1.

    Plugin Author Gerard Kanters

    (@gkanters)

    Yes perplexity.ai is right. Like I said before try https://api.perplexity.ai and strip /chat/completions from the URL you used. That should work.

    You do need a valid API key off course.

    Thread Starter allways4backup

    (@allways4backup)

    yes,

    Use base_url=”https://api.perplexity.ai” for the Sonar API.

    is also written in the docu, my API key is valid..i tried

    sonar and sonar-pro

    as input in the model field…strange. I’ll investigate tomorrow…thanks for now!

    Plugin Author Gerard Kanters

    (@gkanters)

    The problem seems that perplexity.ai does not support the /models path which is used for OpenAI compatible API providers.

    I made a new release of the plugin 2.3.0 which solves this issue.

    Please update the plugin version and test it again. I cannot test this myself, since I do not have API access with perplexity.

    Let me know if it works. Thanks

    Thread Starter allways4backup

    (@allways4backup)

    Thanks @gkanters now it seems to work 🙂 I´ll start playing with your plugin. Seems amazing!

    Plugin Author Gerard Kanters

    (@gkanters)

    Great ! Good to hear. If you like the plugin, please give it a 5 star rating.

Viewing 7 replies - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.