{"id":23970570,"url":"https://github.com/portkey-ai/portkey-node-sdk","last_synced_at":"2026-02-24T12:00:45.730Z","repository":{"id":200546546,"uuid":"692974198","full_name":"Portkey-AI/portkey-node-sdk","owner":"Portkey-AI","description":"Build reliable, secure, and production-ready AI apps easily.","archived":false,"fork":false,"pushed_at":"2025-10-16T13:23:53.000Z","size":6477,"stargazers_count":43,"open_issues_count":5,"forks_count":13,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-17T15:08:51.531Z","etag":null,"topics":["ai-gateway","llmops","llms","mlops","portkey"],"latest_commit_sha":null,"homepage":"https://portkey.ai/docs","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Portkey-AI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-09-18T05:03:53.000Z","updated_at":"2025-10-13T12:11:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"721f3cf2-7c09-4ea2-ac18-71605be2386b","html_url":"https://github.com/Portkey-AI/portkey-node-sdk","commit_stats":null,"previous_names":["portkey-ai/portkey-node-sdk"],"tags_count":47,"template":false,"template_full_name":null,"purl":"pkg:github/Portkey-AI/portkey-node-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Portkey-AI%2Fportkey-node-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Portkey-AI%2Fportkey-node-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Portkey-AI%2Fportkey-node-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Portkey-AI%2Fportkey-node-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Portkey-AI","download_url":"https://codeload.github.com/Portkey-AI/portkey-node-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Portkey-AI%2Fportkey-node-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29781193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T10:45:18.109Z","status":"ssl_error","status_checked_at":"2026-02-24T10:45:09.911Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-gateway","llmops","llms","mlops","portkey"],"created_at":"2025-01-07T02:07:11.381Z","updated_at":"2026-02-24T12:00:45.688Z","avatar_url":"https://github.com/Portkey-AI.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"https://github.com/Portkey-AI/portkey-node-sdk/assets/134934501/f55da786-f482-4bbd-b2be-0bc432eee5b9\" height=150\u003e\u003cbr /\u003e\n\n## Control Panel for AI Apps\n```bash\nnpm install portkey-ai\n```\n\u003c/div\u003e\n\n## Features\n\nThe Portkey SDK is built on top of the OpenAI SDK, allowing you to seamlessly integrate Portkey's advanced features while retaining full compatibility with OpenAI methods. With Portkey, you can enhance your interactions with OpenAI or any other OpenAI-like provider by leveraging robust monitoring, reliability, prompt management, and more features - without modifying much of your existing code.\n\n### AI Gateway\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003ctd width=50%\u003e\u003cb\u003eUnified API Signature\u003c/b\u003e\u003cbr /\u003eIf you've used OpenAI, you already know how to use Portkey with any other provider.\u003c/td\u003e\n        \u003ctd\u003e\u003cb\u003eInteroperability\u003c/b\u003e\u003cbr /\u003eWrite once, run with any provider. Switch between any model from_any provider seamlessly. \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd width=50%\u003e\u003cb\u003eAutomated Fallbacks \u0026 Retries\u003c/b\u003e\u003cbr /\u003eEnsure your application remains functional even if a primary service fails.\u003c/td\u003e\n        \u003ctd\u003e\u003cb\u003eLoad Balancing\u003c/b\u003e\u003cbr /\u003eEfficiently distribute incoming requests among multiple models.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd width=50%\u003e\u003cb\u003eSemantic Caching\u003c/b\u003e\u003cbr /\u003eReduce costs and latency by intelligently caching results.\u003c/td\u003e\n        \u003ctd\u003e\u003cb\u003eVirtual Keys\u003c/b\u003e\u003cbr /\u003eSecure your LLM API keys by storing them in Portkey vault and using disposable virtual keys.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd width=50%\u003e\u003cb\u003eRequest Timeouts\u003c/b\u003e\u003cbr /\u003eManage unpredictable LLM latencies effectively by setting custom request timeouts on requests.\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n### Observability\n\u003ctable width=100%\u003e\n    \u003ctr\u003e\n        \u003ctd width=50%\u003e\u003cb\u003eLogging\u003c/b\u003e\u003cbr /\u003eKeep track of all requests for monitoring and debugging.\u003c/td\u003e\n        \u003ctd width=50%\u003e\u003cb\u003eRequests Tracing\u003c/b\u003e\u003cbr /\u003eUnderstand the journey of each request for optimization.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd width=50%\u003e\u003cb\u003eCustom Metadata\u003c/b\u003e\u003cbr /\u003eSegment and categorize requests for better insights.\u003c/td\u003e\n        \u003ctd width=50%\u003e\u003cb\u003eFeedbacks\u003c/b\u003e\u003cbr /\u003eCollect and analyse weighted feedback on requests from users.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd width=50%\u003e\u003cb\u003eAnalytics\u003c/b\u003e\u003cbr /\u003eTrack your app \u0026 LLM's performance with 40+ production-critical metrics in a single place.\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e \n\n## **Usage**\n#### Prerequisites\n1. [Sign up on Portkey](https://app.portkey.ai/) and grab your Portkey API Key\n2. Add your [OpenAI key](https://platform.openai.com/api-keys) to Portkey's Virtual Keys page and keep it handy\n\n```bash\n# Installing the SDK\n\n$ npm install portkey-ai\n$ export PORTKEY_API_KEY=\"PORTKEY_API_KEY\"\n```\n\n#### Making a Request to OpenAI\n* Portkey fully adheres to the OpenAI SDK signature. You can instantly switch to Portkey and start using our production features right out of the box. \u003cbr /\u003e\n* Just replace `import OpenAI from 'openai'` with `import Portkey from 'portkey-ai'`:\n```js\nimport Portkey from 'portkey-ai';\n\nconst portkey = new Portkey({\n    virtualKey: \"VIRTUAL_KEY\"\n})\n\nasync function main() {\n    const chatCompletion = await portkey.chat.completions.create({\n        messages: [{ role: 'user', content: 'Say this is a test' }],\n        model: 'gpt-4',\n    });\n\n    console.log(chatCompletion.choices);\n};\n\nmain();\n```\n\n#### [Check out Portkey docs for the full list of supported providers](https://portkey.ai/docs/welcome/what-is-portkey#ai-providers-supported)\n\n\u003ca href=\"https://twitter.com/intent/follow?screen_name=portkeyai\"\u003e\u003cimg src=\"https://img.shields.io/twitter/follow/portkeyai?style=social\u0026logo=twitter\" alt=\"follow on Twitter\"\u003e\u003c/a\u003e\n\u003ca href=\"https://discord.gg/sDk9JaNfK8\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/discord/1143393887742861333?logo=discord\" alt=\"Discord\"\u003e\u003c/a\u003e\n\n#### Contributing\nGet started by checking out Github issues. Email us at support@portkey.ai or just ping on Discord to chat.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fportkey-ai%2Fportkey-node-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fportkey-ai%2Fportkey-node-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fportkey-ai%2Fportkey-node-sdk/lists"}