Create an AI provider
POST /aisix/admin/providers
POST /aisix/admin/providersInteractive request editor loads with JavaScript.
In: header
Query Parameters
AI Gateway group ID (filter resources by group).
1 <= lengthRequest Body
application/json
Response Body
application/json
application/json
application/json
curl -X POST "$API_BASE_URL/aisix/admin/providers?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"
}Conflict — A resource with the same unique identifier (e.g., name) already exists.
{
"value": {},
"error_msg": "error message"
}Complete operation details and schema variants
POST /aisix/admin/providers
Create an AI provider
IAM Action: ai_gateway:CreateAIProvider, Resource: arn:api7:ai_gateway:aigatewaygroup/%s
Creates a new AI provider configuration in the specified AI Gateway group. The provider will be synced to the aisix data plane via etcd.
Parameters
ai_gateway_group_id(query, string, required): AI Gateway group ID (filter resources by group).
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. -
409: Conflict — A resource with the same unique identifier (e.g., name) already exists. Response fields (application/json): identical toPOST /aisix/admin/providers, response 400 above.
cURL
curl -X POST '$API_BASE_URL/aisix/admin/providers'