sketch-ai-provider-debug

Debug OpenAI and Gemini image generation failures for Sketch Magic /api/convert requests.

Updated Dec 31, 2025
One-click install
npx skills add https://github.com/joelklabo/markdowntown-cli --skill sketch-ai-provider-debug
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sketch-ai-provider-debug
Source: https://github.com/joelklabo/markdowntown-cli/tree/main/codex/skills/sketch-ai-provider-debug
Command: npx skills add https://github.com/joelklabo/markdowntown-cli --skill sketch-ai-provider-debug

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Provide a consistent, safe workflow to triage and resolve image generation failures from OpenAI and Gemini providers for the Sketch Magic /api/convert endpoint, avoiding accidental exposure of API keys or raw image bytes.

Core Features & Use Cases

  • Configuration validation: Check environment variables like OPENAI_API_KEY, GEMINI_API_KEY, DEFAULT_PROVIDER, and model settings against supported models.
  • Controlled reproduction: Reproduce failures with a tiny PNG and short prompt using multipart requests while keeping server and client logs visible.
  • Failure interpretation & remediation: Distinguish 500 provider errors, 400 input errors, timeouts, quota or model-mismatch issues, and apply fixes such as model swap, image reduction, or SDK version alignment.
  • Safe reporting: Summarize error codes, timings, and non-sensitive metadata for bug reports without logging secrets or raw image data.
  • Use case: Triage intermittent 500 errors from a deployed Sketch Magic instance that only occur with certain image sizes or provider model selections.

Quick Start

Use the sketch-ai-provider-debug skill to reproduce a failing /api/convert call with a tiny PNG and a short prompt while capturing server and client logs and avoiding any logging of API keys or raw image bytes.

Frequently Asked Questions about sketch-ai-provider-debug

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug OpenAI and Gemini image generation failures safely?

To debug image generation failures safely, reproduce the failing API request with a tiny PNG and short prompt while capturing server logs, ensuring you never log API keys or raw image bytes.

Why does my Sketch Magic /api/convert endpoint return a 500 error?

A 500 error on the /api/convert endpoint often indicates a provider failure, model mismatch, or timeout. Validate your environment variables and provider model settings to distinguish provider errors from input errors.

How do I safely report image generation API errors without exposing secrets?

Safely report image generation API errors by summarizing error codes, timings, and non-sensitive metadata for bug reports, strictly avoiding logging API keys or raw image data in your summaries.

What environment variables do I need to validate for Gemini and OpenAI image generation?

Validate environment variables like OPENAI_API_KEY, GEMINI_API_KEY, DEFAULT_PROVIDER, and model settings against supported models to ensure correct configuration for image generation triage.

How do I reproduce an intermittent image generation timeout issue?

Reproduce intermittent image generation timeouts by sending controlled multipart requests with a small image and prompt, keeping both server and client logs visible to isolate the failure condition.

How do I fix unsupported model errors in image generation APIs?

Fix unsupported model errors by validating your DEFAULT_PROVIDER and model settings against supported lists, then apply remedies like a model swap, image reduction, or SDK version alignment.