401 - but my API key should be valid

Can you please double check that your code snippet looks like this: zai-org/GLM-4.6 · Hugging Face? (You can find this on the model page by clicking Deploy > Inference Providers)

Check out our guide here as well: Inference Providers .

1 Like