Fallback image reading and analysis through an external multimodal API (OpenAI- or Anthropic-compatible). Use this skill only when the current model or session does not have native vision/image-input capability, or when native image inspection has genuinely failed. If the current model can inspect images natively, analyze the attachment directly (or load a path-only image with the available local image-viewing tool) and do not call this external vision skill.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of vision-skill?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/autsunset-vision-skill)
---
name: vision-skill
description: Fallback image reading and analysis through an external multimodal API (OpenAI- or Anthropic-compatible). Use this skill only when the current model or session does not have native vision/image-input capability, or when native image inspection has genuinely failed. If the current model can inspect images natively, analyze the attachment directly (or load a path-only image with the available local image-viewing tool) and do not call this external vision skill.
---
# Vision Skill — External Vision Fallback
This skill enables image analysis by calling an external multimodal API. It reads image files, base64-encodes them, and sends them to a separately configured vision model.
It is a **fallback for models or sessions without native vision**, not the default path for image requests. Avoiding unnecessary calls also prevents redundant latency, cost, and transmission of images to an additional external endpoint.
## Capability Gate (Required)
Before using this skill, determine whether the current model/session can inspect the image natively:
1. **Native vision is available:** Use the attached image directly. If the user supplied only a local path, first load it with the available local image-viewing tool (for example, `view_image`), then answer using native vision. **Do not run `vision.py` or call the external multimodal API.**
2. **Native vision is unavailable:** Use this skill as the fallback.
3. **Native inspection genuinely failed:** After confirming the image exists and can be read, this skill may be used as a fallback. Briefly disclose that an external vision fallback was used.
4. Do not infer that native vision is unavailable merely because the image is a screenshot, contains text, requires OCR, or was provided as a filesystem path.
## When to Use
Use this skill only when all of the following are true:
- The user wants an image, screenshot, photo, diagram, chart, or other visual content read or analyzed.
- The current model/session cannot inspect images natively, or native inspection has genuinely failed.
- The image file is accessible to the skill script.
Typical fallback tasks include OCR, screenshot reading, chart interpretation, diagram explanation, and general image description.
## When Not to Use
- The current model supports native vision and can see the attached image.
- A path-only image can be loaded with an available local image-viewing tool and then inspected natively.
- The request can be answered from text already supplied by the user.
- The skill would only duplicate a successful native inspection.
## Configuration
The skill reads configuration in this priority order: environment variables, a `.env` file in the skill directory, then `~/.claude/vision-config.json`.
### Environment Variables
| Variable | Default | Description |
|---|---|---|
| `VISION_API_KEY` | *(required)* | API key for the multimodal endpoint |
| `VISION_API_BASE` | `https://api.openai.com/v1` | API base URL |
| `VISION_MODEL` | `gpt-4o` | Model name to use |
| `VISION_API_FORMAT` | `openai` | API format: `openai` or `anthropic` |
| `VISION_MAX_TOKENS` | `4096` | Max tokens in the response |
### Skill-local `.env` File
Copy `.env.example` to the installed skill directory and fill in the real values:
```bash
cp .env.example ~/.claude/skills/vision-skill/.env
```
### Config File (`~/.claude/vision-config.json`)
```json
{
"api_key": "sk-...",
"api_base": "https://api.openai.com/v1",
"model": "gpt-4o",
"api_format": "openai",
"max_tokens": 4096
}
```
Environment variables take precedence over the skill-local `.env` file, which takes precedence over the config file.
## How to Analyze an Image (Fallback Only)
The skill bundles a launcher script `vision-skill.sh` that auto-detects a working Python 3 interpreter. Use it directly:
```bash
bash ~/.claude/skills/vision-skill/scripts/vision-skill.sh <image_path> [prompt]
```
Alternatively, invoke `vision.py` with whichever Python 3 is available on the system (`python` on Windows, `python3` on Linux/macOS):
```bash
python ~/.claude/skills/vision-skill/scripts/vision.py <image_path> [prompt]
```
### Arguments
- **image_path** (required): Local file path, or a `data:image/...;base64,...` URI. Supports PNG, JPG/JPEG, GIF, WebP, BMP, TIFF.
- **prompt** (optional): What to analyze or describe. Defaults to a detailed image description.
### Examples
These commands apply only after the capability gate has determined that external fallback is needed.
```bash
# Simple description
bash ~/.claude/skills/vision-skill/scripts/vision-skill.sh screenshot.png
# Custom analysis prompt
bash ~/.claude/skills/vision-skill/scripts/vision-skill.sh diagram.png "Explain the architecture shown in this diagram"
# OCR / text extraction
bash ~/.claude/skills/vision-skill/scripts/vision-skill.sh receipt.jpg "Extract all text from this image"
# Chart reading
bash ~/.claude/skills/vision-skill/scripts/vision-skill.sh chart.png "Read the values from this bar chart"
```
## Workflow
1. Identify the image attachment or path from the user's message.
2. Apply the required capability gate above.
3. If native vision is available, inspect the image natively and stop; do not invoke this skill's external API.
4. Only if native vision is unavailable or genuinely failed, confirm that the image exists and is readable.
5. Determine the user's question about the image. If no specific question is given, request a general description from the fallback model.
6. Run `bash ~/.claude/skills/vision-skill/scripts/vision-skill.sh <path> "<prompt>"` (or the Windows Python equivalent).
7. Present the result and briefly state that the external vision fallback was used.
8. For follow-up questions, reuse native vision if it has become available; otherwise rerun the fallback only when necessary.
## Error Handling
- If native vision is available, do not treat missing external API configuration as an error; simply use native vision.
- If `VISION_API_KEY` is not configured through the environment, the skill-local `.env` file, or the config file—and native vision is unavailable—the script prints a setup message. Relay it to the user.
- If the image file does not exist, report the missing path and ask the user to verify it.
- If the API returns an HTTP error, surface a concise description without exposing credentials or sensitive configuration.
- Do not repeatedly call the external API after a failure without changing the conditions or troubleshooting the cause.
## Anthropic API Format
When `VISION_API_FORMAT=anthropic`:
- Endpoint: `{api_base}/v1/messages` (`api_base` defaults to `https://api.anthropic.com`)
- Sends the image as a Base64 content block
- Uses the configured API key and Anthropic API version headers
## Tips
- Prefer native vision whenever available.
- For screenshots with text, ask the fallback model to extract all visible text.
- For diagrams, ask for a step-by-step explanation.
- For charts and graphs, specify the data to extract.
- The fallback works with OpenAI-compatible, Anthropic-compatible, and local multimodal endpoints supported by the script configuration.
- For multiple images, call the fallback once per image only when native vision is unavailable, then synthesize the results.