Metadata-Version: 2.4
Name: safyan
Version: 1.0.0
Summary: Safyan SDK — The first human-to-AI language. Make every AI prompt better with one line of code.
Author-email: "AQ Holdings Inc." <dev@safyan.ai>
License: MIT
Project-URL: Homepage, https://safyan.ai
Project-URL: Documentation, https://safyan.ai/developers-api
Project-URL: Repository, https://github.com/servantaqthevi/safyan
Keywords: safyan,ai,prompt,optimization,chatgpt,claude,llm
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.24.0

# safyan

The first human-to-AI language. Make every AI prompt better with one line of code.

## Install

```bash
pip install safyan
```

## Quick Start — OpenAI Drop-in

Change your base URL. That's it. Every prompt gets optimized automatically.

```python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.safyan.ai/v1",
    api_key="sfk_your_key_here"
)

response = client.chat.completions.create(
    model="safyan-auto",
    messages=[{"role": "user", "content": "explain recursion"}]
)

print(response.choices[0].message.content)
```

## Direct SDK Usage

```python
from safyan import Safyan

client = Safyan(api_key="sfk_your_key_here")

# Optimize a prompt
result = client.optimize("make my code faster", mode="code")
print(result["translation"])

# Score a prompt (0-100)
score = client.score("help me with something")
print(score["total"], score["grade"])  # 22 "F"

# Compile only (no AI call, instant)
compiled = client.compile("write tests for my API")
print(compiled["compiled"])
```

## Anthropic Drop-in

```python
from safyan.anthropic import SafyanAnthropic

client = SafyanAnthropic(safyan_api_key="sfk_your_key_here")

message = client.messages.create(
    model="safyan-auto",
    max_tokens=1024,
    messages=[{"role": "user", "content": "explain recursion"}]
)

print(message.content[0].text)
```

## Models

- `safyan-auto` — full optimization + smart model routing
- `safyan-fast` — compile only, half the cost

## Get Your API Key

1. Sign up at [safyan.ai](https://safyan.ai)
2. Go to [safyan.ai/console](https://safyan.ai/console)
3. Create a key (starts with `sfk_`)

## Links

- [Documentation](https://safyan.ai/developers)
- [API Reference](https://safyan.ai/developers-api)
- [Developer Console](https://safyan.ai/console)

## License

MIT — AQ Holdings Inc.
