AI Providers

AI Providers allow organizations to configure their own AI service credentials for use with Contentful’s AI features. You can use your own accounts with: OpenAI, AWS Bedrock, Google Gemini, and Google Vertex AI.

Each provider requires specific credentials and configuration based on the AI service being used. Once configured, providers can be used to power AI Actions.

Supported Provider Types

ProviderTypeCredentialsConfig
AWS Bedrockaws_bedrockAWS access key ID and secret access keyAWS region (e.g., us-east-1)
Google Geminigoogle-geminiAPI keyNone required
Google Vertex AIgoogle-vertex-aiFull GCP service account JSON fileGCP location/region (e.g., us-central1)
OpenAIopenaiAPI keyOpenAI organization ID and project ID
OpenAI-Compatibleopenai-compatibleAPI keyProvider name, endpoint URL, and optional custom headers

AI Providers collection

Get all AI providers for an organization

Returns all the AI Providers that exist in a given organization.

Create an AI provider

Use this endpoint to create a new AI Provider of a specified type for an organization. Specify the appropriate type and credentials in the request body for the provider, see examples:

AWS Bedrock: Create an AWS Bedrock provider with access credentials

{
"type": "aws_bedrock",
"credentials": {
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"secretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
},
"config": {
"region": "us-east-1"
},
"selectedModels": [
{
"id": "anthropic.claude-3-5-sonnet-20241022-v2:0",
"name": "Claude 3.5 Sonnet v2"
},
{
"id": "anthropic.claude-3-sonnet-20240229-v1:0",
"name": "Claude 3 Sonnet"
}
]
}

Google Gemini: Create a Google Gemini provider with API key credentials

{
"type": "google-gemini",
"credentials": {
"apiKey": "your-google-api-key"
},
"selectedModels": [
{
"id": "gemini-2.0-flash-exp",
"name": "Gemini 2.0 Flash"
},
{
"id": "gemini-1.5-pro",
"name": "Gemini 1.5 Pro"
}
]
}

Google Vertex AI: Create a Google Vertex AI provider with GCP service account credentials

{
"type": "google-vertex-ai",
"credentials": {
"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@project.iam.gserviceaccount.com",
"client_id": "123456789",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/service-account%40project.iam.gserviceaccount.com"
},
"config": {
"location": "us-central1"
},
"selectedModels": [
{
"id": "gemini-2.0-flash-exp",
"name": "Gemini 2.0 Flash"
},
{
"id": "gemini-1.5-pro",
"name": "Gemini 1.5 Pro"
}
]
}

OpenAI: Create an OpenAI provider with API key and organization credentials

{
"type": "openai",
"credentials": {
"apiKey": "sk-..."
},
"config": {
"openAiOrganizationId": "org-...",
"projectId": "proj_..."
},
"selectedModels": [
{
"id": "gpt-4o",
"name": "GPT-4o"
},
{
"id": "gpt-4",
"name": "GPT-4"
}
]
}

OpenAI Compatible: Create an OpenAI-compatible provider with custom endpoint configuration

{
"type": "openai-compatible",
"credentials": {
"apiKey": "your-api-key"
},
"config": {
"name": "My Custom Provider",
"endpoint": "https://api.example.com/v1",
"headers": {
"x-custom-header": "value"
}
},
"selectedModels": [
{
"id": "custom-model-v1",
"name": "Custom Model v1"
},
{
"id": "custom-model-v2",
"name": "Custom Model v2"
}
]
}

AI Provider

Get an AI provider

Use this endpoint to read an AI Provider for a specified organization.

Update an AI provider

Use this endpoint to update a specific AI provider using JSON Patch format. This is useful for updating credentials, configuration, or selected models without replacing the entire provider configuration.

Delete an AI provider

Use this endpoint to delete an AI Provider for a specified organization.