Troubleshooting Tavern Studio API Errors

When a chat fails, start with the exact error message. A 400 error, a forbidden response, and an internal server error can look similar in the UI, but they usually point to different causes.

This page is for fixing errors. It is not a feature overview. If you are still setting up your provider, start with API Setup.

Start with the exact error message

Before changing settings, write down:

  • the provider;
  • the model name;
  • the status code or message;
  • whether model refresh works;
  • whether the error happens for every chat or only one character;
  • whether you recently changed a preset, proxy, or endpoint.

Do not share API keys or private chat content in public support posts.

Fix API returned an error

"API returned an error" is a wrapper symptom. Expand details if available, then check:

  1. Provider status.
  2. Account credit or quota.
  3. Model access.
  4. Endpoint or base URL.
  5. API key validity.
  6. Whether a short test prompt works.

If only one character fails, the issue may be context length, preset behavior, or prompt content rather than the API connection.

Fix error 400

Error 400 usually means the provider rejected the request shape.

Common causes:

  • wrong model name;
  • unsupported parameter;
  • malformed endpoint path;
  • duplicate /v1;
  • preset setting the provider does not accept;
  • request too large for the model.

Test with a short prompt and a known working model. If that works, reintroduce the original character, world book, and preset one at a time.

Fix forbidden or 403 responses

Forbidden responses usually mean access was denied.

Check:

  • the API key is copied correctly;
  • the key belongs to the right account or project;
  • the account has access to the model;
  • the provider allows your region or gateway route;
  • the key has not been revoked;
  • any required organization or project setting is selected.

If you recently rotated keys, update Tavern Studio and retry with a short test chat.

Fix internal server error

Internal server errors may be provider-side, gateway-side, or temporary upstream failures. Do not rewrite every setting immediately.

First:

  1. Retry after a short interval.
  2. Check the provider status page.
  3. Test a smaller prompt.
  4. Test a different model.
  5. Test a different provider route if available.

If every provider route fails, check network and proxy settings.

Check endpoint, model, and API key settings

Use this quick checklist:

  • base URL is correct;
  • /v1 path is present only when needed;
  • API key has no spaces;
  • selected model exists;
  • account has quota;
  • provider route matches the endpoint;
  • proxy or network allows the connection;
  • model refresh and chat generation are both tested.

Provider limits and temporary outages

Rate limits, free-tier limits, billing problems, moderation restrictions, and provider outages can all appear as chat errors. A short test prompt helps separate provider issues from character-card or world-book issues.

When to reset setup or contact support

If a minimal prompt fails with a known working provider, reset that provider configuration. If only one character or preset fails, review that character's context, world book, and preset before changing API credentials.

Download Tavern Studio
Windows