Metadata-Version: 2.4
Name: neoncodex-ai
Version: 1.0.0
Summary: Official Python SDK for NeonCodex AI — Claude, GPT-5.5, Gemini
License: MIT
Project-URL: Homepage, https://neoncodex.io
Project-URL: Documentation, https://neoncodex.io/developer
Project-URL: Repository, https://github.com/neoncodex/neoncodex-python
Keywords: ai,claude,gpt,neoncodex,sdk,llm
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Provides-Extra: async
Requires-Dist: httpx>=0.27.0; extra == "async"

# neoncodex

Official Python SDK for [NeonCodex AI](https://neoncodex.io) — Claude 4.6, GPT-5.5, Gemini 3.1 Pro, and 50+ models.

## Install

```bash
pip install neoncodex
```

For async support:
```bash
pip install neoncodex[async]
```

## Quick start

```python
from neoncodex import NeonCodex

client = NeonCodex(api_key="nck_live_...")

# Run a task and get full output
output = client.tasks.run("Write a Python web scraper for HN")
print(output)

# Stream output in real time
for chunk in client.tasks.stream("Explain transformers in ML"):
    print(chunk, end="", flush=True)

# With file attachment
attachment = client.files.from_path("data.csv")
output = client.tasks.run(
    "Analyze this data and find key insights",
    attachments=[attachment]
)
```

## Async

```python
import asyncio
from neoncodex import NeonCodex

client = NeonCodex(api_key="nck_live_...")

async def main():
    async for chunk in client.tasks.astream("Write a FastAPI app"):
        print(chunk, end="", flush=True)

asyncio.run(main())
```

## Models

```python
# Auto-routing (recommended)
client.tasks.run("Your prompt", model="auto")

# Specific models
client.tasks.run("Debug this code", model="claude-sonnet-4-6")
client.tasks.run("Analyze this dataset", model="google/gemini-3.1-pro-preview")
client.tasks.run("Quick question", model="qwen/qwen3-coder:free")  # free
```

## API Reference

### `client.tasks.run(prompt, model, attachments)` → `str`
### `client.tasks.stream(prompt, model, attachments)` → `Iterator[str]`
### `client.tasks.create(prompt, model, title, attachments)` → `Task`
### `client.tasks.get(task_id)` → `Task`
### `client.tasks.wait(task_id, poll_interval, timeout)` → `Task`
### `client.tasks.list(limit)` → `List[Task]`
### `client.tasks.cancel(task_id)` → `None`
### `client.files.from_path(file_path)` → `Attachment`
### `client.files.from_string(content, filename)` → `Attachment`
### `client.me()` → `User`

## Error handling

```python
from neoncodex import NeonCodex, NeonCodexError, AuthenticationError

try:
    output = client.tasks.run("...")
except AuthenticationError:
    print("Invalid API key")
except NeonCodexError as e:
    print(f"Error {e.status_code}: {e}")
```

## Get an API key
[neoncodex.io](https://neoncodex.io) → Settings → API Keys

## License
MIT
