Miscellaneous
JavaScript Library
Node.js library for interacting with NanoGPT API
NanoGPTJS
NanoGPTJS is a Node.js library designed to interact with NanoGPT’s API. This library provides an easy way to integrate NanoGPT’s capabilities into your JavaScript applications.
Overview
The NanoGPT service enables pay-per-prompt interaction with chat and image generation models. You will need a prefilled NanoGPT wallet and API key to use this library effectively.
Installation
You can install the library using npm:
Basic Usage
Features
- Chat Completions: Generate text responses using various AI models
- Image Generation: Create images from text prompts
- Model Selection: Choose from a wide range of available models
- Balance Management: Check your NanoGPT balance and manage transactions
API Methods
Chat
Generate Image
Check Balance
Error Handling
The library provides robust error handling to manage API response errors: