Skip to main content

Inception API Client Library

A Python client library and CLI for the Inception AI API, featuring Pydantic models for type safety and data validation. The library provides both a programmatic interface and a command-line tool for interacting with the Inception AI API.

Installation

# Install from source
pip install -e .

# Or install dependencies directly
pip install -r requirements.txt

Command Line Interface

The library includes a full-featured CLI for interacting with the Inception AI API.

Authentication

# Log in to Inception AI
inception-api auth login

# Optionally pass your email and password directly from the CLI
inception-api auth login --email "email@example.com" --password "super-secret-password"

# Check authentication status
inception-api auth status

# Log out
inception-api auth logout

Chat Management

# List all chats
inception-api chats list

# Create a new chat
inception-api chats new

# Delete a chat
inception-api chats delete <chat_id>

# Set default chat for input/chat commands
inception-api chats set-default <chat_id>

Chat Interaction

# Send a single message (uses default chat)
inception-api input "What is Python?"

# Start interactive chat session
inception-api chat

In interactive chat mode:

  • Type your messages and press Enter
  • Use /quit to exit
  • Press Ctrl+C to exit
  • Responses are streamed in real-time

Python Library Usage

Basic Usage

from inception_api import Inception, Message

# Initialize the client
client = Inception(api_key="your_api_key")

# Create a new chat
chat = client.create_chat("Hello, how can you help me today?")

# Send messages and get streaming responses
messages = [
    Message(role="user", content="What is Python?"),
]

for chunk in client.chat_completion(messages):
    if "content" in chunk.choices[0].delta:
        print(chunk.choices[0].delta["content"], end="")

# List chats
chats = client.list_chats(page=1)

# Delete a chat
client.delete_chat(chat_id="chat_id_here")

Advanced Usage

# Custom model selection
chat = client.create_chat(
    "Hello!",
    model="lambda.mercury-coder-small"
)

# Chat completion with specific session and chat IDs
for chunk in client.chat_completion(
    messages=[Message(role="user", content="Hello!")],
    model="lambda.mercury-coder-small",
    session_id="custom_session_id",
    chat_id="custom_chat_id"
):
    print(chunk.choices[0].delta.get("content", ""), end="")

Features

Client Library

  • Full type safety with Pydantic models
  • Streaming chat completions support
  • Chat management (create, list, delete)
  • API structure similar to OpenAI's Python client
  • Comprehensive error handling
  • Configurable API endpoints

CLI Tool

  • Interactive chat mode with streaming responses
  • Chat management commands
  • Secure authentication handling
  • Configuration stored in platform-specific user directories
  • Rich terminal output with formatting
  • Command history in interactive mode

Data Models

The library includes Pydantic models for all API objects:

  • Message: Chat message with role and content
  • Chat: Chat session with history and metadata
  • ChatCompletionChunk: Streaming response chunk
  • ChatHistory: Message history management
  • ContentFilterResults: Content moderation results

Development

Running Tests

# Install test dependencies
pip install pytest pytest-cov

# Run all tests
pytest

# Run without integration tests
pytest -m "not integration"

# Run with coverage report
pytest --cov=inception_api

Project Structure

inception-api/
├── inception_api/
│   ├── __init__.py
│   ├── client.py    # Core API client
│   └── main.py      # CLI implementation
├── tests/
│   ├── conftest.py
│   ├── test_client.py
│   └── test_cli.py
├── pyproject.toml
├── requirements.txt
└── README.md

Requirements

  • Python ≥ 3.8
  • httpx ≥ 0.24.0
  • pydantic ≥ 2.0.0
  • click ≥ 8.0.0
  • platformdirs ≥ 3.0.0
  • rich ≥ 13.0.0
  • sseclient-py ≥ 1.8.0

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Metadata

Release files for inception 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 inception 0.1.0
File Size Uploaded Provenance
inception-0.1.0.tar.gz 9.6 kB With provenance Details

Built distribution (wheel)

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

Total release size: 19.6 kB

Release files / inception-0.1.0.tar.gz

Download URL inception-0.1.0.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1537206b0ae22528c8e04635fcf94a23ee3ea7c908c4068ca7334e98bfdf7a7c
BLAKE2b-256 checksum
How to use checksums
bc4afe367d5700d0b9374cdb35570ca97d712b6026ef6b041bd08cd5f7fc8fa2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 18, 2025.

Transparency log

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

Download URL inception-0.1.0-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
623da8b6afc1f885e0330f95c5959d7424582ff3bd2a8ea56cd6b3f69e4fd0be
BLAKE2b-256 checksum
How to use checksums
a61f67a0ae94238698579b803fa144a8abcc9d2b9e8f5255c0006a042ff7b167
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 18, 2025.

Transparency log

Security for inception 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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for inception-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 18, 2025.

Transparency log

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 Full 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