Nexevo.aiNexevo.ai
← All examples
Get started in 5 minutes

Get started with the official Python SDK

Replace OpenAI compat with the nexevo-ai package and enjoy typed API + direct access to Nexevo extensions (balance/feedback/model library).

Python
python
# pip install nexevo-ai
from nexevo_ai import Nexevo

client = Nexevo(api_key="sk-xc-...") # Or read NEXEVO_API_KEY environment variable

#1) Chat
resp = client.chat.completions.create(
    model="nexevo/balanced",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(resp["choices"][0]["message"]["content"])

# 2) Browse the model library
catalog = client.models.browse()
print(f"{catalog['total']} models")

# 3) Check your balance
print(client.billing.balance())

# 4) Submit feedback (generation_id comes from chat response)
client.feedback.submit(
    generation_id=resp["nexevo"]["generation_id"],
    rating=1,
)
Get started with the official Python SDK — Nexevo Cookbook | Nexevo.ai