> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How do I fix Invalid Authentication (401) errors with Serverless Inference?

A `401` Invalid Authentication error means your API key is invalid or your Forge team name or project name is incorrect. Use the checks on this page to confirm both values are correct so requests can authenticate.

## Verify your API key

Confirm that you have a valid, current API key before troubleshooting other causes.

1. Create a new API key at [User settings](https://forge.coreweave.com/settings).
2. Store your API key securely.

## Check your project configuration

Requests must specify the project as `[YOUR-TEAM]/[YOUR-PROJECT]` so the service can route them to the correct Forge team and Weights & Biases project. Replace `[YOUR-API-KEY]` with your API key, and replace `[YOUR-TEAM]/[YOUR-PROJECT]` with your correct team and project.

**Python example:**

```python theme={"system"}
client = openai.OpenAI(
    base_url='https://api.inference.wandb.ai/v1',
    api_key="[YOUR-API-KEY]",
    project="[YOUR-TEAM]/[YOUR-PROJECT]",  # Must match your Forge team and Weights & Biases project
)
```

**Bash example:**

```bash theme={"system"}
curl https://api.inference.wandb.ai/v1/chat/completions \
  -H "Authorization: Bearer [YOUR-API-KEY]" \
  -H "OpenAI-Project: [YOUR-TEAM]/[YOUR-PROJECT]"
```

## Common mistakes

* Using personal entity instead of team name.
* Misspelling team or project name.
* Missing forward slash between team and project.
* Using an expired or deleted API key.

## Troubleshoot remaining issues

* Verify the team and project exist in your CoreWeave Forge account.
* Ensure you have access to the specified team.
* If the current API key isn't working, create a new one.

***

[Inference](https://docs.coreweave.com/support/models/tags/inference.md)
