## TL;DR

The agent missed a required x-tenant-id header, so the provider routed every call to the wrong tenant. Add the header to the client's default headers and fail fast if it is unset.

## Error

```text
every call returned data for the wrong tenant; no error, just wrong data
```

## Steps

1. Check the docs for tenant-routing headers Expected: you find x-tenant-id or equivalent.
2. Add it to the client's default headers from config Expected: every request carries it.
3. Fail fast at startup if the tenant id is unset Expected: misconfiguration is loud.
4. Verify with a read that returns tenant-scoped data Expected: routing is correct.

## When to use

- Calls hit the wrong tenant with no error
- The provider routes by header the agent missed

## When not to use

- Wrong tenant with an error (then it is auth, not routing)
- Tenant is in the path or subdomain (then fix that instead)

## Tool compatibility

- Multi-tenant API routing
- Generated API clients

## Variant phrasings

### wrong tenant data no error

The provider routes by a header like x-tenant-id. Set it on every request.

### missing tenant header

Same: add it to default headers and fail fast when unset.

## Why it happens

Auth gets all the attention, so agents wire the token and stop. Tenant-routing headers sit in a different docs section and look optional.

## Edge cases

- Header names vary by provider; confirm against the live docs, not memory
- Some providers also need the header on webhook verification callbacks

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_BNt6rU7QNzXPxocdVhZafQ
