Lightweight, type-safe TypeScript SDK for the Edgee AI Gateway.
npm install edgeeimport Edgee from 'edgee';
const edgee = new Edgee("your-api-key");
// Send a simple request
const response = await edgee.send({
model: 'gpt-4o',
input: 'What is the capital of France?',
});
console.log(response.text);
// "The capital of France is Paris."The send() method makes non-streaming chat completion requests:
const response = await edgee.send({
model: 'gpt-4o',
input: 'Hello, world!',
});
// Access response
console.log(response.text); // Text content
console.log(response.finishReason); // Finish reason
console.log(response.toolCalls); // Tool calls (if any)The stream() method enables real-time streaming responses:
for await (const chunk of edgee.stream('gpt-4o', 'Tell me a story')) {
if (chunk.text) {
process.stdout.write(chunk.text);
}
if (chunk.finishReason) {
console.log(`\nFinished: ${chunk.finishReason}`);
}
}- ✅ Type-safe - Full TypeScript support with comprehensive types
- ✅ OpenAI-compatible - Works with any model supported by Edgee
- ✅ Streaming - Real-time response streaming
- ✅ Tool calling - Full support for function calling
- ✅ Flexible input - Accept strings or structured objects
- ✅ Zero dependencies - Lightweight and fast
For complete documentation, examples, and API reference, visit:
👉 Official TypeScript SDK Documentation
The documentation includes:
- Configuration guide - Multiple ways to configure the SDK
- Send method - Complete guide to non-streaming requests
- Stream method - Streaming responses guide
- Tools - Function calling guide
Licensed under the Apache License, Version 2.0. See LICENSE for details.