🐙 open-octopus
An Octopus Energy API client built for AI.
pip install open-octopus
Features · Quick Start · CLI · AI Agent · API Reference
Features
Quick Start
💻 CLI
octopus status # Full overview
octopus rate # Current rate (off-peak/peak)
octopus power # Live consumption
octopus dispatch # Charging windows
octopus usage # Electricity usage
octopus gas # Gas usage
octopus sessions # Saving sessions
octopus watch # Live monitoring
🤖 AI Agent
Ask questions about your energy in plain English.
pip install 'open-octopus[agent]'
export ANTHROPIC_API_KEY="sk-ant-xxx"
octopus-ask "What's my current rate?"
octopus-ask "How much gas did I use this week?"
octopus-ask "When is my next charging window?"
octopus-ask "Am I on off-peak rates right now?"
Or use in Python:
from open_octopus import OctopusAgent
agent = OctopusAgent()
response = await agent.ask("What's my balance?")
print(response)
🖥️ Menu Bar (macOS)
pip install 'open-octopus[menubar]'
octopus-menubar
| ⚡ Live Power Real-time kW |
🌙 Rate Status Off-peak/peak |
🔌 Charging EV dispatch |
💰 Balance Account credit |
📚 API Reference
|
Account & Billing get_account() # Balance, status, address
get_tariff() # Electricity tariff
get_gas_tariff() # Gas tariff
get_current_rate() # Current rate + off-peak
|
Consumption get_consumption() # Half-hourly readings
get_daily_usage() # Daily totals
get_gas_consumption() # Gas readings
get_daily_gas_usage() # Daily gas totals
|
|
Smart Features get_live_power() # Real-time watts
get_dispatches() # Charge windows
get_dispatch_status() # Currently charging?
get_saving_sessions() # Free power events
|
Models Account # Balance, name, status
Tariff / GasTariff # Rates, standing charge
Rate # Current rate, period
Dispatch # Charge window
LivePower # Real-time demand
SavingSession # Free power event
|
⚙️ Configuration
Environment Variables
# Required
OCTOPUS_API_KEY=sk_live_xxx
OCTOPUS_ACCOUNT=A-XXXXXXXX
# Electricity meter (optional)
OCTOPUS_MPAN=1234567890123
OCTOPUS_METER_SERIAL=12A3456789
# Gas meter (optional)
OCTOPUS_GAS_MPRN=1234567890
OCTOPUS_GAS_METER_SERIAL=G4A12345
# AI agent (optional)
ANTHROPIC_API_KEY=sk-ant-xxx
Getting Your API Key
- Log in to Octopus Energy
- Go to Developer Settings
- Copy your API key (starts with
sk_live_)
Finding Your MPAN/MPRN
Your MPAN (electricity) and MPRN (gas) are on your energy bills.
Or discover them via the API:
account = await client.get_account()
print(account) # Includes meter info
How It Works
┌────────────────────────────────────────────────────────────────┐
│ Octopus Energy GraphQL API (Kraken) │
│ ↓ │
│ open-octopus async client │
│ • Account balance, tariffs │
│ • Consumption data (electricity + gas) │
│ • Intelligent Octopus dispatches │
│ • Live power (Home Mini telemetry) │
│ • Saving Sessions │
│ ↓ │
│ Your choice of interface │
│ • Python library (async/await) │
│ • CLI tool (octopus) │
│ • AI agent (octopus-ask) │
│ • Menu bar app (octopus-menubar) │
└────────────────────────────────────────────────────────────────┘
Metadata
Release files for open-octopus 0.3.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 | |
|---|---|---|---|
| open_octopus-0.3.0.tar.gz | 20.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| open_octopus-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 43.9 kB
Release files / open_octopus-0.3.0.tar.gz
| Download URL | open_octopus-0.3.0.tar.gz |
|---|---|
| Size | 20.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
04b9de01fa37e6656ba78d29fde54389500ade892c3535125b6cdb8033f3445b
|
|
BLAKE2b-256 checksum How to use checksums |
0a67f30547a0278c17362dce17f0dda2e966dc6c58f947c0c3e05515780bc391
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Dec 29, 2025.
Transparency logRelease files / open_octopus-0.3.0-py3-none-any.whl
| Download URL | open_octopus-0.3.0-py3-none-any.whl |
|---|---|
| Size | 23.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2f17dc9b05bbb46e15eee34746d97e3a7c9bbee7faccbac55f7fc2b90f69a958
|
|
BLAKE2b-256 checksum How to use checksums |
ea48d4524980db6b0502599fbf7c1fa8df8d8a93a1d428ba82ed18eaead5f6e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Dec 29, 2025.
Transparency log