idemcore (Python SDK)
Python client for the Idemcore API. Every chat answer comes with a signed receipt, and this package can check that receipt on your own machine.
- Chat completions (plain or streaming) that return the answer text and its receipt id.
- Fetch a receipt and its public token log.
- Verify receipts locally: Ed25519 signature (L1), token-log chain (L2), and your prompt / answer against the receipt's salted commitments (disclosure).
- Server-side checks: remote verify, replay on an independent build (L3), audit export.
- Sync and asyncio clients. Python 3.9+. Dependencies:
idemcore-verifyandcryptography.
Decoding is greedy: temperature is fixed at 0 (and n at 1). Sending any other
temperature raises InvalidRequestError before a request is made.
Install
pip install idemcore
Get an API key
- Sign in to the console at https://console.idemcore.net/#/login (the public preview is free, with preview limits).
- Create an API key. It starts with
ick_and is shown only once. - Export it:
export IDEMCORE_API_KEY="ick_..."
The client reads IDEMCORE_API_KEY (and, optionally, IDEMCORE_BASE_URL, default
https://api.idemcore.net). You can also pass Idemcore(api_key=...).
Quickstart
from idemcore import Idemcore
client = Idemcore()
r = client.chat("Name the three primary colours.", max_tokens=64)
print(r.text)
print(r.receipt_id) # rcpt_...
# Verify on this machine: signature, token-log chain, and that the receipt
# commits to exactly this prompt and this answer.
result = client.verify_local(r)
print(result.ok) # True
for name, level in result.levels.items():
print(name, level.ok, level.errors)
r.receipt is the full signed receipt, r.salt the base64url salt of a
hash_only receipt (the default privacy mode). Anyone with the salt and the text
can check the commitments, so keep the salt with the conversation.
Streaming
with client.chat_stream("Write a haiku about receipts.") as stream:
for chunk in stream:
print(chunk.delta, end="", flush=True)
print()
print(stream.result.receipt_id) # the receipt arrives with the last chunk
Async
import asyncio
from idemcore import AsyncIdemcore
async def main():
client = AsyncIdemcore()
r = await client.chat("Hello")
print(r.text, r.receipt_id)
asyncio.run(main())
Receipts, logs and server-side checks
receipt = client.get_receipt("rcpt_...") # GET /v1/receipts/{id}
log = client.get_receipt_log("rcpt_...") # GET /v1/receipts/{id}/log
print(log.log_format) # idemcore-log/r1-public
client.verify_remote(r.receipt, messages=r.messages, salt=r.salt,
output_token_ids=r.output_token_ids) # POST /v1/receipts/verify
client.replay_result(r) # POST /v1/receipts/replay (L3)
lines = client.audit_export("2026-10-01", "2026-10-31") # POST /v1/audit/export (NDJSON lines)
client.models() # GET /v1/models
client.keys() # GET /v1/keys (signing keys, JWKS)
Offline verification without the client
from idemcore.verify import verify_receipt
res = verify_receipt(receipt, log_text=log_text,
messages=messages, salt=salt, output_token_ids=output_ids)
The production receipt-signing public key is bundled
(idemcore.verify.DEFAULT_TRUSTED_KEYS); pass keys=client.keys() to use the live
key set instead.
Errors
All errors derive from idemcore.IdemcoreError and carry status, type and
message: AuthenticationError (401), PermissionDeniedError (403, key lacks a
scope), NotFoundError (404), ConflictError (409), InvalidRequestError (400/415), RateLimitError
(429, see .retry_after), InsufficientQuotaError (429), ServiceUnavailableError
(503), InternalServerError (5xx), APIConnectionError (network). GET requests are
retried on 429/503 (max_retries, default 2); chat requests are never retried
automatically, so a retry never creates a second receipt behind your back.
Using the OpenAI SDK instead
The API is OpenAI-compatible, so openai.OpenAI(base_url="https://api.idemcore.net/v1", api_key=...) also works; the receipt is in the response's idemcore_receipt field.
This package adds typed receipts and local verification.
Development
pip install -e .
python -m unittest discover -s tests # mocked API, no network
IDEMCORE_LIVE=1 python -m unittest tests.test_client.LiveSmoke # GET /health only
License
Apache-2.0
Metadata
Release files for idemcore 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| idemcore-0.1.0.tar.gz | 29.6 kB | With provenance | Details for idemcore-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| idemcore-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for idemcore-0.1.0-py3-none-any.whl |
Total release size: 51.8 kB
Release files / idemcore-0.1.0.tar.gz
| Download URL | idemcore-0.1.0.tar.gz |
|---|---|
| Size | 29.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e7e8a74a90575310baf0fd2ff7186b32a529b7667c1a32f4843fe6dc76a316b2
|
|
BLAKE2b-256 checksum How to use checksums |
25a149a9a540b78ca93c0f53eff0c3e6723dc3f2740ba20704e405a092d0f2dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.
Transparency logRelease files / idemcore-0.1.0-py3-none-any.whl
| Download URL | idemcore-0.1.0-py3-none-any.whl |
|---|---|
| Size | 22.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a0cb76249518234771bfea4599c6c3678469318d392a22f155c3f0e55a35365d
|
|
BLAKE2b-256 checksum How to use checksums |
c87ee5e9429552c1a979ed40ab3025f89ce3cf01c38325ed429952e9c103f8d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.
Transparency logSecurity for idemcore 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for idemcore-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.