[GH-ISSUE #74] Feature request: Perplexity.ai API support #68

Closed
opened 2026-03-02 11:46:14 +03:00 by kerem · 6 comments
Owner

Originally created by @ghost on GitHub (Apr 2, 2024).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/74

Hi,
Thank you for developing this amazing software.

I am currently using Perplexity PRO, which provides each user with $5 in API credits on a monthy basis. It would be great to use this as an OpenAI API alternative.

Keep up the good work!

Originally created by @ghost on GitHub (Apr 2, 2024). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/74 Hi, Thank you for developing this amazing software. I am currently using Perplexity PRO, which provides each user with $5 in API credits on a monthy basis. It would be great to use this as an OpenAI API alternative. Keep up the good work!
kerem closed this issue 2026-03-02 11:46:14 +03:00
Author
Owner

@MohamedBassem commented on GitHub (Apr 2, 2024):

Hi, looking at preplexity’s api docs, it seems that they have an openai compatible. This means that hoarder will support it out of the box. Just set ‘OPENAI_BASE_URL=https://api.perplexity.ai’ and you’re probably good to go. I’m interested if this works (to add it to the docs), please give it a try and let me know how it goes :)

<!-- gh-comment-id:2032950160 --> @MohamedBassem commented on GitHub (Apr 2, 2024): Hi, looking at preplexity’s api docs, it seems that they have an openai compatible. This means that hoarder will support it out of the box. Just set ‘OPENAI_BASE_URL=https://api.perplexity.ai’ and you’re probably good to go. I’m interested if this works (to add it to the docs), please give it a try and let me know how it goes :)
Author
Owner

@MohamedBassem commented on GitHub (Apr 4, 2024):

I'll close this for now and don't hesitate to reopen if you faced any issues.

<!-- gh-comment-id:2036723765 --> @MohamedBassem commented on GitHub (Apr 4, 2024): I'll close this for now and don't hesitate to reopen if you faced any issues.
Author
Owner

@firefoot007 commented on GitHub (Oct 24, 2024):

Hi, thanks for the awesome hoarding tool. I also have perplexity pro. While I tried this but it was not working. Below is the error I am getting:

2024-10-24T14:32:47.772Z info: [inference][1518] Starting an inference job for bookmark with id "ds63wmjiy5x75v4ejnz7zruw"
2024-10-24T14:32:47.839Z info: [inference][1518] Starting an inference job for bookmark with id "ds63wmjiy5x75v4ejnz7zruw"
2024-10-24T14:32:47.890Z info: [inference][1518] Starting an inference job for bookmark with id "ds63wmjiy5x75v4ejnz7zruw"
2024-10-24T14:32:47.941Z info: [inference][1518] Starting an inference job for bookmark with id "ds63wmjiy5x75v4ejnz7zruw"
2024-10-24T14:32:47.974Z error: [inference][1518] inference job failed: Error: 400 ["At body -> response_format -> ResponseFormatText -> type: Input should be 'text'", "At body -> response_format -> ResponseFormatJSONSchema -> type: Input should be 'json_schema'", "At body -> response_format -> ResponseFormatJSONSchema -> json_schema: Field required", "At body -> response_format -> ResponseFormatRegex -> type: Input should be 'regex'", "At body -> response_format -> ResponseFormatRegex -> regex: Field required"]
Error: 400 ["At body -> response_format -> ResponseFormatText -> type: Input should be 'text'", "At body -> response_format -> ResponseFormatJSONSchema -> type: Input should be 'json_schema'", "At body -> response_format -> ResponseFormatJSONSchema -> json_schema: Field required", "At body -> response_format -> ResponseFormatRegex -> type: Input should be 'regex'", "At body -> response_format -> ResponseFormatRegex -> regex: Field required"]
at APIError.generate (/app/apps/workers/node_modules/.pnpm/openai@4.67.1_zod@3.22.4/node_modules/openai/error.js:45:20)
at OpenAI.makeStatusError (/app/apps/workers/node_modules/.pnpm/openai@4.67.1_zod@3.22.4/node_modules/openai/core.js:291:33)
at OpenAI.makeRequest (/app/apps/workers/node_modules/.pnpm/openai@4.67.1_zod@3.22.4/node_modules/openai/core.js:335:30)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async OpenAIInferenceClient.inferFromText (/app/apps/workers/inference.ts:2:1934)
at async inferTagsFromText (/app/apps/workers/openaiWorker.ts:6:3111)
at async inferTags (/app/apps/workers/openaiWorker.ts:6:3334)
at async Object.runOpenAI [as run] (/app/apps/workers/openaiWorker.ts:6:6764)
at async Runner.runOnce (/app/apps/workers/node_modules/.pnpm/@hoarder+queue@file+packages+queue/node_modules/@hoarder/queue/runner.ts:2:2567)

<!-- gh-comment-id:2435476636 --> @firefoot007 commented on GitHub (Oct 24, 2024): Hi, thanks for the awesome hoarding tool. I also have perplexity pro. While I tried this but it was not working. Below is the error I am getting: 2024-10-24T14:32:47.772Z info: [inference][1518] Starting an inference job for bookmark with id "ds63wmjiy5x75v4ejnz7zruw" 2024-10-24T14:32:47.839Z info: [inference][1518] Starting an inference job for bookmark with id "ds63wmjiy5x75v4ejnz7zruw" 2024-10-24T14:32:47.890Z info: [inference][1518] Starting an inference job for bookmark with id "ds63wmjiy5x75v4ejnz7zruw" 2024-10-24T14:32:47.941Z info: [inference][1518] Starting an inference job for bookmark with id "ds63wmjiy5x75v4ejnz7zruw" 2024-10-24T14:32:47.974Z error: [inference][1518] inference job failed: Error: 400 ["At body -> response_format -> ResponseFormatText -> type: Input should be 'text'", "At body -> response_format -> ResponseFormatJSONSchema -> type: Input should be 'json_schema'", "At body -> response_format -> ResponseFormatJSONSchema -> json_schema: Field required", "At body -> response_format -> ResponseFormatRegex -> type: Input should be 'regex'", "At body -> response_format -> ResponseFormatRegex -> regex: Field required"] Error: 400 ["At body -> response_format -> ResponseFormatText -> type: Input should be 'text'", "At body -> response_format -> ResponseFormatJSONSchema -> type: Input should be 'json_schema'", "At body -> response_format -> ResponseFormatJSONSchema -> json_schema: Field required", "At body -> response_format -> ResponseFormatRegex -> type: Input should be 'regex'", "At body -> response_format -> ResponseFormatRegex -> regex: Field required"] at APIError.generate (/app/apps/workers/node_modules/.pnpm/openai@4.67.1_zod@3.22.4/node_modules/openai/error.js:45:20) at OpenAI.makeStatusError (/app/apps/workers/node_modules/.pnpm/openai@4.67.1_zod@3.22.4/node_modules/openai/core.js:291:33) at OpenAI.makeRequest (/app/apps/workers/node_modules/.pnpm/openai@4.67.1_zod@3.22.4/node_modules/openai/core.js:335:30) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async OpenAIInferenceClient.inferFromText (/app/apps/workers/inference.ts:2:1934) at async inferTagsFromText (/app/apps/workers/openaiWorker.ts:6:3111) at async inferTags (/app/apps/workers/openaiWorker.ts:6:3334) at async Object.runOpenAI [as run] (/app/apps/workers/openaiWorker.ts:6:6764) at async Runner.runOnce (/app/apps/workers/node_modules/.pnpm/@hoarder+queue@file+packages+queue/node_modules/@hoarder/queue/runner.ts:2:2567)
Author
Owner

@sparkyfen commented on GitHub (Nov 6, 2024):

https://www.perplexity.ai/hub/blog/introducing-pplx-api - looks like the example doesn't include response_format in the request so this would need to be optionally removed from the call if the provider is Perplexity. (P.S. I've having the same issue as @firefoot007)

<!-- gh-comment-id:2459079088 --> @sparkyfen commented on GitHub (Nov 6, 2024): https://www.perplexity.ai/hub/blog/introducing-pplx-api - looks like the example doesn't include `response_format` in the request so this would need to be optionally removed from the call if the provider is Perplexity. (P.S. I've having the same issue as @firefoot007)
Author
Owner

@MohamedBassem commented on GitHub (Feb 2, 2025):

Seems like people got it working in another issue: https://github.com/hoarder-app/hoarder/issues/462#issuecomment-2629444857

<!-- gh-comment-id:2629445846 --> @MohamedBassem commented on GitHub (Feb 2, 2025): Seems like people got it working in another issue: https://github.com/hoarder-app/hoarder/issues/462#issuecomment-2629444857
Author
Owner

@MohamedBassem commented on GitHub (Mar 2, 2025):

This hopefully should be fixed in the nightly build (ready in 15mins), please check my comment on https://github.com/hoarder-app/hoarder/issues/462#issuecomment-2692698170.

<!-- gh-comment-id:2692699308 --> @MohamedBassem commented on GitHub (Mar 2, 2025): This hopefully should be fixed in the nightly build (ready in 15mins), please check my comment on https://github.com/hoarder-app/hoarder/issues/462#issuecomment-2692698170.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#68
No description provided.