Proxies Atlas Admin API POST /groups/{id}/aiModelApiKeys usando el token delegado de un usuario o una cuenta de servicio de Agent Engine vinculada. No se aceptan claves de API de Agent Engine. El secreto de un solo uso se devuelve al usuario y nunca se incluye en las respuestas de error ni en los registros. Se rechaza un project_id no válido antes de cualquier llamada a Atlas.
Respuestas
-
Versión de API no compatible o con formato incorrecto, operación no disponible en el contrato publicado seleccionado o representación inaceptable (incluidos parámetros de tipo de medio no compatibles o SSE excluidos). Los fallos de autenticación, autorización y límite de velocidad existentes tienen prioridad.
-
Creado.
-
Solicitud incorrecta
-
No autorizado
-
MÉTODO DE PAGO ATLAS REQUERIDO
-
ATLAS_PERMISSION_REQUIRED, ATLAS_SERVICE_ACCOUNT_NOT_PAIRED o PROHIBIDO
-
NOT_FOUND
-
Conflicto
-
El cuerpo de la solicitud es demasiado grande.
-
ERROR_INTERNO
-
Puerta de enlace incorrecta
-
PLATFORM_OAUTH_NOT_CONFIGURED o SERVICE_UNAVAILABLE cuando ya se está actualizando un token delegado.
curl \
--request POST 'https://agentengine.mongodb.com/api/v1/atlas/projects/{project_id}/model-api-keys' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json"
{}
{
"name": "string"
}
{
"detail": "This operation is not available in API version 2026-09-20-preview.",
"error": 406,
"errorCode": "OPERATION_NOT_IN_API_VERSION",
"parameters": [
"Accept"
],
"reason": "Not Acceptable"
}
{
"detail": "This operation supports text/event-stream, which the Accept header excludes. Remove unsupported media-type parameters or accept this type with a positive q value.",
"error": 406,
"errorCode": "UNACCEPTABLE_MEDIA_TYPE",
"parameters": [
"Accept"
],
"reason": "Not Acceptable"
}
{
"detail": "The requested API version is not supported. Supported versions: 2026-09-20-preview.",
"error": 406,
"errorCode": "UNSUPPORTED_API_VERSION",
"parameters": [
"Accept"
],
"reason": "Not Acceptable"
}
{
"detail": "This operation is not available in API version 2026-09-20-preview.",
"error": 406,
"errorCode": "OPERATION_NOT_IN_API_VERSION",
"parameters": [
"Accept"
],
"reason": "Not Acceptable"
}
{
"id": "string",
"masked_secret": "string",
"name": "string",
"secret": "string",
"status": "string"
}
{
"id": "string",
"masked_secret": "string",
"name": "string",
"secret": "string",
"status": "string"
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}