GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - edgee-ai/typescript-sdk: The official Node.js / Typescript library for the Edgee AI Gateway

BranchesTags
Open more actions menu

Latest commit

 

History

31 Commits
31 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
example
example
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
eslint.config.js
eslint.config.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 
vitest.config.ts
vitest.config.ts
 
 

Repository files navigation

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: 'anthropic/claude-haiku-4-5',
  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: 'anthropic/claude-haiku-4-5',
  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)

// Access usage and compression info
if (response.usage) {
  console.log(`Tokens used: ${response.usage.total_tokens}`);
}

if (response.compression) {
  console.log(`Saved tokens: ${response.compression.saved_tokens}`);
  console.log(`Reduction: ${response.compression.reduction}%`);
  console.log(`Cost savings: $${(response.compression.cost_savings / 1_000_000).toFixed(3)}`);
  console.log(`Time: ${response.compression.time_ms} ms`);
}

Stream Method

The stream() method enables real-time streaming responses:

for await (const chunk of edgee.stream('anthropic/claude-haiku-4-5', '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
  • ✅ Compression info - Access token compression metrics in responses
  • ✅ Zero dependencies - Lightweight and fast

Documentation

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

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

www.edgee.cloud

Topics

aianthropicgatewayllmopenai

Resources

Readme
Apache-2.0 license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

2 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.