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

# Fix API Key Errors (Invalid Key, Out of Credit, Rate Limits)

> Fix errors when using your own API key in Elephas: rejected key, provider out of credit, rate limits, free plans too small for a question, and removed models.

When you use your own API key, most errors come from your AI provider's account, not from Elephas: a key it refuses, an empty balance, or a plan too small for the question. Find your message below for the cause and the fix.

<Info>
  Your own API key works in Personal workspaces, during a free trial or with a paid plan. Team workspaces use Elephas AI or Local AI and do not accept personal keys.
</Info>

## Before you start

* Open **Settings › AI**. Under **How Elephas answers**, check that **My own AI account** is selected and which provider is marked **In use**.
* Keep your provider's website open in another tab. Most fixes happen in your account there: keys, billing and plan limits.
* With your own key, your question and the matching passages go straight to your provider, and the provider's API terms apply. See [what data is sent to AI](/docs/privacy-and-security/what-data-is-sent-to-ai).

## Messages when you ask a question

| Message | Cause | Fix |
| - | - | - |
| **Your AI provider refused your API key, or your account can't use this model. Check the key in Settings › AI, and your account settings on the provider's website.** | The key was deleted or mistyped, or your provider account has no access to the model you picked. | Create a new key on the provider's website. In **Settings › AI**, click **Replace Key** and paste it. If the key is fine, pick another model. |
| **Your AI provider account is out of credit. Add credit on the provider's website, then try again.** | Your prepaid balance at the provider is used up. | Add credit or a payment method on the provider's website, then ask again. |
| **This question is too big for your AI provider's current plan. Some free plans, such as Groq's, allow only a little text each minute. Upgrade your plan with the provider, or pick another provider in Settings › AI.** | Your provider's free or low tier caps how much text you can send per minute, and one Elephas question with its passages is larger than that. | Upgrade your plan with the provider, or connect another provider. Narrowing the question to fewer documents also sends less text. |
| **Your AI provider is limiting how much you can send right now. Wait a minute and try again.** | You hit the provider's rate limit. Sometimes Elephas shows **Too many requests right now. Try again in about** a number of **seconds.** | Wait, then ask again. If it happens often, your provider plan may be too small for questions like this. |
| **That model isn't available any more. Pick a model again in Settings.** | The provider retired or renamed the model. | Open **Settings › AI**, choose a model from **Choose a model**, and ask again. |
| **The selected model does not support Agent tools. Choose an Agent tools model in Settings.** | Elephas answers by searching and reading your documents with tools. This model cannot use them. | Pick a model that is not marked **Can't use Agent tools**. |
| **Elephas could not reach the AI provider. Your local content remains available.** | Your connection dropped, or the provider is down. | Check your connection and the provider's status page, then ask again. |
| **The AI request timed out. Try again.** or **The connection dropped before the answer finished. You can retry.** | The provider was slow or the connection broke mid-answer. | Ask again. |
| **Elephas could not access the system keychain to read your AI key. Restart the app and try again.** | Elephas could not read your saved key from Keychain (Mac) or Credential Manager (Windows). | Restart Elephas. If it repeats, restart your computer. |
| **Elephas is not set up to answer yet. Choose how it answers in Settings › AI.** | No AI option is chosen, or no key is saved for the provider in use. | Open **Settings › AI** and finish setting up your provider. |

## Plan and sign-in messages

Your own key is included with an Elephas trial or plan, so Elephas checks your plan before it sends a question with your key.

| Message | Fix |
| - | - |
| **Sign in to Elephas in Settings › Plan & Billing to use your own key or the on-device model.** | Sign in from **Settings › Plan & Billing**. |
| **Your own key and the on-device model are included with an Elephas trial or plan. Choose a plan in Settings › Plan & Billing. Your key, models and Brains are unchanged.** | Start your free trial or choose a plan. See [free trial](/docs/plans-and-billing/free-trial). |
| **Your Elephas trial has ended, so your own key and the on-device model are paused.** | Choose a plan in **Settings › Plan & Billing**. Your key is still saved. |
| **Your Elephas plan has ended, so your own key and the on-device model are paused. Your key, models and Brains are still here.** | Renew in **Settings › Plan & Billing**. See [when your plan ends](/docs/plans-and-billing/when-your-plan-ends). |
| **Elephas could not confirm your plan right now. Check your connection and try again.** | Go online briefly. Elephas checks your plan at most once an hour while it is open, and again after each restart. |
| **This device does not have a place on your Elephas account right now, so your own key and the on-device model are off here.** | Open **Plan & Billing** to use this device instead. See [device limits](/docs/plans-and-billing/device-limits). |

