Nexevo.aiNexevo.ai

Resource management

Conversation history

Optional module for backend persistence of chat UI. Each conversation is a container with title/metadata. The append message does not trigger LLM but only persists (used with chat completions). Full CRUD + message append.

python
conv = client.conversations.create(title="My Session")
client.conversations.append_message(
    conv["conversation_id"], role="user", content="Hello!",
)
all_convs = client.conversations.list(limit=20)
detail = client.conversations.get(conv["conversation_id"])
POST /conversations
titlestringOptional对话标题。可后续 update。
metadataobjectOptional任意 JSON,关联你自己的 user_id / session_id / topic 等。最大 4KB。
POST /conversations/{id}/messages
role"user" | "assistant" | "system" | "tool"Required消息角色。
contentstringRequired消息文本。注意:此 endpoint 只持久化,不触发 LLM。

Account management

Registration/Login/Password Reset/2FA/Profile Editing/GDPR Self-Service Deactivation. Most endpoints are for web application flows; backend integration is just me() / change-password / 2FA. All protected endpoints use Bearer tokens.

python
me = client.auth.me()
client.auth.update_profile(full_name="Jane Doe")
client.auth.change_password(
    current_password="old-pwd",
    new_password="new-pwd-123",
)
status = client.auth.two_fa_status()

API key management

Dynamically create/revoke API key, and can set monthly consumption limit (monthly_spend_cap_usd), over-threshold alarm webhook (HTTPS only), and geographical routing policy (cn-only / overseas-only / any). create() returns full_key only once, be sure to save it.

full_key is displayed only once
The full_key returned by create() is the sk-xc-... complete string, which Nexevo will never display again (only the hash is stored). Be sure to save to the key manager or .env file immediately when created. If lost, it can only be undone and rebuilt.
python
new = client.keys.create(name="prod-2026")
print(new["full_key"])  # 只此一次显示

client.keys.update_spend_cap(
    new["key"]["key_id"],
    monthly_spend_cap_usd="100",
)

client.keys.update_alert_webhook(
    new["key"]["key_id"],
    url="https://your-app.com/billing-alert",
)
POST /keys
namestringRequiredKey 显示名(用于在 dashboard 区分)。1-100 字符。
PATCH /keys/{id}/spend-cap
monthly_spend_cap_usdstringOptional月度上限 USD,字符串保留精度(如 "100.00")。超 cap 后该 key 该月所有请求被拒。
clearbooleanDefault: falsetrue = 清除当前 cap(无限额)。

Bill/Usage/Recharge

Balance, daily usage, by-tier breakdown (by_tier: fast / balanced / passthrough / byok), Stripe top-up. Billing tier is determined by the request's `model` field — `model=nexevo/fast` → fast flat-rate; a real model id → passthrough +5%. Treat all monetary strings as decimal — do not parse them as floats.

Use a string for the amount, do not use parseFloat
All amounts (balance_usd / cost / amount_usd) are returned as strings, retaining the original precision (decimal). Direct parseFloat may lose the mantissa, so use the Decimal/BigNumber library instead for addition and subtraction.
python
bal   = client.billing.balance()
usage = client.billing.usage(days=7)
plan  = client.billing.get_plan()

hint = client.billing.upgrade_hint()
if hint["hint"]:
    print(f"建议: {hint['hint']['recommend_plan']}, "
          f"可省 {hint['hint']['savings_pct']}%")

session = client.billing.checkout(
    amount_usd=20,
    idempotency_key="topup-2026-04-27-001",
)
print(session["checkout_url"])
POST /billing/topup · POST /billing/checkout
amount_usdnumberRequired充值金额 USD,> 0。
idempotency_keystringRequired幂等 key,同 key 重试不会重复扣款。建议格式:topup-YYYY-MM-DD-序号。

Organization/Multiple Users

Multi-user management of business accounts. Supports three roles: owner/admin/developer, member invitation/removal/transfer ownership. All keys + billing are shared under the organization name, suitable for company team access.

python
org = client.organizations.create("Acme Inc")

client.organizations.invite_member(
    org["organization"]["org_id"],
    email="dev@acme.com",
    role="developer",
)

members = client.organizations.list_members(org["organization"]["org_id"])

client.organizations.transfer_owner(
    org["organization"]["org_id"],
    new_owner_user_id="u_789",
)

RLHF Feedback

Get generation_id from chat response header X-Nexevo-Generation-Id, submit thumbs up/down + optional comment + tag. The feedback goes directly to the data flywheel, and the self-learning routing will use it to optimize future model selections.

python
resp = client.chat.completions.create(
    model="nexevo/balanced",
    messages=[{"role": "user", "content": "Hello!"}],
)
gen_id = resp["nexevo"]["generation_id"]

client.feedback.submit(
    generation_id=gen_id,
    rating=1,
    comment="Helpful!",
    tags=["accurate"],
)

summary = client.feedback.summary(days=7)
POST /feedback
generation_idstringRequired从 chat 响应头 X-Nexevo-Generation-Id 或 SDK resp.nexevo.generation_id 拿。
rating1 | -1Required1 = 👍, -1 = 👎。
commentstringOptional可选自由文本(最多 ~2K 字符)。
tagsstring[]Optional可选标签。常用: accurate / incorrect / too_verbose / irrelevant
Feedback goes directly to self-learning routing
Submitted thumbs up/down are not just statistics — the self-learning router (bandit + ELO) will use them to adjust future selection models in real time. More feedback = automatic improvement in product quality.

Next step

Resource management — Nexevo Docs | Nexevo.ai