Skip to main content

meok-sdk

Official Python SDK for the MEOK Attestation API — sign + verify HMAC-signed compliance attestations across the MEOK trade-compliance ecosystem.

Part of the MEOK AI Labs ecosystem powering haulage.app, the umbrella for 32 PyPI-published Model Context Protocol servers covering UK + EU + US + AU + Canada + air + sea + rail trade compliance.

PyPI Python License: MIT

Install

pip install meok-sdk

Python ≥ 3.10. The only runtime dep is httpx — works in sync + async code, on Vercel Edge, AWS Lambda, anywhere modern Python runs.

Quick start — verify a cert (no API key needed)

from meok_sdk import MeokClient

cert = {  # came from any MEOK MCP tool result
    "cert_id": "...",
    "signature_sha256_hmac": "...",
    "payload": {...}
}

result = MeokClient.verify_public(cert)
print(result.valid, result.message)

The verifier endpoint is public and rate-limited — no auth, no install required beyond this package. That's the whole point: any auditor, regulator, or customer can verify your compliance chain from their machine.

Sign a cert (requires an API key)

Get an API key by upgrading on meok-compliance.vercel.app/pricing or haulage.app/pricing. The key arrives in the welcome email after Stripe checkout.

from meok_sdk import MeokClient

with MeokClient(api_key="sk_meok_…") as client:
    cert = client.sign(
        regulation="EU_AI_ACT_ANNEX_III",
        entity="ACME Haulage Ltd",
        score=82,
        findings=[
            "Tachograph data exported",
            "Driver hours within limits",
            "OCRS forecast GREEN",
        ],
        articles_audited=["Art_9", "Art_10", "Art_15"],
    )
    print(cert["verify_url"])  # share with auditor

You can also pass the key via the MEOK_API_KEY environment variable.

Async usage

import asyncio
from meok_sdk import AsyncMeokClient

async def main():
    async with AsyncMeokClient(api_key="sk_meok_…") as client:
        cert = await client.sign(regulation="GDPR", entity="ACME", score=92)
        verified = await client.verify(cert)
        assert verified.valid

asyncio.run(main())

Error handling

All exceptions inherit from MeokError:

from meok_sdk import (
    MeokAuthError,         # 401 — bad / missing API key
    MeokValidationError,   # 400 — missing fields / bad input
    MeokPaymentError,      # 402 — Stripe session not paid
    MeokAPIError,          # any other non-2xx
    MeokNetworkError,      # connect / DNS / TLS / timeout
    MeokError,             # catch-all base
)

Environment variables

Variable What Default
MEOK_API_KEY Default API key used when none is passed to the client. None
MEOK_API_BASE Override base URL (testing, edge deployments). https://meok-attestation-api.vercel.app

What gets signed

Every cert ships:

  • cert_id — unique id
  • issued_at / expires_at (~1 year)
  • regulation / entity / score / assessment (COMPLIANT / PARTIAL / NON_COMPLIANT)
  • findings / articles_audited / auditor_notes
  • issuer / kid / tier
  • verify_url — a public HTML page anyone can hit
  • signature_sha256_hmac — base64url of HMAC-SHA256 over the canonical-JSON payload

The signing key never leaves the server. The verifier re-derives the canonical bytes and re-computes the HMAC; if they match, the cert holds.

License

MIT — © 2026 MEOK AI Labs / CSOAI LTD.

Metadata

Release files for meok-sdk 3.1.0

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

Source distribution (sdist)

Source distribution for meok-sdk 3.1.0
File Size Uploaded
meok_sdk-3.1.0.tar.gz 16.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for meok-sdk 3.1.0
File Interpreter ABI Platform
meok_sdk-3.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 31.4 kB

Release files / meok_sdk-3.1.0.tar.gz

Download URL meok_sdk-3.1.0.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
dc1b12aa4ad9497cf3233d8b05cb53c3c359e4af9d5fad7412411d12600e42fc
BLAKE2b-256 checksum
How to use checksums
fd732cdfc586db64a680ed71d5498f2556a3a7651b2c742ee7f959aafe45bbba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / meok_sdk-3.1.0-py3-none-any.whl

Download URL meok_sdk-3.1.0-py3-none-any.whl
Size 14.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bf8a2b126432d50b8a4e25ae405c7365c5b91deb88469abe2763060e9e33369
BLAKE2b-256 checksum
How to use checksums
cd7818de40f4cc0b5dc55f5d3f452b41fa68d55d637cd454d06dcbabcf92c3b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

3.1.0 This release

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