Zum Hauptinhalt springen
POST
/
api_keys
/
generate_web3_key
/api/v1/api_keys/generate_web3_key
curl --request POST \
  --url https://api.venice.ai/api/v1/api_keys/generate_web3_key \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "apiKeyType": "ADMIN",
  "address": "0x45B73055F3aDcC4577Bb709db10B19d11b5c94eE",
  "signature": "0xbb5ff2e177f3a97fa553057864ad892eb64120f3eaf9356b4742a10f9a068d42725de895b5e45160b679cbe6961dc4cb552ba10dc97bdd8258d9154810785c451c",
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
  "consumptionLimit": {
    "usd": 50,
    "diem": 10,
    "vcu": 30
  },
  "limitPeriod": "MONTH",
  "description": "Web3 API Key",
  "expiresAt": "2023-10-01T12:00:00.000Z"
}
'
{
  "data": {
    "apiKey": "<string>",
    "apiKeyType": "ADMIN",
    "consumptionLimit": {
      "usd": 50,
      "diem": 10,
      "vcu": 30
    },
    "limitPeriod": "MONTH",
    "expiresAt": "2023-10-01T12:00:00.000Z",
    "id": "e28e82dc-9df2-4b47-b726-d0a222ef2ab5",
    "description": "Example API Key"
  },
  "success": true
}

Autonome Erstellung von Agenten-API-Schlüsseln

Bitte lesen Sie diesen Leitfaden, um zu erfahren, wie Sie diesen Endpoint verwenden.

Autorisierungen

Authorization
string
header
erforderlich

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

Body

application/json
apiKeyType
enum<string>
erforderlich

The API Key type. Admin keys have full access to the API while inference keys are only able to call inference endpoints.

Verfügbare Optionen:
INFERENCE,
ADMIN
Beispiel:

"ADMIN"

address
string
erforderlich

The wallet's address

Beispiel:

"0x45B73055F3aDcC4577Bb709db10B19d11b5c94eE"

signature
string
erforderlich

The token, signed with the wallet's private key

Beispiel:

"0xbb5ff2e177f3a97fa553057864ad892eb64120f3eaf9356b4742a10f9a068d42725de895b5e45160b679cbe6961dc4cb552ba10dc97bdd8258d9154810785c451c"

token
string
erforderlich
Beispiel:

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"

consumptionLimit
object

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

Beispiel:
{ "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.

Verfügbare Optionen:
EPOCH,
MONTH,
LIFETIME
Beispiel:

"MONTH"

description
string
Standard:Web3 API Key

The API Key description

Beispiel:

"Web3 API Key"

expiresAt

The API Key expiration date. If not provided, the key will not expire.

Verfügbare Optionen:
Beispiel:

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

Antwort

200 - application/json

OK

data
object
erforderlich
success
boolean
erforderlich