Skip to main content

SynapseX Python SDK

Python SDK for the SynapseX 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

pip install synapsex

Usage

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:

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:

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

Metadata

Release files for synapsex-platform 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for synapsex-platform 0.1.0
File Size Uploaded Provenance Actions
synapsex_platform-0.1.0.tar.gz 11.4 kB Without provenance Details for synapsex_platform-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for synapsex-platform 0.1.0
File Interpreter ABI Platform Actions
synapsex_platform-0.1.0-py3-none-any.whl Python 3 none any Details for synapsex_platform-0.1.0-py3-none-any.whl

Total release size: 24.6 kB

Release files / synapsex_platform-0.1.0.tar.gz

Download URL synapsex_platform-0.1.0.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b639ea198dc0e2e20be4827342c1d89026f97e1e829796c9ac62980c0ad4017e
BLAKE2b-256 checksum
How to use checksums
c4865c1b364d06b9d46ac40f62571d1639e5a42f35a8f87baaab703365caabf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release files / synapsex_platform-0.1.0-py3-none-any.whl

Download URL synapsex_platform-0.1.0-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
33ff5bc6f42344b1a2b036f1e40505bbf4720aa701485a3fd7dcc3788456c230
BLAKE2b-256 checksum
How to use checksums
a29b0108f8e5316c9eb3b9eb49a23d7420940b808c1ad31f4a3bde734a52fe73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Security for synapsex-platform 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page