Skip to main content

BYOK Troubleshooting

Errors when configuring your BYOK key are usually straightforward to resolve. This guide covers common error messages and their solutions.

Quick Diagnosis

When you see an error message in Can I Run That Settings while configuring your API key, refer to the solutions below.

Currently Supported Error Cases:

  1. Invalid format (HTTP 422) — Your key doesn't start with sk-ant-
  2. Invalid key or no billing (HTTP 400) — Your key is invalid, revoked, or your Anthropic account lacks billing

Error: "API key must start with 'sk-ant-'"

Error Code: HTTP 422
When it occurs: You click Save while the API Key field contains a value that doesn't start with the correct prefix

What This Means

Your API key must be a valid Anthropic API key, which always starts with the prefix sk-ant-. Any other format is invalid and will be rejected.

Common Causes

  • Copied the wrong key: You copied something other than your Anthropic API key (e.g., a different service's key)
  • Incomplete copy: The key got cut off or only part of it was copied
  • Typo: You manually typed a key instead of copying from Anthropic Console
  • Extra characters: You added spaces, punctuation, or other characters before the key

How to Resolve

  1. Get a valid API key from Anthropic Console:

    • Log in to https://console.anthropic.com/
    • Go to API Keys in the sidebar
    • Find your API key in the list
    • Click the Copy button or select and copy the full key text
  2. Verify the key format:

    • The key should start with sk-ant-
    • Copy the full key exactly as shown in the Anthropic Console — treat it as an opaque value
    • There should be no spaces or extra characters before or after
  3. Clear the Can I Run That field and try again:

    • In Can I Run That Settings, click in the API Key field
    • Select all text and delete it (or triple-click to select all)
    • Paste your correctly copied key
    • Click Save
  4. If the error persists:

    • Double-check that you copied the entire key (sometimes the last few characters get missed)
    • Try creating a new API key in Anthropic Console and copying that one instead

Error: "The API key is invalid. Please check the key and try again."

Error Code: HTTP 400
When it occurs: The API key format is correct, but the key itself is invalid or your Anthropic account has no billing enabled

What This Means

The key you provided starts with sk-ant- (correct format), but one of the following is true:

  1. The key is incorrect or has been revoked
  2. Your Anthropic account does not have billing enabled
  3. Your Anthropic account has no payment method on file

Common Causes

  • Billing not enabled: Anthropic requires a valid payment method to be added to your account to use the API. Note: Can I Run That cannot distinguish between an invalid key and a missing billing setup from this error alone.
  • Key was revoked: You or an administrator revoked this key in the Anthropic Console
  • Typo in key: You have the correct format but one or more characters are wrong
  • Wrong key: You're using an API key from a different Anthropic account
  • Key not fully copied: You copied most of the key but missed the last few characters

How to Resolve

Possible Fix: Enable Billing on Your Anthropic Account

  1. Log in to Anthropic Console
  2. Click on Account or your profile menu
  3. Go to Billing Settings or Payment Method
  4. Verify that a payment method is listed:
    • If no card is listed or you see a warning, click Add Payment Method
  5. Enter your credit card details:
    • Card number
    • Expiration date (MM/YY)
    • CVC code
    • Billing address
  6. Click Save or Add Card
  7. Verify you have available usage credits:
    • Check your credit balance in the Billing section
    • If your balance is $0 or depleted, purchase additional credits or enable auto-reload
  8. Return to Can I Run That Settings and try saving your key again

Option 2: Verify Your Key is Correct

  1. Go to Anthropic Console and check your API Keys
  2. Find the key you're trying to use
  3. Confirm the key shows as Active
  4. If the key is no longer active (e.g., it has been archived or is inactive), you must create a new one:
    • Click + Create Key
    • Give it a name (e.g., "Can I Run That Key")
    • Copy the new key immediately
    • Return to Can I Run That and update the key field
    • Click Save

Option 3: Copy the Key Again

If your account has billing enabled and the key shows as active:

  1. Go to Anthropic ConsoleAPI Keys
  2. Find your key in the list
  3. Click the Copy button to copy the full key again
  4. In Can I Run That, clear the API Key field completely
  5. Paste the newly copied key
  6. Click Save

Option 4: Create a New Key

If the above steps don't work, create a fresh API key:

  1. Go to Anthropic ConsoleAPI Keys
  2. Click + Create Key
  3. Enter a new name (e.g., "Can I Run That")
  4. Click Create
  5. Copy the key immediately (it's only shown once)
  6. In Can I Run That Settings, clear the old key
  7. Paste the new key
  8. Click Save

Verification Checklist

If you're still getting this error, verify all of the following:

  • My Anthropic account has a payment method on file (go to Account → Billing Settings in Anthropic Console)
  • My billing is set up and I have a non-zero credit balance or auto-reload enabled
  • The API key I'm using shows as Active in the Anthropic Console API Keys list
  • I copied the full key exactly as shown in Anthropic Console (check it starts with sk-ant-)
  • I didn't add any spaces or extra characters when pasting into Can I Run That
  • The key I'm using is for my current Anthropic account (not from a different account or service)

Other Errors or Issues

If you see an error message not listed above, or if the troubleshooting steps don't resolve your issue, try these general steps:

General Troubleshooting

  1. Verify your internet connection: Make sure you're connected to a stable network
  2. Clear your browser cache: Sometimes stale data causes issues
  3. Try a different browser: Occasionally, browser extensions or settings interfere
  4. Disable browser extensions: Ad blockers, password managers, or VPNs can sometimes interfere with form submission
  5. Check your firewall/proxy: Ensure outbound connections to console.anthropic.com and api.anthropic.com are allowed

Contact Support

If you've tried the above and still see errors, contact support at support@canirunthat.com with:

  • The exact error message you're seeing
  • When the error occurs (immediately after clicking Save, or after waiting a bit?)
  • Your Anthropic account status:
    • Does your Anthropic account have billing enabled?
    • Do you have an active payment method on file?
    • Is your API key still active in the Anthropic Console?
  • The last four characters of your API key (e.g., ...xxxx) — do NOT share the full key

FAQ

Q: What if my billing is disabled—how do I re-enable it?
A: Log in to Anthropic Console → Account → Billing Settings → Add or verify your payment method.

Q: Can I test my API key without submitting a scan?
A: Yes! In Can I Run That Settings, click Save on your API key. Can I Run That will validate the key immediately and show you any errors.

Q: Who should I contact if I'm still stuck?
A: Contact support at support@canirunthat.com with the information listed in the "Contact Support" section above.


Additional Resources