SDK
The NetMind Python API Library is the official Python client for NetMind's API platform, providing a convenient way for interacting with the REST APIs and enables easy integrations with Python 3.10+ applications with easy to use synchronous and asynchronous clients.
Installation
To install NetMind Python Library from PyPI, simply run:
pip install --upgrade netmindSetting up API Key
You will need to create an account with NetMind.ai to obtain a NetMind API Key.
Once logged in to the NetMind Playground, you can find available API keys in Dashboard.
Setting environment variable
export NETMIND_API_KEY=<your_netmind_api_key>Using the client
from netmind import NetMind
client = NetMind(api_key="your_netmind_api_key")This repo contains both a Python Library and a CLI. We'll demonstrate how to use both below.
Usage – Python Client
Chat Completions
👉 Supports plain text and multi-modal messages. Use
contentarray withtype: "text"andtype: "image_url"for image input.
The chat completions API supports three types of content:
Plain text messages using the
contentfield directlyMulti-modal messages with images using
type: "image_url"
When using multi-modal content, the content field becomes an array of content objects, each with its own type and corresponding data.
Streaming
👉 Use
stream=Truefor incremental, real-time responses.
Async usage
👉 Use the
AsyncNetMindclass for asynchronous environments. All async methods requireawaitand work well with frameworks like FastAPI.
Embeddings
👉 Supports list inputs and returns embeddings for each entry.
Async usage
Files
👉 Required for async file-based operations like
aparse(). Upload local files to get a downloadable URL viaclient.files.create().
Async usag
ParsePro
✅ Sync method
parse()supports both local files and URLs.
Async Task usage
⚠️ Async parsing requires a public URL. Local files must be uploaded first. Use
client.files.create()to generate a usable URL.
ParsePro Async usage
ℹ️ Notes
✅
parse()(sync) supports both URLs and local files.⚠️
aparse()and all async parsing require a public URL – local files must be uploaded first.✅ Use
client.files.create()to upload files and get a downloadable URL.🧠 Async clients (
AsyncNetMind) are ideal for integration into event loops or async workflows.🎯 Multi-modal chat input must use structured
contentarrays.
Code interpreter
simple usage
file usage
generate picture
Last updated
Was this helpful?