# Can't connect to Google Vertex

**URL:** <https://forum.weaviate.io/t/cant-connect-to-google-vertex/3254>\
**Category:** Support\
**Created:** [August 1, 2024, 6:06pm UTC](https://forum.weaviate.io/t/cant-connect-to-google-vertex/3254 "2024-08-01T18:06:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cobyboss](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/cobyboss/32/389_2.png) [@Cobyboss](https://forum.weaviate.io/u/Cobyboss)\
**Post date:** [August 1, 2024, 6:06pm UTC](https://forum.weaviate.io/t/cant-connect-to-google-vertex/3254/1 "2024-08-01T18:06:38Z")

</div>

I get Google API Key: no api key found neither in request header even though I am hard coding in the urls and keys as shown below. I also ran gcloud auth print-access-token within the last hour and that is the key I am using.

```auto
weaviate_url = "a_url"
weaviate_key = "a_key"
vertex_key = "a_key"
headers = {
    "X-Google-Vertex-Api-Key": vertex_key,
}

client = weaviate.connect_to_weaviate_cloud(
    cluster_url=weaviate_url, # `weaviate_url`: your Weaviate URL
    auth_credentials=Auth.api_key(weaviate_key), # `weaviate_key`: your Weaviate API key
    headers=headers)

collection = client.collections.get("Testing")
with collection.batch.dynamic() as batch:
    for src_obj in source_objects:
        image_b64 = url_to_base64(src_obj["image_path"])
        weaviate_obj = {
            "image": image_b64,
            "source": src_obj["source"],
        }

        # The model provider integration will automatically vectorize the object
        batch.add_object(
            properties=weaviate_obj,
            # vector=vector # Optionally provide a pre-obtained vector
        )
        break

failed_objects = collection.batch.failed_objects # After batch is done

```

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [August 2, 2024, 2:57pm UTC](https://forum.weaviate.io/t/cant-connect-to-google-vertex/3254/2 "2024-08-02T14:57:37Z")

</div>

hi!

What is the version of the client?

Also, can you paste the full error stack trace?

Thanks!

---

<div class="post-metadata">

**Author:** ![Cobyboss](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/cobyboss/32/389_2.png) [@Cobyboss](https://forum.weaviate.io/u/Cobyboss)\
**Post date:** [August 2, 2024, 7:56pm UTC](https://forum.weaviate.io/t/cant-connect-to-google-vertex/3254/3 "2024-08-02T19:56:25Z")

</div>

The weaviate version is 1.25.9  
The weaviate client is 4.7.1

{‘message’: ‘Failed to send 1 objects in a batch of 1. Please inspect client.batch.failed\_objects or collection.batch.failed\_objects for the failed objects.’}

[ErrorObject(message=“WeaviateInsertManyAllFailedError(‘Every object failed during insertion. Here is the set of all errors: Google API Key: no api key found neither in request header: X-Palm-Api-Key or X-Google-Api-Key or X-Google-Vertex-Api-Key or X-Google-Studio-Api-Key nor in environment variable under PALM\_APIKEY or GOOGLE\_APIKEY’)”

---

<div class="post-metadata">

**Author:** ![sebawita](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/sebawita/32/5_2.png) [@sebawita](https://forum.weaviate.io/u/sebawita)\
**Post date:** [August 5, 2024, 1:52pm UTC](https://forum.weaviate.io/t/cant-connect-to-google-vertex/3254/4 "2024-08-05T13:52:22Z")

</div>

Hi @Cobyboss,

I think there is a bug with the multimodal models and the Vertex header.

Can you try using “X-Palm-Api-Key” instead?

```auto
headers = {
    "X-Palm-Api-Key": vertex_key,
}

```

---

<div class="post-metadata">

**Author:** ![Cobyboss](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/cobyboss/32/389_2.png) [@Cobyboss](https://forum.weaviate.io/u/Cobyboss)\
**Post date:** [August 5, 2024, 4:48pm UTC](https://forum.weaviate.io/t/cant-connect-to-google-vertex/3254/5 "2024-08-05T16:48:24Z")

</div>

Should I use Google Palm too or can I just use that header with the same vertex\_key?

---

<div class="post-metadata">

**Author:** ![jakasspeech2](https://avatars.discourse-cdn.com/v4/letter/j/9de0a6/32.png) [@jakasspeech2](https://forum.weaviate.io/u/jakasspeech2)\
**Post date:** [August 7, 2024, 7:53pm UTC](https://forum.weaviate.io/t/cant-connect-to-google-vertex/3254/6 "2024-08-07T19:53:52Z")

</div>

You can definitely use the same header with the vertex\_key, no problem there.

---

<div class="post-metadata">

**Author:** ![Filipp\_Trigub](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/filipp_trigub/32/1429_2.png) [@Filipp\_Trigub](https://forum.weaviate.io/u/Filipp_Trigub)\
**Post date:** [September 3, 2024, 7:57am UTC](https://forum.weaviate.io/t/cant-connect-to-google-vertex/3254/7 "2024-09-03T07:57:26Z")

</div>

I am faced with the same problem, but using X-Palm-Api-Key does not seem to work.

Vertex AI is not compatible with API Keys anymore, hence I am trying Oauth2, service acc or simply an access token.

EDIT: It now uploads the properties, but does not vectorize.

My cluster is 1.25.10 and my python dependency client is 4.7.1.

I am basically running these lines

```auto
client = weaviate.connect_to_weaviate_cloud(
    cluster_url=os.getenv("WEAVIATE_URL"),
    auth_credentials=weaviate.auth.AuthApiKey(api_key=os.getenv("WEAVIATE_API_KEY")),
    headers={"X-OpenAI-Api-Key": os.getenv("OPENAI_API_KEY"),
             # "X-Google-Vertex-Api-Key": os.getenv("GOOGLE_ACCESS_TOKEN"),
             "X-Palm-Api-Key": os.getenv("GOOGLE_ACCESS_TOKEN")
             }
)

for q in tqdm(collection_src.iterator()):
     collection_tgt.data.insert(properties=q.properties, uuid=q.uuid)

```
