Metadata-Version: 2.4
Name: lexio-sdk
Version: 1.0.0
Summary: Official Lexio SDK for Python
License: MIT
Keywords: ai,lexio,llm,prompt,sdk
Requires-Python: >=3.11
Requires-Dist: click>=8.1.0
Requires-Dist: httpx>=0.27.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Description-Content-Type: text/markdown

# Lexio Python SDK

Official Python SDK for [Lexio](https://lexio.dev) — LLM prompt management and evaluation.

## Installation

```bash
pip install lexio-sdk
```

## Quick start

```python
from lexio import LexioClient

client = LexioClient(api_key="lx_live_...")

# Fetch a prompt
prompt = client.get_prompt("my-prompt", variables={"topic": "AI"})
print(prompt.text)

# Run tests across models
from lexio.models import RunTestsConfig, PromptEntry

result = client.run_tests(RunTestsConfig(
    prompts=[PromptEntry(slug="my-prompt")],
    models=["openai/gpt-4o-mini", "anthropic/claude-3-haiku"],
))
for r in result.results:
    print(r.model_id, r.output)
```

## BYOK (Bring Your Own Key)

Pass your own provider API keys — they are used in-memory and never stored:

```python
client = LexioClient(api_key="lx_live_...", byok_keys={"openai": "sk-..."})
```

Or register keys permanently via the Lexio dashboard (Settings → Provider Keys).

## Async client

```python
from lexio import AsyncLexioClient

async with AsyncLexioClient(api_key="lx_live_...") as client:
    result = await client.run_tests(config)
```

## Requirements

- Python 3.11+
- `httpx`

## License

MIT
