Skip to main content

Tokedy Python SDK

Official Python library and command-line tool for Tokedy AI compute.

Tokedy™ serves language models through an OpenAI-compatible API. This package is a thin layer over the official openai library: it points the client at Tokedy, reads your Tokedy API key, and adds the tokedy command. Everything else works exactly like the OpenAI SDK.

Website: https://tokedy.ai

Install

pip install tokedy

Python 3.9 or newer.

Quickstart

from tokedy import Tokedy

client = Tokedy()  # reads TOKEDY_API_KEY
resp = client.chat.completions.create(
    model="<model-id>",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)

Replace <model-id> with a model id from the models list.

Streaming

Pass stream=True to get the answer as it is written:

from tokedy import Tokedy

client = Tokedy()
stream = client.chat.completions.create(
    model="<model-id>",
    messages=[{"role": "user", "content": "Write a haiku about tea."}],
    stream=True,
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)
print()

Async

AsyncTokedy has the same interface, with await:

import asyncio

from tokedy import AsyncTokedy


async def main():
    client = AsyncTokedy()
    resp = await client.chat.completions.create(
        model="<model-id>",
        messages=[{"role": "user", "content": "Hello"}],
    )
    print(resp.choices[0].message.content)


asyncio.run(main())

Streaming works the same way: pass stream=True and iterate with async for.

CLI

Installing the package adds a tokedy command.

# One prompt; the answer streams to stdout
tokedy chat "Say hello" --model <model-id>

# Interactive chat; type exit or press Ctrl+C to quit
tokedy chat --model <model-id>

tokedy --version

--model falls back to the TOKEDY_MODEL environment variable. The CLI prints a one-line banner to stderr, so piping stdout (tokedy chat "..." > answer.txt) captures only the answer.

Configuration

Environment variable Used for Default
TOKEDY_API_KEY Your API key (api_key=) none, required
TOKEDY_BASE_URL API base URL (base_url=) https://api.tokedy.ai/v1
TOKEDY_MODEL Default model for the tokedy CLI none

Arguments passed to Tokedy(...) win over environment variables. Every other argument (timeout, max_retries, default_headers, http_client, …) is passed to the OpenAI client unchanged.

Getting an API key

Tokedy is available to approved companies. Request access, then once approved sign in and create a key under API keys. The key is shown once; store it as TOKEDY_API_KEY:

export TOKEDY_API_KEY="sk-ty-v1-..."

Support

The library sends no telemetry and never logs or prints your API key.


TOKEDY™ is a trademark of Tokedy, Inc.

Metadata

Release files for tokedy 0.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 tokedy 0.1.0
File Size Uploaded Provenance
tokedy-0.1.0.tar.gz 12.8 kB With provenance Details

Built distribution (wheel)

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

Total release size: 22.0 kB

Release files / tokedy-0.1.0.tar.gz

Download URL tokedy-0.1.0.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
51b77b72fa9befe27e1972b75b6f47bf8e64a69e9044e4cf039799cbf86ac7df
BLAKE2b-256 checksum
How to use checksums
7d4efc896835dc7db2290c201d39a28f19d84bab814133449c33e81ee81e0843
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 Oct 23, 2026.

Transparency log

Release files / tokedy-0.1.0-py3-none-any.whl

Download URL tokedy-0.1.0-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06ddf50db40ccccb6431416b9b0f904c89333088cf1724e790baa18684bcbcbc
BLAKE2b-256 checksum
How to use checksums
0a1146568dcc746b36140cf7920c7354ce5ada0df2da619422cdb9688091ac93
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 Oct 23, 2026.

Transparency log

Security for tokedy 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.

Select from 2 files

Attestation for tokedy-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 Oct 23, 2026.

Transparency log

A 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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