BYOK Setup
Create and manage custom provider keys (BYOK)
https://api.edgee.app/v1/organizations/{orgId}/provider-keysTry this endpoint
Configure your request, then run the curl command in your terminal.
Run in your terminal
Set EDGEE_CONSOLE_API_TOKEN to your personal Console API token in your terminal, then copy and run this command. Requests run against your live organization.
Fill in orgId above before running.
curl --include --no-buffer --globoff --request POST 'https://api.edgee.app/v1/organizations/{orgId}/provider-keys' \
--header "Authorization: Bearer $EDGEE_CONSOLE_API_TOKEN" \
--header 'Content-Type: application/json' \
--data-raw '{
"provider": "openai",
"provider_key": "<YOUR_PROVIDER_API_KEY>",
"name": "OpenAI"
}'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
providerstringrequiredThe 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_keystringrequiredThe 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
namestringrequiredA descriptive name for this provider key (e.g., "Production Vertex AI Key"). Max 100 characters.
api_key_idsarrayArray 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_idsarrayArray of squad IDs to assign this provider key to. Every member of a listed squad uses these credentials.
activebooleanUpdate only. Set to false to disable the provider key without deleting it.
Response
idstringUnique identifier for the provider key
providerstringThe provider type (e.g., "google_vertex_ai")
namestringThe name of the provider key
created_atstringISO 8601 timestamp of when the provider key was created
created_bystringUser ID of who created the provider key
Examples
Request examples
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": []
}'
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": []
}'
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": []
}'
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": []
}'
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"]
}'
Response examples
{
"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_idsempty 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:
{
"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:
{
"global": {
"access_key_id": "AKIA...",
"secret_access_key": "..."
},
"us-east-1": {
"access_key_id": "AKIA...",
"secret_access_key": "..."
}
}
Azure
Provide endpoint and API key:
{
"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).
{
"workspace_id": "your-workspace-id",
"api_key": "your-api-key",
"region": "eu-central-1"
}