Skip to main content

🤖 Kimi API

A simple yet working Python client for interacting with the Kimi AI assistant (Bypass log-in + all chats options)

Python License PyPI

🚀 Installation

pip install kimi4free

⚡ Quick Start

from kimi4free import KimiClient

# Initialize the client
client = KimiClient()

# 💬 Get response without streaming
response = client.chat("Hello, how are you?")
print(response)

# 🌊 Stream response to console
response = client.chat("Tell me a joke", stream=True)
print(f"\nComplete response: {response}")

📖 Usage

💭 Basic Chat

from kimi4free import KimiClient

# Create client instance
client = KimiClient()

# Simple chat interaction
response = client.chat("What's 2+2?")
print(response)

🌊 Streaming Response

# Stream output to console while building full response
response = client.chat("Write a short poem", stream=True)
print(f"\n\nFull poem: {response}")

⚙️ Advanced Parameters

# 🔍 Disable search and deep research
response = client.chat(
    "Hello", 
    use_search=False, 
    use_deep_research=False
)

# 🎯 Use different model
response = client.chat("Hi there", model="k2")

📚 API Reference

🏗️ KimiClient(debug=False)

Creates a new Kimi API client instance.

  • Parameters:
    • 🐞 debug (bool): Enable debug output to see internal steps and responses.

💬 client.chat(message, stream=False, chat_id=None, **kwargs)

  • chat_id only if you want to continue a conversation.

Send a message and automatically create a new chat session if none is provided.

Parameters:

  • 📝 message (str): Your message
  • 🌊 stream (bool): Stream output to console (default: False)
  • 🤖 model (str): AI model to use (default: "k2" other: k1.5)
  • 🔍 use_search (bool): Enable web search (default: True)
  • 🔬 use_deep_research (bool): Enable deep research (default: True)
  • 🧠 use_semantic_memory (bool): Use semantic memory (default: False)

Returns: 📤 Complete response text

🆕 client.create_chat()

Create a new chat session.

Returns: 🆔 Chat ID string

📨 client.send_message(chat_id, message, **kwargs)

Send a message to an existing chat session.

Parameters:

  • 🆔 chat_id (str): Chat session ID
  • 📝 message (str): Your message
  • ⚙️ All parameters from chat() method

Returns: 📤 Complete response text

🎯 Features

  • 🌊 Real-time streaming support
  • 🔍 Web search integration
  • 🔬 Deep research capabilities
  • 📱 Lightweight and fast

🤝 Contributing

We welcome contributions! We are still missing upload functionality, feel free to pull request !

📄 License

This project is licensed under the MIT License.

💖 Support

If you find this project helpful:

  • ⭐ Star this repository
  • 🐛 Report issues
  • 💡 Suggest new features
  • 🤝 Contribute code

Made with ❤️ by the community

⭐ Star on GitHub • 📦 PyPI Package

Metadata

Release files for kimi4free 0.1.3

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

Source distribution (sdist)

Source distribution for kimi4free 0.1.3
File Size Uploaded Provenance
kimi4free-0.1.3.tar.gz 4.3 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 8.9 kB

Release files / kimi4free-0.1.3.tar.gz

Download URL kimi4free-0.1.3.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
769a9a2a6320f43ceb4495e4c1c38a29359dbb0a511e99224104c71073b24156
BLAKE2b-256 checksum
How to use checksums
96dc9893529ae99d5c3843f43f6e34528175d5176e0c45166d131e18b8d6e02b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.0

Release files / kimi4free-0.1.3-py3-none-any.whl

Download URL kimi4free-0.1.3-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c060945784467ef371557de4a6f94a2ae693e124a8d3bc4d7d42e499bbc8d94
BLAKE2b-256 checksum
How to use checksums
9e58cd20b91b41d84619d770e9178e8adf29beb77b6fde2db7877e93f64c774a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.0

Security for kimi4free 0.1.3

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.

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