API Interaction

You can interact with the ShuttleAI API via HTTP requests from any programming language or directly through our Official Python Library.

For a more interactive experience, try our Shuttle Chat interface, which allows you to communicate with the API in a user-friendly environment.

Getting Started with the Python Library

Installation

You can use pip to install the ShuttleAI library in your Python environment.

To ensure optimal functionality, we strongly recommend using the latest version of our library.
pip install -U shuttleai

Usage

import asyncio
from shuttleai import AsyncShuttleAI

async def main():
    shuttleai = AsyncShuttleAI()

    response = await shuttleai.chat.completions.create(
        model="shuttle-3",
        messages=[{"role": "user", "content": "Imagine an AI like no other, it's name is ShuttleAI."}],
    )

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

asyncio.run(main())
For more examples using the Python library, refer to the examples directory in the GitHub repository.