Skip to main content

Official Python SDK for instanode.dev — zero-setup Postgres + webhooks for AI agents

Project description

instanode

Official Python SDK for instanode.dev — zero-setup Postgres databases and webhook receivers for AI agents and humans. No Docker, no account for the free tier.

pip install instanode

Quickstart

import instanode

client = instanode.Client()

# Postgres (pgvector pre-installed). Free tier: 10 MB / 2 connections / 24h TTL.
db = client.provision_database(name="my-app")
print(db.connection_url)   # postgres://…@pg.instanode.dev:5432/db_…

# Webhook receiver. Free tier: 100 requests stored / 24h TTL.
hook = client.provision_webhook(name="stripe-events")
print(hook.connection_url) # https://api.instanode.dev/webhook/receive/<token>

Use db.connection_url with psycopg, asyncpg, SQLAlchemy, Prisma, Drizzle, or anything else that speaks Postgres.

Async

import asyncio
import instanode.aio

async def main():
    async with instanode.aio.AsyncClient() as client:
        db = await client.provision_database(name="my-app")
        print(db.connection_url)

asyncio.run(main())

Paid tier

The free tier caps each /24 subnet at 5 provisions/day and resources expire in 24 hours. To lift the caps and make resources permanent, sign up at instanode.dev, mint a bearer token from the dashboard, and set it:

client = instanode.Client(api_key="eyJ…")
# Or via env: export INSTANODE_API_KEY=eyJ…

Account operations (paid tier)

# Claim an anonymous resource into the account (clears the 24h expiry).
client.claim(token=db.token)

# List everything this account owns.
for r in client.list_resources():
    print(r.resource_type, r.token, r.tier, r.created_at)

# Delete a resource.
client.delete_resource(db.token)

# Mint a fresh 30-day JWT from a session-authenticated context.
jwt = client.get_api_token()

Error handling

from instanode import InstanodeError

try:
    client.provision_database(name="my-app")
except InstanodeError as e:
    if e.is_rate_limited():
        # …retry later
        ...
    elif e.is_unauthorized():
        # …bad or missing API key
        ...
    else:
        raise

InstanodeError exposes status_code, code, and message, plus convenience checks: is_not_found(), is_unauthorized(), is_forbidden(), is_rate_limited(), is_conflict(), is_service_unavailable().

Scope

This 0.3.0 release covers what the live API actually exposes today:

  • POST /db/newprovision_database
  • POST /webhook/newprovision_webhook
  • POST /api/me/claimclaim
  • GET /api/me/resourceslist_resources
  • DELETE /api/me/resources/{token}delete_resource
  • GET /api/me/tokenget_api_token

Monitor/heartbeat, cache (Redis), MongoDB, NATS queue, and credential rotation are on the roadmap. They live on the feature/full-api branch and will land in a later minor release once the backend ships them. Pin to that branch explicitly if you want the preview surface today:

pip install git+https://github.com/InstaNode-dev/sdk-python.git@feature/full-api

Related

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

instanode-0.3.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

instanode-0.3.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file instanode-0.3.0.tar.gz.

File metadata

  • Download URL: instanode-0.3.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for instanode-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c7804111b641f37327d03e22ba9650264db41162c535649a1dac7f40ad8027c2
MD5 c8d20fd540ca63f9e0711a060257b364
BLAKE2b-256 b38d29ca345a502fe849681d16fe9011f7e5b095d659883ab9817847166c8637

See more details on using hashes here.

File details

Details for the file instanode-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: instanode-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for instanode-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a68c9de527beefb0e0ab063d9cdf52c0e0163026c3e796a1ed1a43bc851210a7
MD5 03e022ddaf1a860225115d4e50c494ee
BLAKE2b-256 f0d38d42692a5d34870464e956d65b036ce5ecec9bc54a554a2125873b5fcb99

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page