Skip to main content

slice-gateway

Command-line client for slice, a self-hosted LLM gateway that routes, caches, and caps your AI spend.

This package installs the slice command. It logs you in through GitHub, then prints the environment lines that point your existing tools at a slice gateway. It has no server dependencies. It needs only typer and httpx, plus the standard library.

Quickstart

  1. Install the CLI:

    pip install slice-gateway
    
  2. Log in through GitHub:

    slice login
    
  3. Point a tool at slice. For Claude Code, set three variables:

    export ANTHROPIC_BASE_URL=https://api.sliceapp.dev
    export ANTHROPIC_API_KEY=sk-ant-api...     # your own Anthropic key
    export ANTHROPIC_AUTH_TOKEN=slk_live_...   # your slice key, from slice login
    

ANTHROPIC_AUTH_TOKEN goes out as Authorization: Bearer, which is where slice reads its key. ANTHROPIC_API_KEY stays your own Anthropic key in x-api-key, and slice forwards it upstream.

Run slice use anthropic, slice use openai, slice use curl, or slice use claude-code to print the exact lines for your tool.

The gateway

This is only the client. The slice gateway itself, the server that does the routing, caching, budgets, and dashboards, lives on GitHub at https://github.com/jjk30/slice.

Homepage: https://sliceapp.dev

Release files for slice-gateway 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 slice-gateway 0.1.0
File Size Uploaded
slice_gateway-0.1.0.tar.gz 6.5 kB Details

Built distribution (wheel)

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

Total release size: 13.0 kB

Release files / slice_gateway-0.1.0.tar.gz

Download URL slice_gateway-0.1.0.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
113d748fb372d5c7b703d32ed2e497f9c1676f5db9ace5c40c8ab369bbde645f
BLAKE2b-256 checksum
How to use checksums
07386737efd7c02d7bb1c0dc06d19115693df6165907cfd757e5c181be886e6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

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

Download URL slice_gateway-0.1.0-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d2988bcd84438ba3e4aa503fe7d5f730a27ded366202a7d1bc890def78fe56e
BLAKE2b-256 checksum
How to use checksums
032271425a648819101c5f208bc533eebd468269339c5d8579069e5f3bb27f84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release history Release notifications | RSS feed

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.0 This release

2 release files

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