Skip to main content

Edgee Python SDK

Lightweight, type-safe Python SDK for the Edgee AI Gateway.

PyPI version License

Installation

pip install edgee

Quick Start

from edgee import Edgee

edgee = Edgee("your-api-key")

# Send a simple request
response = edgee.send(
    model="anthropic/claude-haiku-4-5",
    input="What is the capital of France?"
)

print(response.text)
# "The capital of France is Paris."

Send Method

The send() method makes non-streaming chat completion requests:

response = edgee.send(
    model="anthropic/claude-haiku-4-5",
    input="Hello, world!"
)

# Access response
print(response.text)           # Text content
print(response.finish_reason)  # Finish reason
print(response.tool_calls)     # Tool calls (if any)

# Access usage and compression info
if response.usage:
    print(f"Tokens used: {response.usage.total_tokens}")

if response.compression:
    print(f"Saved tokens: {response.compression.saved_tokens}")
    print(f"Reduction: {response.compression.reduction}%")
    print(f"Cost savings: ${response.compression.cost_savings / 1_000_000:.3f}")
    print(f"Time: {response.compression.time_ms} ms")

Stream Method

The stream() method enables real-time streaming responses:

for chunk in edgee.stream("anthropic/claude-haiku-4-5", "Tell me a story"):
    if chunk.text:
        print(chunk.text, end="", flush=True)
    
    if chunk.finish_reason:
        print(f"\nFinished: {chunk.finish_reason}")

Features

  • ✅ Type-safe - Full type hints with dataclasses
  • ✅ OpenAI-compatible - Works with any model supported by Edgee
  • ✅ Streaming - Real-time response streaming with generators
  • ✅ Tool calling - Full support for function calling
  • ✅ Flexible input - Accept strings, dicts, or InputObject
  • ✅ Compression info - Access token compression metrics in responses
  • ✅ Zero dependencies - Uses only Python standard library

Documentation

For complete documentation, examples, and API reference, visit:

👉 Official Python SDK Documentation

The documentation includes:

License

Licensed under the Apache License, Version 2.0. See LICENSE for details.

Metadata

Release files for edgee 1.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 edgee 1.1.0
File Size Uploaded Provenance Actions
edgee-1.1.0.tar.gz 23.5 kB With provenance Details for edgee-1.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 33.4 kB

Release files / edgee-1.1.0.tar.gz

Download URL edgee-1.1.0.tar.gz
Size 23.5 kB
Tags Source
SHA-256 checksum
How to use checksums
02690f40334c9d1c08d9f7dc3222672be1f415b0919202a6ac370aa9fd230635
BLAKE2b-256 checksum
How to use checksums
033bf02f79d055d194c049d9f1523cea392fce1bbe9ebf7929dc9cfb2f49745c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 28, 2026.

Transparency log

Release files / edgee-1.1.0-py3-none-any.whl

Download URL edgee-1.1.0-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e1461feb1bfeecb0079f94b6f729a2c0dd8b6597931fb4dc38b3b4a31e07054b
BLAKE2b-256 checksum
How to use checksums
857185690c158cc23227e5e9f9aea9a6ae8b4c42dbbdb34f4d444b8b1d018e6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 28, 2026.

Transparency log

Security for edgee 1.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 edgee-1.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 Sep 28, 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.

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