> ## 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.



## 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.
      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 didn't accept
            the key on any host (`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, or the feature isn't enabled for
            this organization (`organization_key_unavailable`).
          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'
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: >-
            Whether this organization can save a key and import voices with
            useOrganizationKey.
        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`: the provider or model is missing or
            unsupported. `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 was imported by another organization through its share link.
            `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_unavailable`: your organization can't use its own
            ElevenLabs key; remove `useOrganizationKey` or ask Anam to enable
            it. `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.
            `share_link_unavailable`: share-link import isn't enabled for your
            organization. `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
            didn't accept the key sent to PUT /v1/voices/elevenlabs-key.
            `rate_limited`: too many key checks for your organization this hour;
            retry after an hour.
          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_unavailable
            - organization_key_missing
            - organization_key_rejected
            - share_link_unavailable
            - invalid_share_link
            - invalid_elevenlabs_key
            - 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. Present on
            `voice_not_accessible`, the `organization_key_*` codes and the
            share-link 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.