Metadata-Version: 2.4
Name: nexttoken
Version: 0.1.0
Summary: NextToken SDK - Simple client for the NextToken APIs and Gateway
Project-URL: Homepage, https://nexttoken.co
Project-URL: Documentation, https://docs.nexttoken.co
Project-URL: Repository, https://github.com/NextTokenAI/nexttoken
Author-email: NextToken <contact@nexttoken.co>
License-Expression: MIT
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
Requires-Python: >=3.8
Requires-Dist: openai>=1.0.0
Description-Content-Type: text/markdown

# NextToken Python SDK

Simple Python client for the NextToken Gateway - an OpenAI-compatible LLM proxy.

## Installation

```bash
pip install nexttoken
```

## Quick Start

```python
from nexttoken import NextToken

# Initialize with your API key
client = NextToken(api_key="your-api-key")

# Use like the OpenAI SDK
response = client.chat.completions.create(
    model="gpt-4o",  # or "claude-3-5-sonnet", "gemini-2.5-flash"
    messages=[
        {"role": "user", "content": "Hello!"}
    ]
)

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

## Using with OpenAI SDK Directly

Since the Gateway is OpenAI-compatible, you can also use the OpenAI SDK:

```python
from openai import OpenAI

client = OpenAI(
    api_key="your-nexttoken-api-key",
    base_url="https://gateway.nexttoken.co/v1"
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}]
)
```

## Available Models

- OpenAI models
- Anthropic models
- Gemini models
- Openrouter models

## Embeddings

```python
from nexttoken import NextToken

client = NextToken(api_key="your-api-key")

response = client.embeddings.create(
    model="text-embedding-3-small",
    input="Your text to embed"
)

print(response.data[0].embedding)
```

## Get Your API Key

Sign up at [nexttoken.co](https://nexttoken.co) and get your API key from Settings.

## License

MIT
