> ## Documentation Index
> Fetch the complete documentation index at: https://docs.venice.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate API Key with Web3 Wallet

> Authenticates a wallet holding sVVV and creates an API key.

## Autonomous Agent API Key Creation

Please see [this guide](/guides/integrations/generating-api-key-agent) on how to use this endpoint.

***


## OpenAPI

````yaml POST /api_keys/generate_web3_key
openapi: 3.0.0
info:
  description: The Venice.ai API.
  termsOfService: https://venice.ai/legal/tos
  title: Venice.ai API
  version: '20261006.212130'
  x-guidance: >-
    Venice.ai is an OpenAI-compatible inference API supporting text, image,
    audio, and video generation.


    **Authentication options:**

    - API Key: Use Bearer token in Authorization header

    - x402 Wallet: Use USDC credits via EVM or Solana wallet (no account
    required)


    **For x402 wallet access:**

    1. POST /x402/top-up without headers to get payment requirements

    2. Choose one of the returned Base or Solana payment options and sign a USDC
    payment using the x402 SDK

    3. POST /x402/top-up with PAYMENT-SIGNATURE header to add credits

    4. Call any inference endpoint with SIGN-IN-WITH-X header


    **Pricing:** Prepaid credits consumed per request. Check /models for
    available models and their capabilities.
servers:
  - url: https://api.venice.ai/api/v1
security:
  - BearerAuth: []
tags:
  - description: >-
      Generate speech/audio, transcribe audio, and manage asynchronous audio
      generation jobs.
    name: Audio
  - description: >-
      Given a list of messages comprising a conversation, the model will return
      a response. Supports multimodal inputs including text, images, audio
      (input_audio), and video (video_url) for compatible models.
    name: Chat
  - description: >-
      Create vector embeddings from text. `input` must be a string or an array
      of strings. Token arrays are not supported. LangChain OpenAIEmbeddings
      must set `check_embedding_ctx_length=False` to send text instead of
      tiktoken IDs.
    name: Embeddings
  - description: >-
      Evaluate a state against typed questions and get structured answers
      (yes/no probabilities, option picks with distributions, rubric scores).
      **Beta**: This API is currently in beta and may be unstable.
      Request/response schemas and behavior may change without notice.
    name: Decisions
  - description: List and describe the various models available in the API.
    name: Models
  - description: Generate and manipulate images using AI models.
    name: Image
  - description: Generate videos using AI models.
    name: Video
  - description: List and retrieve character information for use in completions.
    name: Characters
  - description: >-
      Billing and usage analytics. **Beta**: This API is currently in beta and
      may be unstable. Endpoints, request/response schemas, and behavior may
      change without notice.
    name: Billing
  - description: Proxy JSON-RPC requests to blockchain nodes. Billed per credit.
    name: Crypto RPC
  - description: >-
      Wallet-based API access using the x402 protocol. No API key required —
      authenticate with an EVM or Solana wallet.


      **How it works:**

      1. **Authenticate** — Send a `SIGN-IN-WITH-X` header (base64-encoded
      signed SIWX payload) with any request. EVM wallets sign an EIP-4361 SIWE
      message; Solana wallets sign the Solana SIWX message with Ed25519. See the
      `siwx` security scheme for the exact format.

      2. **Top up** — `POST /x402/top-up` without a payment header returns an
      `accepts` array with Base and Solana USDC payment options. Choose one
      entry, sign it using the x402 SDK (`npm install x402`), and re-submit with
      the `PAYMENT-SIGNATURE` header (the legacy `X-402-Payment` and `X-PAYMENT`
      names are also accepted).

      3. **Use any endpoint** — All inference endpoints (chat, image, audio,
      video, embeddings) accept `siwx` as an alternative to `BearerAuth`.
      Charges are deducted from your USDC credit balance.

      4. **Monitor balance** — `GET /x402/balance/{walletAddress}` returns your
      current balance. The `X-Balance-Remaining` response header on inference
      calls also reports it.


      **Quick start (5 lines):**

      ```

      import { VeniceClient } from '@venice-ai/x402-client'

      const venice = new VeniceClient(process.env.WALLET_KEY)

      await venice.topUp(10) // $10 USDC on a supported x402 rail

      const res = await venice.chat({ model: 'zai-org-glm-5-1', messages: [{
      role: 'user', content: 'Hello!' }] })

      ```


      **Payment:** USDC on Base (chain ID 8453) or Solana mainnet. Minimum
      top-up: $5. Alternatively, stake DIEM tokens for daily credits (1 DIEM =
      $1/day).
    name: x402
