Metadata-Version: 2.4
Name: synapsex-platform
Version: 0.1.0
Summary: SynapseX Python SDK - Deploy and manage AI agents
Author-email: SynapseX Team <dev@synapsex.ai>
License: MIT
Project-URL: Homepage, https://synapsex.ai
Project-URL: Documentation, https://docs.synapsex.ai
Keywords: ai,agents,mcp,llm,openai,claude,synapsex
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.25.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Provides-Extra: async
Requires-Dist: aiohttp>=3.9.0; extra == "async"
Dynamic: license-file

# SynapseX Python SDK

Python SDK for the [SynapseX](https://synapsex.ai) AI platform.

It provides `LLMClient`, an OpenAI-wire-compatible chat client that talks only
to the public SynapseX edge (`https://platform.synapsex.ai/api/v1`) using a
per-customer platform key (`sk-synapsex-...`).

## Installation

```bash
pip install synapsex
```

## Usage

```python
from synapsex import LLMClient

# api_key falls back to the SYNAPSEX_API_KEY environment variable.
client = LLMClient(api_key="sk-synapsex-...")

resp = client.chat_completions(
    model="synapsex-nexus-v2",
    messages=[{"role": "user", "content": "Hello, world!"}],
)
print(resp["choices"][0]["message"]["content"])
```

Streaming:

```python
stream = client.chat_completions(
    model="synapsex-nexus-v2",
    messages=[{"role": "user", "content": "Count from 1 to 5."}],
    stream=True,
)
for chunk in stream:
    for choice in chunk.get("choices", []):
        piece = choice.get("delta", {}).get("content")
        if piece:
            print(piece, end="", flush=True)
```

Because the wire format is OpenAI-compatible, you can equivalently point the
stock `openai` SDK at the same base URL:

```python
from openai import OpenAI

client = OpenAI(api_key="sk-synapsex-...", base_url="https://platform.synapsex.ai/api/v1")
```

## Errors

Requests raise typed exceptions that subclass `SynapseXError`:
`AuthenticationError` (401), `InsufficientCreditsError` (402),
`PermissionDeniedError` (403), `RateLimitError` (429), and `APIError` for other
non-2xx responses.

## Documentation

See <https://docs.synapsex.ai>.

## License

MIT
