A simple yet working Python client for interacting with the Kimi AI assistant (Bypass log-in + all chats options)
pip install kimi4freefrom 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}")from kimi4free import KimiClient
# Create client instance
client = KimiClient()
# Simple chat interaction
response = client.chat("What's 2+2?")
print(response)# Stream output to console while building full response
response = client.chat("Write a short poem", stream=True)
print(f"\n\nFull poem: {response}")# 🔍 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")Creates a new Kimi API client instance.
- Parameters:
-
- 🐞
debug(bool): Enable debug output to see internal steps and responses.
- 🐞
- 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
Create a new chat session.
Returns: 🆔 Chat ID string
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
- 🌊 Real-time streaming support
- 🔍 Web search integration
- 🔬 Deep research capabilities
- 📱 Lightweight and fast
We welcome contributions! We are still missing upload functionality, feel free to pull request !
This project is licensed under the MIT License.
If you find this project helpful:
- ⭐ Star this repository
- 🐛 Report issues
- 💡 Suggest new features
- 🤝 Contribute code
Made with ❤️ by the community