Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danitechid/chatgpt-api
ChatGPT API - TypeScript/JavaScript. ChatGPT API ini ditenagai oleh: https://daniapi.biz.id
https://github.com/danitechid/chatgpt-api
chatgpt-api openai openai-api
Last synced: about 2 months ago
JSON representation
ChatGPT API - TypeScript/JavaScript. ChatGPT API ini ditenagai oleh: https://daniapi.biz.id
- Host: GitHub
- URL: https://github.com/danitechid/chatgpt-api
- Owner: danitechid
- License: mit
- Created: 2023-11-11T03:28:01.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-15T14:40:02.000Z (about 1 year ago)
- Last Synced: 2024-11-18T20:16:52.378Z (2 months ago)
- Topics: chatgpt-api, openai, openai-api
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@danitech/chatgpt-api
- Size: 15.6 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# ChatGPT API - TypeScript/JavaScript
ChatGPT API ini ditenagai oleh: daniapi.biz.id## Instalasi
### Menggunakan Npm
```bash
npm i @danitech/chatgpt-api
```### Atau Menggunakan Yarn
```bash
yarn add @danitech/chatgpt-api
```## Cara Menggunakan
### Import Module @danitech/chatgpt-api
#### CJS
```javascript
const chatGPTAPI = require('@danitech/chatgpt-api');
```#### ESM
```javascript
import chatGPTAPI from '@danitech/chatgpt-api';
```### Contoh Kode Lengkap
```javascript
const { models } = chatGPTAPI;
const { chatGPT3, chatGPT35, chatGPT4 } = models;// GPT-3 model
(async () => {
try {
const response = await chatGPT3('Hello, AI.');
console.log('ChatGPT-3:', response);
} catch (error) {
console.error('Error:', error);
}
})();// GPT-3.5 model
(async () => {
try {
const response = await chatGPT35('Hello, AI.');
console.log('ChatGPT-3.5:', response);
} catch (error) {
console.error('Error:', error);
}
})();// GPT-4 model
(async () => {
try {
const response = await chatGPT4('Hello, AI.');
console.log('ChatGPT-4:', response);
} catch (error) {
console.error('Error:', error);
}
})();
```### Hasil
```text
ChatGPT-3: Hello! How can I assist you today?
ChatGPT-3.5: Hello! How can I assist you today?
ChatGPT-4: Hello! How can I assist you today?
```## Informasi
* Pembuat / Pengembang: Dani Ramdani (Dani Techno.) - FullStack Engineer
* Kontak Pembuat / Pengembang: 0895 1254 5999 (WhatsApp), [email protected] (Email)## Terimakasih Kepada
* Dani Techno. - FullStack Engineer (Pembuat / Pengembang)
* daniapi.biz.id (Penyedia JSON-API)