NanoGPT SDK
A clean Python client for the NanoGPT API.
Supports text completions, chat completions, image and video generation, and model listing.
Installation
pip install nanogpt-sdk
Quickstart
from nanogpt import Client, BearerAuth, endpoints
# Initialize
client = Client(BearerAuth('YOUR_API_KEY'))
# Create a chat completion
response = endpoints.chat.create_completion(
client,
model = 'gpt-nano-1',
messages = [
{'role': 'system', 'content': 'You are a helpful assistant.'},
{'role': 'user', 'content': 'Why is the sky blue?'}
],
temperature = 0.7,
max_tokens = 256
)
# Print generated text
print(response['choices'][0]['message']['content'])
Endpoints
| Module | Description |
|---|---|
endpoints.chat |
Create chat completions (OpenAI-style message schema) |
endpoints.completions |
Generate free-form text completions |
endpoints.models |
List available public or subscription models |
endpoints.images |
Generate images from text prompts |
endpoints.videos |
Generate videos from text prompts |
Development
git clone https://github.com/kalenmcmillan/nanogpt-sdk.git
cd nanogpt-sdk
python -m pip install -e .
pytest
License
MIT License © 2025 Kalen McMillan
Metadata
Release files for nanogpt-sdk 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nanogpt_sdk-0.1.1.tar.gz | 6.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nanogpt_sdk-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.2 kB
Release files / nanogpt_sdk-0.1.1.tar.gz
| Download URL | nanogpt_sdk-0.1.1.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5372bd88fdb56d6c7d8901802bef2e400fe61193ad8e81af599410c0e7c559b6
|
|
BLAKE2b-256 checksum How to use checksums |
42b89d84fabe350b2d0f2d96873e36b038bfe4fa68436411515ea681f461138d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / nanogpt_sdk-0.1.1-py3-none-any.whl
| Download URL | nanogpt_sdk-0.1.1-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
75bc4c727e22c851370dda3c50c235867a81cf3d5ec42155c98dd64e546ecd60
|
|
BLAKE2b-256 checksum How to use checksums |
c237f189b941e62f8591006812876349769ccb949555210d8f6a7438f7d6429a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|