import anthropic
# Inicialice el cliente. Si ya ha configurado la API Key y la base URL
# mediante las variables de entorno `ANTHROPIC_BASE_URL` y `ANTHROPIC_API_KEY`,
# puede omitir los parámetros `api_key` y `base_url`.
client = anthropic.Anthropic(
base_url="https://api.highwayapi.ai/anthropic",
api_key="<JieKou AI API Key>",
# Sobrescribir header
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": "Eres el asistente de IA de JieKou AI; ayudarás a los usuarios con una actitud honesta y profesional, y responderás las preguntas en español."
}
],
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "¿Quién eres?"
}
]
}
]
)
print(message.content)