How to start to use API

To register for Moonshot no dey take time at all. Just go platform.moonshot.ai, create account wit your email, and go di API keys section. Di platform get beta documentation for English and Chinese language, and dem get code examples to show how to join am to your work.
- Register for platform.moonshot.ai and verify your email address.
- Check di developer dashboard and go API Keys section.
- Generate your first API key and keep am well because you no go see am again.
- Install OpenAI Python SDK or use cURL to start your first request.
from openai import OpenAI
client = OpenAI(
api_key="your_moonshot_api_key",
base_url="https://api.moonshot.cn/v1"
)
response = client.chat.completions.create(
model="kimi-k2.5",
messages=[
{"role": "system", "content": "You be beta assistant."},
{"role": "user", "content": "Explain wetin MoE architecture mean."}
],
temperature=0.7
)
print(response.choices[0].message.content)
Dis code dey work exactly like OpenAI API calls. If you want switch from GPT models, you only need to change di base_url and api_key. Every error handling, retry logic, and streaming setup wey you get before go work without any wahala.