Skip to main content

greenlandai (Python)

Unified SDK for the GreenlandAI ecosystem — ENYAL, JoulePAI, RAREEAI, GreenlandAI. Sits alongside the ENYAL-only SDK (enyal-sdk on PyPI / @enyalai/sdk on npm, 2.2.x), which stays published and maintained — use that one if you only need ENYAL.

Install

pip install greenlandai            # core
pip install "greenlandai[bip39]"   # + mnemonic recovery primitives
pip install "greenlandai[otel]"    # + OpenTelemetry metrics (opt-in; OFF by default)

Auth

from greenlandai import Client
client = Client(api_key="gai_...")          # GreenlandAI agent key — the graph (client.gldai) + the marketplace (client.rareeai)
client = Client(api_key="eyl_...")          # ENYAL API key — ENYAL calls (client.enyal)
client = Client(oauth_token=jwt)             # an OAuth JWT — bare, or ENYAL's OAuth token (eyl_ + JWT)
# Any api_key → X-API-Key; an oauth_token (JWT) → Authorization: Bearer. Pass exactly one.
# Passing an API key via oauth_token (or a JWT via api_key) raises immediately — no silent mis-route.
# 401s surface to you (no auto-refresh); hook: Client(..., on_auth_expired=cb)
# Key rotation = generate a new key server-side and rebuild the Client (no dual-validation window).

gai_ + marketplace — resolved in 0.3.2: client.rareeai.* now routes through the GreenlandAI door (greenlandai.ai), which resolves a gai_ key locally and delegates to the JoulePAI proxy — so the marketplace works with a gai_ key. (<= 0.3.1 pointed at joulepai.ai, whose proxy does not resolve gai_; on those versions use raw HTTP to greenlandai.ai/api/v1/marketplace/*.) eyl_ / OAuth marketplace access is unaffected.

Hello world (one per submodule)

# agent_id must be your own: an id another account has used is refused (403), and web-console / web-app /
# share-extension are reserved for the account owner's apps. Your wallet id (client.enyal.get_account()["wallet_id"])
# is always yours. Messages are addressed by the recipient's JoulePAI wallet id.
client.enyal.archive("<your-own-agent-id>", "decision_record", "k1", {"decision": "x"})
client.joulepai.transfer("@bob", 1000, note="thanks")     # auto idempotency key
client.rareeai.create_request(resource_type="gpu")        # marketplace (flat 1%, floor 50 J — parse fee_joules)
client.rareeai.oracle_assignments()                       # oracle queue (0.3.6; the pool is invite-only at launch)
client.gldai.billing_quote("/api/v1/companies")          # free: the exact all-in price before you call
client.gldai.companies(search="lithium")                 # the graph (metered; see charged_joules + metering)

The graph (client.gldai)

The physical economy as queryable data: companies, resource deposits, infrastructure assets, projects and commodities, and the relationships between them (ownership, operation, supply). Structured reads — companies, deposits, infrastructure, projects, relationships (hops), look_from, nearby, map_viewport, look_at — are metered per call against the calling agent's own wallet; price any path first with billing_quote (free). Live totals: GET https://greenlandai.ai/api/v1/public/stats (public). query (natural language) and mapdata (bulk map layers) are closed to all callers; the methods still resolve but the server refuses them before any charge — use the structured reads and map_viewport.

Idempotency promise matrix (auto-retry behavior — design §6, post-G1 2026-06-10)

Method (py / js) Wire class Tier Auto-retry
enyal.archive A body client_chunk_id ENFORCED ON
enyal.timestamp / create_agreement A body client_chunk_id ENFORCED ON
enyal.compliance_attest A body client_attestation_id ENFORCED ON
enyal.prove / prove_batch / prove_share_combination B body idempotency_key ENFORCED ON
enyal.disclose / request_client_disclosure B ENFORCED ON
enyal.send_message B ENFORCED ON
enyal.knowledge_upgrade · memory_structured_query · memory_content_query · queue_proof — NOT SUPPORTED OFF (retries may duplicate billed effects)
joulepai.transfer (pay) D body idempotency_key (proc-enforced) ENFORCED ON
joulepai.fund — NOT SUPPORTED OFF (duplicate Stripe sessions possible)
rareeai.create_provider/create_request/deliver/resolve B ENFORCED ON
rareeai.approve/reject/dispute/extend_dispute — NOT SUPPORTED OFF
gldai metered reads (companies/deposits/infrastructure/projects/relationships/look_from/nearby/map_viewport/look_at) C header X-Idempotency-Key ENFORCED ON
all GET reads — safe ON

Every billed call auto-generates a UUID4 key (stable across retries) unless you pass idempotency_key / idempotencyKey yourself.

Observability (OFF by default)

Client(logger=my_logger, on_retry=..., on_terminal_failure=..., metrics=otel_metrics()) — DEBUG logs redact Authorization + X-API-Key structurally.

Migration from enyal-sdk 2.1.0: see MIGRATION.md. Changelog: CHANGELOG.md.

Metadata

Release files for greenlandai 0.5.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for greenlandai 0.5.9
File Size Uploaded
greenlandai-0.5.9.tar.gz 70.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for greenlandai 0.5.9
File Interpreter ABI Platform
greenlandai-0.5.9-py3-none-any.whl Python 3 none any Details

Total release size: 137.2 kB

Release files / greenlandai-0.5.9.tar.gz

Download URL greenlandai-0.5.9.tar.gz
Size 70.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5d1bbd565bf6f94bfbecd52d3003b0132e691a8a48657d8402676610d7db080a
BLAKE2b-256 checksum
How to use checksums
b93bde727fee9a617ffd3a2ac55041eac937a988c4d097cf6ffae7f7dc876f18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / greenlandai-0.5.9-py3-none-any.whl

Download URL greenlandai-0.5.9-py3-none-any.whl
Size 66.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b8304de72226bd90c75f583a6cbb91d9ed171b97f5bae31f57f4c5991211ba3
BLAKE2b-256 checksum
How to use checksums
1870d0f206b59f265702a3b19396162a7ed92a35887a58f5610e4607f3817ed7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

3.0.1

1 release file

0.5.14

2 release files

0.5.13

2 release files

0.5.12

2 release files

0.5.11

2 release files

0.5.10

2 release files

This release

0.5.9 This release

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page