Gemini-embedding-001 api issues

the documentation says “You can also generate embeddings for multiple chunks at once by passing them in as a list of strings.”

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-embedding-001:embedContent" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"model": "models/gemini-embedding-001",
     "content": [
        {"parts": [{"text": "What is the meaning of life?"}]},
        {"parts": [{"text": "What is the purpose of existence?"}]},
        {"parts": [{"text": "How do I bake a cake?"}]}
        ]
    }'

however the api returns this error

{
  "error": {
    "code": 400,
    "message": "Invalid JSON payload received. Unknown name \"content\": Proto field is not repeating, cannot start list.",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "description": "Invalid JSON payload received. Unknown name \"content\": Proto field is not repeating, cannot start list."
          }
        ]
      }
    ]
  }
}

Hello,

Welcome to the Forum!

Thank you for highlighting this issue. We were able to reproduce it and it does appear to be a bug. In the meantime, you can refer to the command in the Gemini API reference.