Metadata-Version: 2.4
Name: refutics
Version: 0.1.0
Summary: Drop-in token optimization for the OpenAI & Anthropic SDKs — change one import, cut your token bill.
Author: DTRAS Global
License: MIT
Project-URL: Homepage, https://refutics.com
Keywords: llm,tokens,openai,anthropic,azure,cost,optimization,refutics
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Provides-Extra: openai
Requires-Dist: openai>=1.0; extra == "openai"
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.30; extra == "anthropic"
Provides-Extra: all
Requires-Dist: openai>=1.0; extra == "all"
Requires-Dist: anthropic>=0.30; extra == "all"

# Refutics — Python SDK

Drop-in token optimization. **Change one import**, cut your token bill. Streaming, tools,
and vision keep working — these are thin wrappers over the official SDKs.

## Install
```bash
pip install refutics openai          # for OpenAI / OpenAI-compatible / Azure
pip install refutics anthropic       # for Anthropic
```

## Use — one import change
```python
# before:  from openai import OpenAI
from refutics import OpenAI

client = OpenAI()                                   # reads REFUTICS_TOKEN from env
resp = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "hello"}],
)
```
Set your token once:
```bash
export REFUTICS_TOKEN=dtras_live_…
```

## Any provider — one token
```python
client = OpenAI(provider="groq")        # or mistral, deepseek, together, xai, fireworks, gemini…
```

## Anthropic
```python
from refutics import Anthropic
client = Anthropic()                                # reads REFUTICS_TOKEN
client.messages.create(model="claude-3-5-sonnet-latest", max_tokens=256, messages=[...])
```

## Azure OpenAI
```python
from refutics import AzureOpenAI
client = AzureOpenAI(
    azure_resource="https://my-company.openai.azure.com",
    api_version="2024-02-01",
)
client.chat.completions.create(model="<your-deployment>", messages=[...])
```

## Provider key
- **Stored (recommended):** add your provider key once in the Refutics dashboard — pass nothing.
- **BYOK:** `OpenAI(provider_key="sk-…")` — never stored.

## Optional: auto model-routing (save more)
```python
client = OpenAI(route=True)   # downgrades clearly-easy prompts to a cheaper model
```

That's it — same SDK, same answers, smaller bill.
