Package Exports
- devupai
- devupai/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (devupai) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
DEVUP AI — Official Node.js SDK
The official Node.js library for the DEVUP AI Inference Gateway.
Zero-dependency, edge-ready SDK — a seamless drop-in replacement for standard AI SDKs, built on native fetch.
📦 Installation
npm install devupai
# or
yarn add devupai
# or
pnpm add devupai🚀 Quick Start
Get your API key from the DEVUP AI Dashboard, then initialize the client:
import DevupAI from 'devupai';
const client = new DevupAI({
apiKey: process.env.DEVUP_API_KEY!, // Required
// baseURL: 'https://api.devupai.com/v1', // Optional — defaults to official endpoint
});
async function main() {
const response = await client.chat.completions.create({
model: 'devup-fast-v1',
messages: [
{ role: 'system', content: 'You are a helpful assistant.' },
{ role: 'user', content: 'Hello, how can you help me today?' },
],
});
console.log(response.choices[0].message.content);
}
main();🌊 Streaming
Full SSE streaming support via async iteration:
async function stream() {
const stream = await client.chat.completions.create({
model: 'devup-reasoning-v1',
messages: [{ role: 'user', content: 'Write a short poem about coding.' }],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? '');
}
}
stream();⚡ Error Handling
The SDK throws DevupAPIError on non-2xx responses, exposing the HTTP status code for granular handling:
import DevupAI, { DevupAPIError } from 'devupai';
try {
const response = await client.chat.completions.create({
model: 'devup-fast-v1',
messages: [{ role: 'user', content: 'Hello!' }],
});
} catch (error) {
if (error instanceof DevupAPIError) {
console.error(`API Error [${error.status}]: ${error.message}`);
// Handle 401, 429, 5xx, etc. as needed
} else {
throw error; // Re-throw unexpected errors
}
}🛠 Features
| Feature | Details |
|---|---|
| Zero Dependencies | Built entirely on the native fetch API |
| TypeScript First | Full type definitions included out of the box |
| OpenAI-Compatible | Drop-in replacement — same payload & response shape |
| Edge Ready | Works in Vercel Edge Functions & Cloudflare Workers |
| Streaming | First-class SSE support via async iterators |
📄 License
MIT © DEVUP AI