This is a Next.js project bootstrapped with create-next-app that serves as the backend for the AskShot Chrome extension. It provides an API endpoint that integrates with the Anthropic Claude Vision API to analyze screenshots and answer questions about them.
- Create a
.env.localfile in the root directory based on.env.local.example - Add your Anthropic API key to the
.env.localfile:
ANTHROPIC_API_KEY=your_anthropic_api_key_here
Run the development server:
pnpm devOpen http://localhost:3000 with your browser to see the result.
The API endpoint will be available at http://localhost:3000/api/analyze.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
Analyzes a screenshot using the Anthropic Claude Vision API.
Request Body:
{
"screenshot": "base64_encoded_image_data",
"question": "What does this screenshot show?"
}Response:
{
"answer": "AI-generated response about the screenshot"
}- Anthropic Claude Vision API Documentation
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.