A way of using Kimi for free; even with login features.
Project description
๐ค Kimi API
A simple yet working Python client for interacting with the Kimi AI assistant (Bypass log-in + all chats options)
๐ 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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kimi4free-0.1.3.tar.gz.
File metadata
- Download URL: kimi4free-0.1.3.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
769a9a2a6320f43ceb4495e4c1c38a29359dbb0a511e99224104c71073b24156
|
|
| MD5 |
1ea55aa51bf324bb45bc06b4a125a504
|
|
| BLAKE2b-256 |
96dc9893529ae99d5c3843f43f6e34528175d5176e0c45166d131e18b8d6e02b
|
File details
Details for the file kimi4free-0.1.3-py3-none-any.whl.
File metadata
- Download URL: kimi4free-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c060945784467ef371557de4a6f94a2ae693e124a8d3bc4d7d42e499bbc8d94
|
|
| MD5 |
54a16974647a778e334ae77d16e95eff
|
|
| BLAKE2b-256 |
9e58cd20b91b41d84619d770e9178e8adf29beb77b6fde2db7877e93f64c774a
|