martian-node
TypeScript icon, indicating that this package has built-in type declarations

4.24.0 • Public • Published

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();

Readme

Keywords

none

Package Sidebar

Install

npm i martian-node

Weekly Downloads

175

Version

4.24.0

License

Apache-2.0

Unpacked Size

1.71 MB

Total Files

518

Last publish

Collaborators

  • uyasher