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

# BYOK Setup

> Create and manage custom provider keys (BYOK)

Create and manage custom provider keys (BYOK - Bring Your Own Key) for AWS Bedrock, Google Vertex AI, Azure, and other LLM providers. This allows you to use your own credentials instead of Edgee's shared keys.

## Request Body

**provider** `string` *required*

The provider type. Supported values: `anthropic`, `openai`, `google_vertex_ai`, `google_gemini`, `mistral`, `deepseek`, `xai`, `zai`, `nvidia_nim`, `fireworks`, `scaleway`, `bedrock`, `bedrock-mantle`, `azure`, `alibaba_cloud`, `github_copilot`, `custom_openai_compatible`, `baseten`, `cerebras_cloud`, `deepinfra`, `groq`, `inceptron`, `ionos`, `meta`, `minimax`, `nebius_token_factory`, `nscale`, `ovhcloud`, `poolside`, `tensorx`, `together_ai`, `umans_ai`, `sference`

**provider\_key** `string` *required*

The credentials for the provider. Format depends on the provider type:

* **Standard providers** (anthropic, openai, mistral, deepseek, xai, zai, nvidia\_nim, google\_gemini, fireworks, scaleway, github\_copilot, baseten, cerebras\_cloud, deepinfra, groq, inceptron, ionos, meta, minimax, nebius\_token\_factory, nscale, ovhcloud, poolside, tensorx, together\_ai, umans\_ai, sference): API key as string
* **Bedrock**: JSON string with region-keyed credentials
* **Azure**: JSON string with endpoint and api\_key
* **Alibaba Cloud**: JSON string with workspace\_id, api\_key, and optional region (defaults to `eu-central-1`)
* **Google Vertex AI**: Service account JSON string
* **Custom OpenAI-compatible**: JSON string with base\_url and optional api\_key

**name** `string` *required*

A descriptive name for this provider key (e.g., "Production Vertex AI Key"). Max 100 characters.

**api\_key\_ids** `array`

Array of Edgee API key IDs to assign this provider key to. Omit or leave empty to create an organization-level provider key that applies to all API keys.

**user\_group\_ids** `array`

Array of [squad](https://www.edgee.ai/docs/features/squads.md) IDs to assign this provider key to. Every member of a listed squad uses these credentials.

**active** `boolean`

Update only. Set to `false` to disable the provider key without deleting it.

## Response

**id** `string`

Unique identifier for the provider key

**provider** `string`

The provider type (e.g., "google\_vertex\_ai")

**name** `string`

The name of the provider key

**created\_at** `string`

ISO 8601 timestamp of when the provider key was created

**created\_by** `string`

User ID of who created the provider key

## Examples

```bash Google Vertex AI theme={"dark"}
curl -X POST https://api.edgee.app/v1/organizations/{orgId}/provider-keys \
  -H "Authorization: Bearer <your_api_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "google_vertex_ai",
    "provider_key": "{\"type\":\"service_account\",\"project_id\":\"my-project\",\"private_key\":\"...\"}",
    "name": "Production Vertex AI",
    "api_key_ids": []
  }'
```

```bash AWS Bedrock (Multi-region) theme={"dark"}
curl -X POST https://api.edgee.app/v1/organizations/{orgId}/provider-keys \
  -H "Authorization: Bearer <your_api_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "bedrock",
    "provider_key": "{\"global\":{\"access_key_id\":\"AKIA...\",\"secret_access_key\":\"...\"},\"us-east-1\":{\"access_key_id\":\"AKIA...\",\"secret_access_key\":\"...\"}}",
    "name": "AWS Bedrock Production",
    "api_key_ids": []
  }'
```

```bash Azure theme={"dark"}
curl -X POST https://api.edgee.app/v1/organizations/{orgId}/provider-keys \
  -H "Authorization: Bearer <your_api_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "azure",
    "provider_key": "{\"endpoint\":\"https://your-resource.openai.azure.com/\",\"api_key\":\"your-api-key\"}",
    "name": "Azure OpenAI",
    "api_key_ids": []
  }'
```

```bash Alibaba Cloud theme={"dark"}
curl -X POST https://api.edgee.app/v1/organizations/{orgId}/provider-keys \
  -H "Authorization: Bearer <your_api_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "alibaba_cloud",
    "provider_key": "{\"workspace_id\":\"your-workspace-id\",\"api_key\":\"your-api-key\",\"region\":\"eu-central-1\"}",
    "name": "Alibaba Cloud",
    "api_key_ids": []
  }'
```

```bash With API Key Assignment theme={"dark"}
curl -X POST https://api.edgee.app/v1/organizations/{orgId}/provider-keys \
  -H "Authorization: Bearer <your_api_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "openai",
    "provider_key": "sk-proj-...",
    "name": "OpenAI - Development",
    "api_key_ids": ["key-id-1", "key-id-2"]
  }'
```

```json theme={"dark"}
{
  "id": "pk_1a2b3c4d5e6f7g8h",
  "provider": "google_vertex_ai",
  "name": "Production Vertex AI",
  "created_at": "2026-04-08T10:00:00Z",
  "created_by": "user_abc123"
}
```

## Tips

* **Organization-level keys**: Leave `api_key_ids` empty to apply the provider key to your entire organization
* **API-key-specific assignments**: Specify API key IDs to restrict the provider key to specific API keys only
* **Security**: Never commit provider credentials to version control. Use environment variables or secure credential management systems
* **Multi-region Bedrock**: For AWS Bedrock, you can specify different credentials for different regions. Use `"global"` as the key for a default region.

## Credential Formats

### Google Vertex AI

Provide the entire service account JSON as a string:

```json theme={"dark"}
{
  "type": "service_account",
  "project_id": "your-project-id",
  "private_key_id": "key-id",
  "private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
  "client_email": "service-account@your-project.iam.gserviceaccount.com",
  "client_id": "123456789",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token"
}
```

### AWS Bedrock

Provide region-keyed credentials:

```json theme={"dark"}
{
  "global": {
    "access_key_id": "AKIA...",
    "secret_access_key": "..."
  },
  "us-east-1": {
    "access_key_id": "AKIA...",
    "secret_access_key": "..."
  }
}
```

### Azure

Provide endpoint and API key:

```json theme={"dark"}
{
  "endpoint": "https://your-resource.openai.azure.com/",
  "api_key": "your-api-key"
}
```

### Alibaba Cloud

Provide your Model Studio Workspace ID, API key, and (optionally) region. The gateway resolves these into `https://{workspace_id}.{region}.maas.aliyuncs.com/compatible-mode/v1`. `region` defaults to `eu-central-1` (Germany/Frankfurt) if omitted. Supported regions: `eu-central-1` (Germany/Frankfurt), `cn-beijing` (China/Beijing), `ap-southeast-1` (Singapore), `ap-northeast-1` (Japan/Tokyo), `cn-hongkong` (China/Hong Kong).

```json theme={"dark"}
{
  "workspace_id": "your-workspace-id",
  "api_key": "your-api-key",
  "region": "eu-central-1"
}
```


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