## TL;DR

Make sure patronus.init() is called before you create any evaluator or run any experiment. That error means the library was never initialized, so it has no client to hand out regardless of your key.

## The error

```text
Failed to get API client error
```

## Fix

1. Make sure patronus.init() is called before you create any evaluator or run any experiment.
   Expected: You get the expected result; the problem is gone.
2. Re-run the original operation and confirm the error is gone.
   Expected: no error, normal output.

## When to use

- You hit this exact error with Patronus AI.
- The symptom matches: Failed to get API client error.

## When NOT to use

- A different error message from Patronus AI; the cause here is specific to this error.
- Unrelated Patronus AI issues (different feature, different failure).
- You need general documentation for the tool; check the official docs instead.

## Compatibility

Reported against Patronus AI.

## Variant phrasings

### Failed to get API client error

## Why it happens

The Patronus Python SDK throws "Failed to get API client". My API key is set. What does this error mean?

## Edge cases

- If your error message differs even slightly, this is probably a different issue; search the exact text.
- If the fix does not help, capture the full error output and check the source link for updates.