Skip to main content

JavaScript SDK

@nanogpt/sdk is NanoGPT’s official client and works from plain JavaScript. It is ESM-only and needs Node.js 22 or later, or another runtime with Fetch and Web Streams.
Save this as a .mjs file, or set "type": "module" in your package.json. See the TypeScript SDK page for the full list of methods, streaming and error handling.

Other packages

nanogptjs, nanogpt-client and the npm package named nanogpt aren’t published or reviewed by NanoGPT. They would receive your API key, so check them yourself before using them.