externalDocs:
  description: Venice.ai API documentation
  url: https://docs.venice.ai
paths:
  /api_keys/generate_web3_key:
    post:
      tags:
        - API Keys
      summary: /api/v1/api_keys/generate_web3_key
      description: Authenticates a wallet holding sVVV and creates an API key.
      operationId: postApiKeyGenerateWeb3Key
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                apiKeyType:
                  type: string
                  enum:
                    - INFERENCE
                    - ADMIN
                  description: >-
                    The API Key type. Admin keys have full access to the API
                    while inference keys are only able to call inference
                    endpoints.
                  example: ADMIN
                consumptionLimit:
                  type: object
                  properties:
                    usd:
                      anyOf:
                        - type: number
                          minimum: 0
                          maximum: 9999999999
                        - nullable: true
                          title: 'null'
                        - nullable: true
                          title: 'null'
                      description: USD limit
                      example: 50
                    diem:
                      anyOf:
                        - type: number
                          minimum: 0
                          maximum: 9999999999
                        - nullable: true
                          title: 'null'
                        - nullable: true
                          title: 'null'
                      description: Diem limit
                      example: 10
                    vcu:
                      anyOf:
                        - type: number
                          minimum: 0
                          maximum: 9999999999
                        - nullable: true
                          title: 'null'
                        - nullable: true
                          title: 'null'
                      description: VCU limit (deprecated - use Diem instead)
                      deprecated: true
                      example: 100
                  description: >-
                    The API Key consumption limits, evaluated against the window
                    selected by `limitPeriod`.
                  example:
                    usd: 50
                    diem: 10
                    vcu: 30
                limitPeriod:
                  type: string
                  enum:
                    - EPOCH
                    - MONTH
                    - LIFETIME
                  description: >-
                    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.
                  example: MONTH
                modelPrivacy:
                  type: string
                  enum:
                    - ALL
                    - PRIVATE_TEXT
                    - PRIVATE_ONLY
                  description: >-
                    Which models this key may call, by privacy tier. `ALL`
                    allows every model. `PRIVATE_TEXT` requires text and
                    embedding models to be Private, TEE, or E2EE while other
                    modalities may be Anonymous or Private. `PRIVATE_ONLY`
                    requires every model to be Private, TEE, or E2EE; Anonymous
                    models are rejected.
                  example: ALL
                description:
                  type: string
                  default: Web3 API Key
                  description: The API Key description
                  example: Web3 API Key
                expiresAt:
                  anyOf:
                    - type: string
                      enum:
                        - ''
                    - type: string
                      pattern: ^\d{4}-\d{2}-\d{2}$
                    - type: string
                      pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$
                  description: >-
                    The API Key expiration date. If not provided, the key will
                    not expire.
                  example: '2023-10-01T12:00:00.000Z'
                ipAllowlist:
                  type: array
                  items:
                    type: string
                    maxLength: 64
                  maxItems: 100
                  description: >-
                    Globally reachable IPv4 or IPv6 addresses and CIDR subnets
                    allowed to use this key. An empty list allows requests from
                    any IP address.
                  example:
                    - 11.22.33.44
                    - 11.22.33.0/24
                    - 2a00:1::/48
                address:
                  type: string
                  description: The wallet's address
                  example: '0x45B73055F3aDcC4577Bb709db10B19d11b5c94eE'
                signature:
                  type: string
                  description: The token, signed with the wallet's private key
                  example: >-
                    0xbb5ff2e177f3a97fa553057864ad892eb64120f3eaf9356b4742a10f9a068d42725de895b5e45160b679cbe6961dc4cb552ba10dc97bdd8258d9154810785c451c
                token:
                  type: string
                  description: >-
                    The token obtained from
                    https://api.venice.ai/api/v1/api_keys/generate_web3_key
                  example: >-
                    eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
              required:
                - apiKeyType
                - address
                - signature
                - token
              additionalProperties: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      apiKey:
                        type: string
                        description: >-
                          The API Key. This is only shown once, so make sure to
                          save it somewhere safe.
                      apiKeyType:
                        type: string
                        enum:
                          - INFERENCE
                          - ADMIN
                        description: The API Key type
                        example: ADMIN
                      consumptionLimit:
                        type: object
                        properties:
                          usd:
                            anyOf:
                              - type: number
                                minimum: 0
                                maximum: 9999999999
                              - nullable: true
                                title: 'null'
                              - nullable: true
                                title: 'null'
                            description: USD limit
                            example: 50
                          diem:
                            anyOf:
                              - type: number
                                minimum: 0
                                maximum: 9999999999
                              - nullable: true
                                title: 'null'
                              - nullable: true
                                title: 'null'
                            description: Diem limit
                            example: 10
                          vcu:
                            anyOf:
                              - type: number
                                minimum: 0
                                maximum: 9999999999
                              - nullable: true
                                title: 'null'
                              - nullable: true
                                title: 'null'
                            description: VCU limit (deprecated - use Diem instead)
                            deprecated: true
                            example: 100
                        description: >-
                          The API Key consumption limits, evaluated against the
                          window selected by `limitPeriod`.
                        example:
                          usd: 50
                          diem: 10
                          vcu: 30
                      limitPeriod:
                        type: string
                        enum:
                          - EPOCH
                          - MONTH
                          - LIFETIME
                        description: >-
                          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.
                        example: MONTH
                      modelPrivacy:
                        type: string
                        enum:
                          - ALL
                          - PRIVATE_TEXT
                          - PRIVATE_ONLY
                        description: >-
                          Which models this key may call, by privacy tier. `ALL`
                          allows every model. `PRIVATE_TEXT` requires text and
                          embedding models to be Private, TEE, or E2EE while
                          other modalities may be Anonymous or Private.
                          `PRIVATE_ONLY` requires every model to be Private,
                          TEE, or E2EE; Anonymous models are rejected.
                        example: ALL
                      description:
                        type: string
                        description: The API Key description
                        example: Example API Key
                      expiresAt:
                        type: string
                        nullable: true
                        description: The API Key expiration date
                        example: '2023-10-01T12:00:00.000Z'
                      id:
                        type: string
                        description: The API Key ID
                        example: e28e82dc-9df2-4b47-b726-d0a222ef2ab5
                      ipAllowlist:
                        type: array
                        items:
                          type: string
                        maxItems: 100
                        description: >-
                          Globally reachable IPv4 or IPv6 addresses and CIDR
                          subnets allowed to use this key. An empty list allows
                          requests from any IP address. Entries are returned in
                          canonical CIDR notation.
                        example:
                          - 11.22.33.44/32
                          - 11.22.33.0/24
                          - 2a00:1::/48
                    required:
                      - apiKey
                      - apiKeyType
                      - consumptionLimit
                      - limitPeriod
                      - modelPrivacy
                      - expiresAt
                      - id
                      - ipAllowlist
                    additionalProperties: false
                  success:
                    type: boolean
                required:
                  - data
                  - success
                additionalProperties: false
      security: []
components:
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.