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

# save ElevenLabs API key

> Saves or replaces the organization's ElevenLabs API key, for voices that only exist in its own ElevenLabs account: instant clones, Voice Design voices and Professional Voice Clones. Anam checks the key with ElevenLabs on each of its API hosts, including data-residency hosts, and stores it encrypted. Afterwards, `POST /v1/voice-imports` with `useOrganizationKey: true` imports a voice that speaks with it, and ElevenLabs bills that speech to the key's account. The key needs Text to Speech access, which Anam checks without generating speech.



## OpenAPI

````yaml https://api.anam.ai/swagger.json put /v1/voices/elevenlabs-key
openapi: 3.1.0
info:
  title: Anam AI API
  version: '1.0'
servers:
  - url: https://api.anam.ai
    description: Anam API
security:
  - BearerAuth: []
tags:
  - name: Sessions
  - name: Avatar Videos
  - name: Meetings
  - name: Personas
  - name: Avatars
  - name: Voices
  - name: Pronunciation Dictionaries
  - name: LLMs
  - name: Knowledge
  - name: Tools
  - name: Share Links
  - name: Engine
paths:
  /v1/voices/elevenlabs-key:
    put:
      tags:
        - Voices
      summary: Save the organization's ElevenLabs API key
      description: >-
        Saves or replaces the organization's ElevenLabs API key, for voices that
        only exist in its own ElevenLabs account: instant clones, Voice Design
        voices and Professional Voice Clones. Anam checks the key with
        ElevenLabs on each of its API hosts, including data-residency hosts, and
        stores it encrypted. Afterwards, `POST /v1/voice-imports` with
        `useOrganizationKey: true` imports a voice that speaks with it, and
        ElevenLabs bills that speech to the key's account. The key needs Text to
        Speech access, which Anam checks without generating speech.
      operationId: saveElevenLabsKey
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SaveElevenLabsKeyRequest'
      responses:
        '200':
          description: The key was saved. Returns the new status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ElevenLabsKeyStatus'
        '400':
          description: >-
            The body is invalid (`invalid_request`), or ElevenLabs doesn't
            recognize the key on any host, or it's a Cartesia key
            (`invalid_elevenlabs_key`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoiceImportApiError'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoiceImportApiError'
        '403':
          description: API key lacks voice write access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoiceImportApiError'
        '422':
          description: >-
            ElevenLabs knows the key but Anam can't use it yet. It lacks Text to
            Speech access (`elevenlabs_key_missing_permissions`): edit the key
            in ElevenLabs. Or the account's subscription has an unpaid invoice
            (`elevenlabs_payment_issue`): pay it in ElevenLabs. Then retry with
            the same key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoiceImportApiError'
        '429':
          description: >-
            Too many key checks for this organization this hour (`rate_limited`,
            retryable). Each save is checked against every ElevenLabs API host,
            so saves are limited to 10 an hour.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoiceImportApiError'
        '502':
          description: >-
            ElevenLabs didn't answer the key check (`provider_unavailable`,
            retryable).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoiceImportApiError'
        '503':
          description: >-
            The API key could not be checked because of a temporary server
            problem. The key may be valid; retry after `Retry-After` seconds.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoiceImportApiError'
components:
  schemas:
    SaveElevenLabsKeyRequest:
      type: object
      additionalProperties: false
      required:
        - apiKey
      properties:
        apiKey:
          type: string
          minLength: 1
          maxLength: 256
          description: An ElevenLabs API key with Text to Speech access. Never returned.
    ElevenLabsKeyStatus:
      type: object
      required:
        - enabled
        - saved
        - hint
        - voiceCount
        - lastValidatedAt
        - lastUsedAt
      properties:
        enabled:
          type: boolean
          description: >-
            Always true: every organization can save a key and import voices
            with useOrganizationKey. Kept for existing clients.
        saved:
          type: boolean
          description: Whether a key is saved.
        hint:
          type:
            - string
            - 'null'
          description: The saved key's last four characters.
        voiceCount:
          type: integer
          description: Voices that speak with the key.
        lastValidatedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When Anam last checked the key with ElevenLabs.
        lastUsedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When a session last started with the key, recorded at most hourly.
    VoiceImportApiError:
      type: object
      required:
        - code
        - message
        - requestId
        - retryable
      properties:
        code:
          type: string
          description: >-
            Stable machine-readable failure code. `invalid_request`: the body
            failed validation (see `details.issues`).
            `invalid_provider_details`: Anam's own provider configuration is
            missing; contact support (an unsupported provider or model is
            `invalid_request`). `voice_not_accessible`: the provider can't find
            the voice for Anam's account, either a wrong ID or a private voice;
            `message` lists the ways that voice type can reach Anam.
            `provider_rejected`: the provider refused this voice with this
            model; try another model. `voice_bound_elsewhere`: the ElevenLabs
            voice is linked to another organization through its share link, or
            another import is reserving it; imports with `useOrganizationKey`
            aren't affected. `import_in_progress`: another import of the same
            ElevenLabs voice is running; retry. `provider_rate_limited`,
            `provider_unavailable`, `provider_timeout`: provider-side; retry
            when `retryable` is true. `provider_auth_failed`,
            `sample_upload_failed`, `internal_error`: Anam-side; retry later or
            contact support with `requestId`. `organization_key_missing`: no
            ElevenLabs key is saved; save one with PUT
            /v1/voices/elevenlabs-key. `organization_key_rejected`: ElevenLabs
            refused the saved key; save a new one, unless `message` says the fix
            is in ElevenLabs (permissions, plan, credits or an unpaid invoice).
            `invalid_share_link`: `shareUrl` isn't a well-formed ElevenLabs
            share link; a link whose voice ElevenLabs can't find, that is no
            longer shared, or that isn't a Professional Voice Clone gets
            `voice_not_accessible`. `invalid_elevenlabs_key`: ElevenLabs doesn't
            recognise the key sent to PUT /v1/voices/elevenlabs-key, or it's a
            Cartesia key. `elevenlabs_key_missing_permissions`: ElevenLabs knows
            the key but it lacks Text to Speech access; edit the key in
            ElevenLabs and retry with the same key. `elevenlabs_payment_issue`:
            ElevenLabs knows the key but refuses it because the account's
            subscription has an unpaid invoice; pay it in ElevenLabs and retry
            with the same key. `rate_limited`: too many key checks for your
            organization this hour, or your organization's voice imports and
            model changes are at their hourly or concurrent limit; retry after
            `Retry-After` seconds.
          enum:
            - invalid_request
            - invalid_provider_details
            - voice_not_accessible
            - provider_rejected
            - voice_bound_elsewhere
            - import_in_progress
            - provider_rate_limited
            - provider_unavailable
            - provider_timeout
            - provider_auth_failed
            - sample_upload_failed
            - request_cancelled
            - internal_error
            - organization_key_missing
            - organization_key_rejected
            - invalid_share_link
            - invalid_elevenlabs_key
            - elevenlabs_key_missing_permissions
            - elevenlabs_payment_issue
            - rate_limited
        message:
          type: string
          description: >-
            What went wrong and what to do about it, written to be shown to a
            person or acted on by an agent.
        requestId:
          type: string
          description: Quote this when contacting Anam support.
        retryable:
          type: boolean
          description: Whether the same request may succeed if repeated later.
        docsUrl:
          type: string
          format: uri
          description: >-
            Documentation that explains the fix. Optional: present on some
            codes, such as `voice_not_accessible` and the `organization_key_*`
            codes.
        details:
          type: object
          additionalProperties: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

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