Skip to main content

Client for Stream Chat.

Project description


build codecov PyPI version PyPI - Python Version

the official Python API client for Stream chat a service for building chat applications.

You can sign up for a Stream account at

You can use this library to access chat API endpoints server-side, for the client-side integrations (web and mobile) have a look at the Javascript, iOS and Android SDK libraries (


pip install stream-chat


Official API docs

How to build a chat app with Python tutorial

Chat with Python, Django and React

Supported features

  • Chat channels
  • Messages
  • Chat channel types
  • User management
  • Moderation API
  • Push configuration
  • User devices
  • User search
  • Channel search



from stream_chat import StreamChat

def main():
    chat = StreamChat(api_key="STREAM_KEY", api_secret="STREAM_SECRET")

    # add a user
    chat.update_user({"id": "chuck", "name": "Chuck"})

    # create a channel about kung-fu
    channel ="messaging", "kung-fu")

    # add a first message to the channel
    channel.send_message({"text": "AMA about kung-fu"}, "chuck")

if __name__ == '__main__':


import asyncio
from stream_chat import StreamChatAsync

async def main():
    async with StreamChatAsync(api_key="STREAM_KEY", api_secret="STREAM_SECRET") as chat:
        # add a user
        await chat.update_user({"id": "chuck", "name": "Chuck"})

        # create a channel about kung-fu
        channel ="messaging", "kung-fu")
        await channel.create("chuck")

        # add a first message to the channel
        await channel.send_message({"text": "AMA about kung-fu"}, "chuck")

if __name__ == '__main__':
    loop = asyncio.get_event_loop()


Install deps

pip install .[test, ci]

First, make sure you can run the test suite. Tests are run via py.test

export STREAM_KEY=my_api_key
export STREAM_SECRET=my_api_secret

make test

Run linters

make lint

Releasing a new version

In order to release new version you need to be a maintainer on Pypi.

  • Update CHANGELOG
  • Make sure you have twine installed (pip install twine)
  • Update the version on
  • Commit and push to Github
  • Create a new tag for the version (eg. v2.9.0)
  • Create a new dist with python python sdist
  • Upload the new distributable with twine twine upload dist/stream-chat-VERSION-NAME.tar.gz

If unsure you can also test using the Pypi test servers twine upload --repository-url dist/stream-chat-VERSION-NAME.tar.gz

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for stream-chat, version 3.5.0
Filename, size File type Python version Upload date Hashes
Filename, size stream-chat-3.5.0.tar.gz (23.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page