الانتقال إلى المحتوى الرئيسي
PATCH
/
api_keys
/api/v1/api_keys
curl --request PATCH \
  --url https://api.venice.ai/api/v1/api_keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "id": "e28e82dc-9df2-4b47-b726-d0a222ef2ab5",
  "consumptionLimit": {
    "usd": 50,
    "diem": 10,
    "vcu": 30
  },
  "limitPeriod": "MONTH",
  "description": "Updated API Key Name",
  "expiresAt": "2023-10-01T12:00:00.000Z"
}
'
{
  "data": {
    "apiKeyType": "ADMIN",
    "consumptionLimits": {
      "usd": 50,
      "diem": 10,
      "vcu": 30
    },
    "limitPeriod": "MONTH",
    "createdAt": "2023-10-01T12:00:00.000Z",
    "expiresAt": "2023-10-01T12:00:00.000Z",
    "id": "e28e82dc-9df2-4b47-b726-d0a222ef2ab5",
    "last6Chars": "2V2jNW",
    "lastUsedAt": "2023-10-01T12:00:00.000Z",
    "description": "Updated API Key"
  },
  "success": true
}

التفويضات

Authorization
string
header
مطلوب

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

الجسم

application/json

The request body for updating an existing API key. The description, expiration date, consumption limits and limit period (epoch / month / lifetime) can be updated.

id
string
مطلوب

The API Key ID to update

مثال:

"e28e82dc-9df2-4b47-b726-d0a222ef2ab5"

consumptionLimit
object

The API Key consumption limits, evaluated against the window selected by limitPeriod.

مثال:
{ "usd": 50, "diem": 10, "vcu": 30 }
limitPeriod
enum<string>

Reset window the consumption limits apply to. EPOCH resets every UTC day (legacy default). MONTH resets on the 1st of each UTC calendar month. LIFETIME never resets, so the limit acts as a permanent cap on the key.

الخيارات المتاحة:
EPOCH,
MONTH,
LIFETIME
مثال:

"MONTH"

description
string

The API Key description

مثال:

"Updated API Key Name"

expiresAt

The API Key expiration date. Set to empty string or null to remove expiration.

الخيارات المتاحة:
مثال:

"2023-10-01T12:00:00.000Z"

الاستجابة

OK

data
object
مطلوب
success
boolean
مطلوب