## Messages in Settings › AI

| Message | What to do |
| - | - |
| **\[Provider] rejected that key. Check it and paste it again.** | Copy the key again from the provider's website, with no spaces before or after it, and paste it. |
| **That doesn't look like a \[Provider] key. You can still save it.** | Check you pasted the key for the right provider. If you are sure, save it anyway. |
| **You're offline. Your key is saved and will be checked when you're back online.** | Nothing to fix. Reconnect. |
| **\[Provider] is busy right now. Your key is saved; try again in a moment.** | Wait and click **Try Again**. |
| **\[Provider] couldn't be reached. Your key is saved; try again in a moment.** | Check your connection or firewall, then click **Try Again**. |
| **\[Model] is no longer offered by \[Provider]. Pick another.** | Choose another model from the list. Click **Refresh Models** to update it. |
| **No chat models found for \[Provider].** | Your key may not have access to chat models. Check your provider account, then click **Refresh Models**. |
| **This provider isn't available any more. Choose another.** | Elephas no longer lists this provider. Click **Connect another provider…** and pick one. |

## Steps

<Steps>
  <Step title="Open your provider's dashboard">
    Check that the key exists, is active, and that your account has credit or billing set up.
  </Step>

  <Step title="Replace the key in Elephas">
    Open **Settings › AI**, select your provider, click **Replace Key**, paste the new key and click **Save Key**. Wait for **Your key works.**
  </Step>

  <Step title="Pick a model again">
    Under **Choose a model**, pick a model. Elephas shows **Ready** next to it when it can be used.
  </Step>

  <Step title="Ask again">
    Go back to Ask and repeat your question.
  </Step>
</Steps>

The steps are the same on Mac and Windows.

## How it works

With your own key, Elephas sends your question and the passages it found in your documents directly to the provider you chose. Elephas is not in between, and your provider bills you for that use. That is why provider limits, balances and retired models show up as errors in Elephas: Elephas reports what the provider said, in plain words.

Your key is saved in Keychain on Mac or Credential Manager on Windows, never in a settings file or the log.

For a custom endpoint, Elephas also checks once that the model can use the tools it needs. Click **Test Connection** in Settings when Elephas asks you to. See [custom API endpoint](/docs/ai-options/custom-api-endpoint).

## Troubleshooting

<AccordionGroup>
  <Accordion title="My key works on the provider's website but not in Elephas">
    Check that you saved it under the right provider, and that the model you picked is included in your provider plan. Some providers give new keys access to fewer models until you add billing.
  </Accordion>

  <Accordion title="I want to stop paying a provider separately">
    Switch to Elephas AI, which is included with your plan, or to Local AI, which runs on your computer. See [choose how Elephas answers](/docs/ai-options/choose-how-elephas-answers).
  </Accordion>

  <Accordion title="My own key option is missing in a Team workspace">
    Team workspaces do not use personal keys. Your Team Owner's AI policy decides which options are allowed. See [team troubleshooting](/docs/troubleshooting/team-troubleshooting).
  </Accordion>
</AccordionGroup>

## Related articles

<CardGroup cols={2}>
  <Card title="Use your own API key" href="/docs/ai-options/use-your-own-api-key" />

  <Card title="Custom API endpoint" href="/docs/ai-options/custom-api-endpoint" />

  <Card title="Elephas AI" href="/docs/ai-options/elephas-ai" />

  <Card title="What data is sent to AI" href="/docs/privacy-and-security/what-data-is-sent-to-ai" />
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.