Update an AI provider
PUT /aisix/admin/providers/{provider_id}
PUT /aisix/admin/providers/{provider_id}Interactive request editor loads with JavaScript.
In: header
Path Parameters
AI Provider ID.
1 <= lengthQuery Parameters
AI Gateway group ID (filter resources by group).
1 <= lengthRequest Body
application/json
Response Body
application/json
application/json
application/json
curl -X PUT "$API_BASE_URL/aisix/admin/providers/provider-abc123?ai_gateway_group_id=abc1234567890" \ -H "Content-Type: application/json" \ -d '{ "name": "my-openai-provider", "type": "openai", "config": {} }'Successfully retrieved or modified the AI provider.
{
"value": {
"id": "provider-abc123",
"ai_gateway_group_id": "group-abc123",
"name": "my-openai-provider",
"type": "openai",
"config": {
"api_key": "sk-..."
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
}Bad Request — The request was malformed or contained invalid parameters. Check the error_msg field for details.
{
"value": {},
"error_msg": "error message"
}Not Found — The requested resource does not exist or has been deleted.
{
"value": {},
"error_msg": "error message"
}Complete operation details and schema variants
PUT /aisix/admin/providers/{provider_id}
Update an AI provider
IAM Action: ai_gateway:UpdateAIProvider, Resource: arn:api7:ai_gateway:aigatewaygroup/%s
Updates the specified AI provider configuration. Changes are synced to the aisix data plane via etcd.
Parameters
ai_gateway_group_id(query, string, required): AI Gateway group ID (filter resources by group).provider_id(path, string, required): AI Provider ID.
Request body
Content type: application/json
name(string, required): Human-readable name for the provider.type(string, required): Provider type. Determines the shape of the config object.config(object, required): Provider credentials. Shape depends on the type: - openai/anthropic/deepseek/gemini/openrouter: { api_key, api_base? } - azure: { api_key, api_base (required), api_version? } - bedrock: { region, access_key_id, secret_access_key, session_token?, endpoint? }
Responses
-
200: Successfully retrieved or modified the AI provider. -
allOf variant 1
-
value(object, optional): The specific resource. -
allOf variant 2
-
value(object, optional): LLM provider configuration in an AI Gateway group. -
value.id(string, optional): Unique provider ID. -
value.ai_gateway_group_id(string, optional): ID of the AI Gateway group this provider belongs to (control-plane only). -
value.name(string, optional): Human-readable name for the provider. -
value.type(string, optional): Provider type. Determines the shape of the config object. -
value.config(object, optional): Provider-specific credentials and configuration. The required fields depend on the provider type. See the request schemas for details. -
value.created_at(string, optional): Timestamp when the provider was created. -
value.updated_at(string, optional): Timestamp when the provider was last updated. -
400: Bad Request — The request was malformed or contained invalid parameters. Check the error_msg field for details. -
value(object, optional): The specific resource. -
error_msg(string, optional): The error message. -
404: Not Found — The requested resource does not exist or has been deleted. Response fields (application/json): identical toPUT /aisix/admin/providers/{provider_id}, response 400 above.
cURL
curl -X PUT '$API_BASE_URL/aisix/admin/providers/{provider_id}'