Skip to content

edgee-cloud/typescript-sdk

Edgee TypeScript SDK

Lightweight, type-safe TypeScript SDK for the Edgee AI Gateway.

npm version License

Installation

npm install edgee

Quick Start

import 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."

Send Method

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)

Stream Method

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}`);
  }
}

Features

  • 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

Documentation

For complete documentation, examples, and API reference, visit:

👉 Official TypeScript SDK Documentation

The documentation includes:

License

Licensed under the Apache License, Version 2.0. See LICENSE for details.

About

The official Node.js / Typescript library for the Edgee AI Gateway

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •