srbhr/Resume-Matcher · error · HTTPException

Unsupported provider: {provider}. Supported: {SUPPORTED_PROV

Error message

Unsupported provider: {provider}. Supported: {SUPPORTED_PROVIDERS}

What it means

Raised by the delete_api_key endpoint in apps/backend/app/routers/config.py when the provider path/body value is not one of the names in SUPPORTED_PROVIDERS (openai, anthropic, google, openrouter, deepseek). The endpoint refuses to delete a config entry for an unknown provider rather than silently succeeding. It is a plain 400 client error driven by a membership check.

Source

Thrown at apps/backend/app/routers/config.py:637

            detail="Confirmation required. Pass confirm=CLEAR_ALL_KEYS query parameter.",
        )
    clear_all_api_keys()
    invalidate_config_cache()
    return {"message": "All API keys have been cleared"}


@router.delete("/api-keys/{provider}")
async def delete_api_key(provider: str) -> dict:
    """Delete API key for a specific provider.

    Args:
        provider: The provider name (openai, anthropic, google, openrouter, deepseek)

    Returns:
        Success message
    """
    if provider not in SUPPORTED_PROVIDERS:
        raise HTTPException(
            status_code=400,
            detail=f"Unsupported provider: {provider}. Supported: {SUPPORTED_PROVIDERS}",
        )

    delete_api_key_from_config(provider)
    invalidate_config_cache()

    return {"message": f"API key for {provider} has been removed"}


@router.post("/reset")
async def reset_database_endpoint(request: ResetDatabaseRequest) -> dict:
    """Reset the database and clear all data.

    WARNING: This action is irreversible. It will:
    1. Truncate all database tables (resumes, jobs, improvements)
    2. Delete all uploaded files

View on GitHub (pinned to 116f9cc3b0)

Solutions

  1. Check the provider string against the exact names in SUPPORTED_PROVIDERS (openai, anthropic, google, openrouter, deepseek)
  2. Fix spelling/casing to lowercase exact match
  3. If a legitimately new provider is needed, add it to SUPPORTED_PROVIDERS in the backend and to the delete API key path
  4. Confirm the key actually exists under a supported provider before calling delete

Example fix

// before
delete('/config/api-key/open-ai')
// after
delete('/config/api-key/openai')
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED = ['openai','anthropic','google','openrouter','deepseek'];
if (!SUPPORTED.includes(provider)) throw new Error(`Unsupported provider: ${provider}`);

Try / catch

try { await api.deleteApiKey(provider); } catch (e) { if (e.status === 400) { console.error('Pick a supported provider:', e.detail); } else throw e; }

Prevention

When it happens

Trigger: Calling DELETE for an API key with a misspelled or unsupported provider (e.g. 'OpenAI' with wrong case, 'azure-openai', 'groq', or an empty string) such that `provider not in SUPPORTED_PROVIDERS`.

Common situations: Hardcoded provider strings in client code drifting from the backend's supported list; typos or casing mismatches; adding a new provider on the client before updating SUPPORTED_PROVIDERS on the backend.

Related errors


AI-assisted analysis of srbhr/Resume-Matcher@116f9cc3b0 (2026-08-28). Data as JSON: /api/errors/2a4813bd0049670b. Report an issue: GitHub.