{"id":17026096,"url":"https://github.com/thencc/gpts","last_synced_at":"2026-01-30T00:33:28.589Z","repository":{"id":57252808,"uuid":"355546967","full_name":"thencc/gpts","owner":"thencc","description":"typescript wrapper for gpt-3 api","archived":false,"fork":false,"pushed_at":"2022-03-02T06:54:49.000Z","size":233,"stargazers_count":17,"open_issues_count":0,"forks_count":9,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-14T07:32:12.687Z","etag":null,"topics":["backend","frontend","gpt","gpt-3","gpts","javascript","openai","ts","typescript","typescript-wrapper"],"latest_commit_sha":null,"homepage":"","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/thencc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-07T13:02:37.000Z","updated_at":"2023-05-14T01:23:41.000Z","dependencies_parsed_at":"2022-08-31T22:20:46.717Z","dependency_job_id":null,"html_url":"https://github.com/thencc/gpts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thencc%2Fgpts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thencc%2Fgpts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thencc%2Fgpts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thencc%2Fgpts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thencc","download_url":"https://codeload.github.com/thencc/gpts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239997443,"owners_count":19731406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["backend","frontend","gpt","gpt-3","gpts","javascript","openai","ts","typescript","typescript-wrapper"],"created_at":"2024-10-14T07:30:28.117Z","updated_at":"2026-01-30T00:33:28.546Z","avatar_url":"https://github.com/thencc.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# gpts = [gpt-3](https://openai.com/blog/openai-api/) + [typescript](https://www.typescriptlang.org/)\n\ntypescript wrapper for gpt-3 api\n\n---\n\n## example\n\n```ts\nimport { GpTs } from 'gpts';\nconst brain = new GpTs(OPENAI_APIKEY); // dont publish your api key!\n\nconst thoughts = brain.completion({\n\tengineId: 'ada',\n\tprompt: 'whats for lunch?',\n});\n\nconsole.log(thoughts.choices[0].text); // \"maybe a banana?\"\n```\n\nalso see [demo/index.ts](https://github.com/thencc/gpts/blob/main/demo/index.ts) (need to insert your api key to run)\n\n---\n\n## install\n\n### [npm](https://www.npmjs.com/package/gpts)\n\n`npm i gpts`\n\n### [github](https://github.com/thencc/gpts)\n\n`package.json`\n\n```json\n\t\"dependencies\": {\n\t\t\"gpts\": \"thencc/gpts\",\n\t\t...\n\t},\n```\n\n---\n\n## features\n\n-   engines\n    -   list ✅\n    -   retreive ✅\n-   completions\n    -   create ✅\n    -   stream ⚠️ (TODO)\n-   searches\n    -   create ✅\n-   classifications\n    -   create ✅\n-   answers\n    -   create ✅\n-   files\n    -   list ✅\n    -   upload ✅ (server-side only)\n    -   retrieve ✅\n    -   delete ✅\n-   embeddings\n    -   create ✅\n-   fine-tunes\n    -   prepare dataset ⚠️ (TODO)\n    -   upload dataset ⚠️ (TODO)\n    -   check upload results ⚠️ (TODO)\n\n---\n\n## notes\n\n### general\n\n-   uses openai's REST api\n-   for the [/classifications](https://beta.openai.com/docs/api-reference/classifications/create) and [/answers](https://beta.openai.com/docs/api-reference/answers/create) endpoints, openai seems to switch the syntax from `engineId` -\u003e `model` so if you specify both in the `options` argument, `options.model` takes precedence\n\n### client-side use\n\n-   this library works client + server side using [axios](https://github.com/axios/axios) for http requests\n-   DO NOT share your api key in public client-side frontend code\n-   one way to hide your openai api key for client-side use is by hosting an api wrapper endpoint that enforces your own authentication, then updating the origin this library looks to use like the below.\n\napi wrapper example:\n\n```ts\nimport { GpTs } from 'gpts';\n/*\n    gives your api wrapper authorization like this:\n        headers: {\n            'Authorization': 'Bearer ASuperSecretPassword'\n        }\n\n    the constructor takes 2 arguments\n        1. the authorization bearer value\n        2. the api origin\n*/\nconst brain = new GpTs('ASuperSecretPassword', 'https://company.api-wrappers.io/gpt3');\n```\n\n---\n\n## TODO\n\n-   support completion streaming SSE (https://beta.openai.com/docs/api-reference/completions/create-via-get)\n-   support fine-tuning management (https://beta.openai.com/docs/guides/fine-tuning/preparing-your-dataset)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthencc%2Fgpts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthencc%2Fgpts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthencc%2Fgpts/lists"}