Skip to main content

FinOps platform for AI cost visibility

Project description

Fenra

Fenra Python SDK

PyPI Python License

FinOps platform for AI cost visibility

Usage

Install the package:

pip install fenra

Initialize and start tracking:

import fenra
from openai import OpenAI

fenra.init(api_key="your-fenra-api-key")

# Use as normal - costs are tracked automatically
client = OpenAI()
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}]
)

Works with Anthropic (Claude) and Google (Gemini) the same way.

Set context for cost attribution:

fenra.set_context(
    billable_customer_id="cust_123",  # recommended
    environment="production",
    feature="chat",
)

For custom providers or manual tracking:

fenra.track(
    provider="custom",
    model="my-model",
    input_tokens=100,
    output_tokens=50,
)

To disable auto-tracking:

export FENRA_DISABLE_AUTO_TRACK=1

To enable debug logging:

import logging
logging.getLogger("fenra").setLevel(logging.DEBUG)

Support

Privacy

Fenra is privacy-first by default. No prompts or responses are stored unless explicitly enabled.

License

The Fenra Python SDK is licensed under the Apache 2.0 License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fenra-0.1.2.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fenra-0.1.2-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file fenra-0.1.2.tar.gz.

File metadata

  • Download URL: fenra-0.1.2.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fenra-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f27fc80ff98e4122f1a34b703447dc07242f49bd1b923d7cd4a4b8c7007c52bf
MD5 4bda8fe58dc71ba6bba2d313b823aac2
BLAKE2b-256 fff8091c0e666b6204840024e22e34c6f5107125e31b4d471255d3ac1bde1f7f

See more details on using hashes here.

File details

Details for the file fenra-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: fenra-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fenra-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 93485e05645e790c206753431796d1f0ca40ed9ff4496dd0a202a3e44e540cb7
MD5 f8a1cd086c9e7208d1a37dd143adcbed
BLAKE2b-256 3e75f748c3e39ebef87271c87ac38e8fc333f802d0bd51483f6eaf8d970db794

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page