unslothai/unsloth · error

HTTP (${response.status})

Error message

HTTP (${response.status})

What it means

Thrown when POST /api/inference/external/openai/containers/list fails. The message comes from parseError(response), which delegates to readFastApiError with fallback label 'HTTP' — producing 'HTTP (status)' when the error body has no readable detail. The request body carries provider_id, optional encrypted_api_key (encrypted via encryptProviderApiKey), and provider_base_url, so failures often originate in those inputs.

Source

Thrown at studio/frontend/src/features/chat/api/openai-containers.ts:75

    ...(auth.apiKey
      ? { encrypted_api_key: await encryptProviderApiKey(auth.apiKey) }
      : {}),
    provider_base_url: auth.baseUrl,
  };
}

export async function listOpenAIContainers(
  auth: AuthInputs,
): Promise<OpenAIContainerSummary[]> {
  const response = await authFetch(
    "/api/inference/external/openai/containers/list",
    {
      method: "POST",
      headers: { "content-type": "application/json" },
      body: JSON.stringify(await buildAuthBody(auth)),
    },
  );
  if (!response.ok) throw new Error(await parseError(response));
  const body = (await response.json()) as { containers?: RawSummary[] };
  return (body.containers ?? []).map(fromRaw);
}

export async function createOpenAIContainer(
  auth: AuthInputs,
  params: { name: string; ttlMinutes: number },
): Promise<OpenAIContainerSummary> {
  const response = await authFetch(
    "/api/inference/external/openai/containers/create",
    {
      method: "POST",
      headers: { "content-type": "application/json" },
      body: JSON.stringify({
        ...(await buildAuthBody(auth)),
        name: params.name,
        ttl_minutes: params.ttlMinutes,
      }),

View on GitHub (pinned to 203007d190)

Solutions

  1. Check the HTTP status embedded in the message: 401/403 → credentials; 404 → provider or endpoint missing; 5xx → upstream OpenAI issue.
  2. Re-enter the provider API key so it is re-encrypted with a fresh public key (see importProviderPublicKey force-refresh).
  3. Verify baseUrl — containers endpoints may not exist on proxied/self-hosted bases.
  4. Confirm the provider still exists in provider settings.
Defensive patterns

Strategy: try-catch

Validate before calling

if (!auth.providerId) throw new Error('Select a provider first');
if (auth.baseUrl && !auth.baseUrl.startsWith('http')) throw new Error('Invalid base URL');

Try / catch

try { const items = await listOpenAIContainers(auth); }
catch (e) { if (/HTTP \((401|403)\)/.test(e.message)) promptReauth(); else showError(e.message); }

Prevention

When it happens

Trigger: Listing OpenAI containers with a providerId that doesn't exist server-side, a stale/changed provider public key making the encrypted key undecryptable, a wrong baseUrl, or the external containers API rejecting the credentials.

Common situations: Provider API key rotated since the cached public key was fetched; custom baseUrl pointing at a proxy without containers support; provider deleted while the containers dialog was open.

Related errors


AI-assisted analysis of unslothai/unsloth@203007d190 (2026-08-15). Data as JSON: /api/errors/62e1882451a820b4. Report an issue: GitHub.