Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.
forked from openai/openai-node

The official Node.js / Typescript library for the OpenAI API

License

Notifications You must be signed in to change notification settings

withmartian/martian-node-v1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Martian Node API library

The Martin Node library is a drop in replacement for OpenAI package

Documentation

The API documentation can be found here.

Installation

npm i martian-node

Usage

import OpenAI from 'martian-node';

const openai = new OpenAI({
  apiKey: 'My Martian API Key', // defaults to process.env["MARTIAN_API_KEY"]
});

async function main() {
  const chatCompletion = await openai.chat.completions.create({
    messages: [{ role: 'user', content: 'Say this is a test' }],
    model: 'router',
    // If more than one model is specified, the router chooses the best among them
    // model: ['gpt-3.5-turbo', 'claude-v1'],
  });
}

main();

About

The official Node.js / Typescript library for the OpenAI API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 96.2%
  • JavaScript 2.4%
  • Shell 1.3%
  • Other 0.1%