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

# Add (or replace) a BYOK provider credential

> Verified with one live call before being stored; a bad key or Azure config
is rejected with the provider's own error and nothing is persisted.
Resubmitting for the same `provider` replaces the existing credential.
See the [BYOK guide](/byok) for the per-provider field requirements.




## OpenAPI

````yaml /openapi.yaml post /v1/provider-keys
openapi: 3.1.0
info:
  title: Impossibl AI API
  version: 0.0.1
  description: >
    The Impossibl AI API is one API for all AI providers, OpenAI-compatible
    across OpenAI,

    Anthropic, Google, xAI, and more (`GET /v1/models` lists the full catalog),

    billed from a prepaid credit balance.


    Provider usage is billed at provider list prices with no usage markup.

    Prepaid credit purchases charge a separate fixed 5% platform fee before tax.


    **Agent quickstart**

    1. `POST /v1/accounts` — create a funded account; you get an API key and a
       signup-bonus balance in one call (no human step required).
    2. Call `POST /v1/chat/completions`, `POST /v1/responses`, or
       `POST /v1/audio/transcriptions` with
       `Authorization: Bearer <key>` and a `provider/model` id from `GET /v1/models`.
    3. Credits are deducted per request by token or audio-duration usage; check
    `GET /v1/account`.
servers:
  - url: https://api.impossibl.com
    description: Production
  - url: http://localhost:8787
    description: Local dev
security:
  - BearerKey: []
paths:
  /v1/provider-keys:
    post:
      summary: Add (or replace) a BYOK provider credential
      description: >
        Verified with one live call before being stored; a bad key or Azure
        config

        is rejected with the provider's own error and nothing is persisted.

        Resubmitting for the same `provider` replaces the existing credential.

        See the [BYOK guide](/byok) for the per-provider field requirements.
      operationId: createProviderKey
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - provider
              properties:
                provider:
                  type: string
                  enum:
                    - openai
                    - anthropic
                    - google
                    - xai
                    - zai
                    - bedrock
                    - azure
                    - azure-foundry
                label:
                  type: string
                apiKey:
                  type: string
                  description: >-
                    All providers; for Bedrock this is a Bedrock API key (bearer
                    token)
                resourceName:
                  type: string
                  description: Azure only
                apiVersion:
                  type: string
                  description: Azure only
                endpoint:
                  type: string
                  description: azure-foundry only
                region:
                  type: string
                  description: 'Bedrock only: the AWS region the key was generated for'
                modelDeployments:
                  type: object
                  description: >-
                    azure and azure-foundry: gateway model id -> your deployment
                    name
                  additionalProperties:
                    type: string
      responses:
        '201':
          description: Credential stored (never echoes the secret)
        '400':
          description: Invalid shape, or verification against the live provider failed
components:
  securitySchemes:
    BearerKey:
      type: http
      scheme: bearer
      description: Gateway API key (`imp-rt-...`) from POST /v1/accounts or /v1/keys.

````