1- ![ eternalai.org] ( ./assets/banner.png )
2-
3-
41# @eternalai-org/sdk
52
63Official TypeScript SDK for ** EternalAI** - The next-generation API platform for AI applications. Access hundreds of AI models through one unified interface with cashback rewards on every API call.
74
85[ ![ TypeScript] ( https://img.shields.io/badge/TypeScript-5.3-blue.svg )] ( https://www.typescriptlang.org/ )
96[ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-yellow.svg )] ( ./LICENSE )
107
11- ## Why EternalAI?
12-
13- - 🚀 ** Build Faster** - One API key, one unified interface for hundreds of AI models and APIs
14- - 💰 ** Build Cheaper** - Earn cashback on every API call — use more, earn more (up to 4.96% rewards)
15- - ♾️ ** Build Unlimited** - No rate limits, no restrictions — scale from OpenAI to any AI provider effortlessly
16- - 🌐 ** Multiple AI Providers** - Access OpenAI, Claude, Grok, Gemini, and more through a single API
17- - 💳 ** Credit System** - Buy credits once, use with any AI model or API service
18-
19- ## SDK Features
20-
21- - 📘 ** TypeScript First** - Full type safety and IntelliSense support
22- - 🌊 ** Streaming Support** - Real-time responses using async iterators
23- - 🎯 ** OpenAI Compatible** - Drop-in replacement with familiar message format
24- - 📦 ** Dual Module** - ESM and CommonJS support for maximum compatibility
25- - ⚡️ ** Lightweight** - Minimal dependencies, optimized bundle size
26- - ✅ ** Well Tested** - Comprehensive test suite with 100% code coverage
27- - 🔒 ** Type Safe** - Strict TypeScript compilation with full type inference
28- - 🛡️ ** Error Handling** - Robust error handling with descriptive messages
8+ ## Quick Start
299
30- ## Supported AI Providers
10+ ``` typescript
11+ import { EternalAPI } from ' @eternalai-org/sdk' ;
3112
32- Access multiple AI providers through one unified API:
13+ const eternalApi = new EternalAPI ({ apiKey: ' your-api-key ' });
3314
15+ const result = await eternalApi .chat .send ({
16+ messages: [
17+ {
18+ role: ' user' ,
19+ content: ' Hello, how are you?' ,
20+ },
21+ ],
22+ model: ' openai/gpt-5.1' ,
23+ stream: true , // optional
24+ });
3425
35- - ** Uncensored AI** - Open and uncensored models
36- - ** OpenAI** - GPT-4, GPT-3.5, and more
37- - ** Claude** - Anthropic's Claude models
38- - ** Grok** - xAI's Grok models
39- - ** Gemini** - Google's Gemini models
40- - ** And more** - Tavily, Qwen, Wan, Nano Banana, and growing
26+ for await (const chunk of result ) {
27+ console .log (chunk .choices [0 ].delta .content );
28+ }
29+ ```
4130
4231## Installation
4332
@@ -64,64 +53,36 @@ npm install git+https://github.com/eternalai-org/sdk.git#v0.1.0
64533 . Get your API key from the dashboard
65544 . Start building and earning cashback!
6655
67- ## Quick Start
68-
69- ### Basic Usage (Streaming)
70-
71- ``` typescript
72- import { EternalAPI } from ' @eternalai-org/sdk' ;
73-
74- const eternalApi = new EternalAPI ({ apiKey: ' your-api-key' });
75-
76- const result = await eternalApi .chat .send ({
77- messages: [
78- {
79- role: ' user' ,
80- content: ' Hello, how are you?' ,
81- },
82- ],
83- model: ' openai/gpt-5.1' ,
84- stream: true ,
85- });
86-
87- for await (const chunk of result ) {
88- console .log (chunk .choices [0 ].delta .content );
89- }
90- ```
56+ ## Why EternalAI?
9157
92- ### Non-Streaming Usage
58+ - 🚀 ** Build Faster** - One API key, one unified interface for hundreds of AI models and APIs
59+ - 💰 ** Build Cheaper** - Earn cashback on every API call — use more, earn more (up to 4.96% rewards)
60+ - ♾️ ** Build Unlimited** - No rate limits, no restrictions — scale from OpenAI to any AI provider effortlessly
61+ - 🌐 ** Multiple AI Providers** - Access OpenAI, Claude, Grok, Gemini, and more through a single API
62+ - 💳 ** Credit System** - Buy credits once, use with any AI model or API service
9363
94- ``` typescript
95- import { EternalAPI } from ' @eternalai-org/sdk' ;
64+ ## SDK Features
9665
97- const eternalApi = new EternalAPI ({ apiKey: ' your-api-key' });
66+ - 📘 ** TypeScript First** - Full type safety and IntelliSense support
67+ - 🌊 ** Streaming Support** - Real-time responses using async iterators
68+ - 🎯 ** OpenAI Compatible** - Drop-in replacement with familiar message format
69+ - 📦 ** Dual Module** - ESM and CommonJS support for maximum compatibility
70+ - ⚡️ ** Lightweight** - Minimal dependencies, optimized bundle size
71+ - ✅ ** Well Tested** - Comprehensive test suite with 100% code coverage
72+ - 🔒 ** Type Safe** - Strict TypeScript compilation with full type inference
73+ - 🛡️ ** Error Handling** - Robust error handling with descriptive messages
9874
99- const result = await eternalApi .chat .send ({
100- messages: [
101- {
102- role: ' user' ,
103- content: ' What is the capital of France?' ,
104- },
105- ],
106- model: ' openai/gpt-5.1' ,
107- stream: false , // or omit this line
108- });
75+ ## Supported AI Providers
10976
110- console .log (result .choices [0 ].message .content );
111- ```
77+ Access multiple AI providers through one unified API:
11278
113- ### System Prompts
11479
115- ``` typescript
116- const result = await eternalApi .chat .send ({
117- messages: [
118- { role: ' system' , content: ' You are a helpful assistant.' },
119- { role: ' user' , content: ' Explain quantum computing' },
120- ],
121- model: ' openai/gpt-5.1' ,
122- stream: true ,
123- });
124- ```
80+ - ** Uncensored AI** - Open and uncensored models
81+ - ** OpenAI** - GPT-4, GPT-3.5, and more
82+ - ** Claude** - Anthropic's Claude models
83+ - ** Grok** - xAI's Grok models
84+ - ** Gemini** - Google's Gemini models
85+ - ** And more** - Tavily, Qwen, Wan, Nano Banana, and growing
12586
12687## API Reference
12788
0 commit comments