diff --git a/design/src/check.ts b/design/src/check.ts index dd4bfe43..8f4aee9a 100644 --- a/design/src/check.ts +++ b/design/src/check.ts @@ -63,6 +63,10 @@ export async function checkMockup(imagePath: string, brief: string): Promise { if (!response.ok) { const error = await response.text(); + if (response.status === 403 && error.includes("organization must be verified")) { + throw new Error( + "OpenAI organization verification required.\n" + + "Go to https://platform.openai.com/settings/organization to verify.\n" + + "After verification, wait up to 15 minutes for access to propagate.", + ); + } throw new Error(`API error (${response.status}): ${error.slice(0, 300)}`); } diff --git a/design/src/iterate.ts b/design/src/iterate.ts index d6ec5a53..c85eacee 100644 --- a/design/src/iterate.ts +++ b/design/src/iterate.ts @@ -102,6 +102,13 @@ async function callWithThreading( if (!response.ok) { const error = await response.text(); + if (response.status === 403 && error.includes("organization must be verified")) { + throw new Error( + "OpenAI organization verification required.\n" + + "Go to https://platform.openai.com/settings/organization to verify.\n" + + "After verification, wait up to 15 minutes for access to propagate.", + ); + } throw new Error(`API error (${response.status}): ${error.slice(0, 300)}`); } @@ -142,6 +149,13 @@ async function callFresh( if (!response.ok) { const error = await response.text(); + if (response.status === 403 && error.includes("organization must be verified")) { + throw new Error( + "OpenAI organization verification required.\n" + + "Go to https://platform.openai.com/settings/organization to verify.\n" + + "After verification, wait up to 15 minutes for access to propagate.", + ); + } throw new Error(`API error (${response.status}): ${error.slice(0, 300)}`); } diff --git a/design/src/variants.ts b/design/src/variants.ts index e9d8ad77..87ccca92 100644 --- a/design/src/variants.ts +++ b/design/src/variants.ts @@ -77,6 +77,9 @@ async function generateVariant( if (!response.ok) { const error = await response.text(); + if (response.status === 403 && error.includes("organization must be verified")) { + return { path: outputPath, success: false, error: "OpenAI organization verification required. Go to https://platform.openai.com/settings/organization to verify." }; + } return { path: outputPath, success: false, error: `API error (${response.status}): ${error.slice(0, 200)}` }; }