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

# Troubleshooting

> Fix common Prime Inference errors

## Insufficient funds

Prime Inference returns an `insufficient_funds` error when the billing account selected for the request cannot pay for the model call.

The selected billing account is determined by:

1. The API key in `Authorization: Bearer $PRIME_API_KEY`
2. The optional team header `X-Prime-Team-ID`

If `X-Prime-Team-ID` is not included, the request bills your personal balance. If the header is included, the request bills that team's balance.

### Error example

```json theme={null}
{
  "error": {
    "message": "Insufficient balance (including overdraft). Please add funds to continue.",
    "type": "insufficient_quota",
    "code": "insufficient_funds"
  }
}
```

### How to fix it

If you want to bill your personal account:

* Add funds in the [Billing Dashboard](https://app.primeintellect.ai/dashboard/billing)
* Make sure the API key belongs to the account with funds

If you want to bill a team:

* Add funds to the team billing balance
* Include `X-Prime-Team-ID` on every direct pinference or OpenAI-compatible API request
* Confirm the API key owner has access to the team

You can find your team ID with:

```bash theme={null}
prime teams list
```

Or from the [Team Profile page](https://app.primeintellect.ai/dashboard/team-profile).

<Warning>
  `PRIME_API_KEY` and Prime CLI team config do not select a team balance for direct pinference calls. pinference bills a team only when the request contains `X-Prime-Team-ID`.
</Warning>

### Direct API examples

<CodeGroup>
  ```python Python theme={null}
  import os
  from openai import OpenAI

  client = OpenAI(
      api_key=os.environ["PRIME_API_KEY"],
      base_url="https://api.pinference.ai/api/v1",
      default_headers={
          "X-Prime-Team-ID": "your-team-id-here",
      },
  )

  response = client.chat.completions.create(
      model="openai/gpt-5.4-mini",
      messages=[{"role": "user", "content": "Hello"}],
  )
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.pinference.ai/api/v1/chat/completions \
    -H "Authorization: Bearer $PRIME_API_KEY" \
    -H "X-Prime-Team-ID: your-team-id-here" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "openai/gpt-5.4-mini",
      "messages": [{"role": "user", "content": "Hello"}]
    }'
  ```
</CodeGroup>

### Related pages

* [Using Team Accounts](/inference/team-accounts)
* [Hosted Evaluations](/tutorials-environments/hosted-evaluations)
* [Environment Evaluations](/tutorials-environments/evaluating)
