import anthropic
# Initialize the client. If you have already set the API Key and base URL
# through the environment variables `ANTHROPIC_BASE_URL` and `ANTHROPIC_API_KEY`,
# you can omit the `api_key` and `base_url` parameters.
client = anthropic.Anthropic(
base_url="https://api.highwayapi.ai/anthropic",
api_key="<JieKou AI API Key>",
# Override headers
default_headers={
"Content-Type": "application/json",
"Authorization": "Bearer <JieKou AI API Key>",
}
)
message = client.messages.create(
model="moonshotai/kimi-k2-instruct",
max_tokens=1000,
temperature=1,
system=[
{
"type": "text",
"text": "You are the JieKou AI AI assistant. You help users with an honest and professional attitude, and answer questions in English."
}
],
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "Who are you?"
}
]
}
]
)
print(message.content)