# Image2Text API > Send a screenshot or a URL. Get back all readable text. If you send a URL, we render the page and extract the visible text. Tesseract OCR. $0.01 per extraction. ## Documentation - [Full API Documentation](https://image2text.dev/llms-full.txt): Complete API reference with all endpoints, authentication, pricing, error codes, and curl examples - [OpenAPI Specification](https://image2text.dev/openapi.json): Machine-readable API schema for tool integration and code generation ## Quick Start Base URL: `https://api.image2text.dev/api/v1` ### 1. Register and get an API key ```bash # Create account curl -X POST https://api.image2text.dev/api/v1/auth/register \ -H "Content-Type: application/json" \ -d '{"email": "you@company.com"}' # Verify email (check inbox for 6-digit code) curl -X POST https://api.image2text.dev/api/v1/auth/verify \ -H "Content-Type: application/json" \ -d '{"email": "you@company.com", "code": "123456"}' # Get API key (5 free credits included) curl -X POST https://api.image2text.dev/api/v1/auth/api-key \ -H "Content-Type: application/json" \ -d '{"email": "you@company.com"}' ``` ### 2. Extract text from an image ```bash curl -X POST https://api.image2text.dev/api/v1/extract \ -H "X-API-Key: i2t_live_YOUR_KEY" \ -F "file=@screenshot.jpg" ``` ### Or extract text from a URL ```bash curl -X POST https://api.image2text.dev/api/v1/extract/url \ -H "Content-Type: application/json" \ -H "X-API-Key: i2t_live_YOUR_KEY" \ -d '{"url": "https://news.ycombinator.com"}' ``` Response (same format for both): ```json { "text": "Tartine Bakery\nhttps://tartinebakery.com\nCLICK HERE TO PRE-ORDER...", "characters": 1044, "lines": 35 } ``` ## All Endpoints ### Text Extraction | Method | Endpoint | Auth | Cost | Description | |--------|----------|------|------|-------------| | POST | `/api/v1/extract` | X-API-Key | 1 credit | Extract text from an uploaded image | | POST | `/api/v1/extract/url` | X-API-Key | 1 credit | Extract text from a URL. Pass `"full_page": true` for entire page. | ### Authentication | Method | Endpoint | Auth | Description | |--------|----------|------|-------------| | POST | `/api/v1/auth/register` | None | Create account (sends verification email) | | POST | `/api/v1/auth/verify` | None | Verify email with 6-digit code | | POST | `/api/v1/auth/api-key` | None | Generate API key (5 free credits) | ### Account & Credits | Method | Endpoint | Auth | Description | |--------|----------|------|-------------| | GET | `/api/v1/account` | X-API-Key | View balance, usage, recent queries | | GET | `/api/v1/credits/packs` | None | List available credit packs | | POST | `/api/v1/credits/purchase` | X-API-Key | Buy credits via Stripe Checkout | ### System | Method | Endpoint | Auth | Description | |--------|----------|------|-------------| | GET | `/api/v1/health` | None | Health check and Tesseract status | ## Pricing - **$0.01 per extraction** (image or URL) — no tiers, no bulk discounts - Failed extractions are free (credit automatically refunded) - GET requests are always free - 5 free credits on signup ### Credit Packs | Pack | Credits | Price | |------|---------|-------| | 100 | 100 images | $1.00 | | 1,000 | 1,000 images | $10.00 | | 10,000 | 10,000 images | $100.00 | ## Supported Formats JPEG, PNG, WebP, TIFF, BMP. Maximum file size: 20MB. ## Authentication All extraction and account endpoints require an API key passed as an HTTP header: ``` X-API-Key: i2t_live_aBcDeFgHiJkLmNoPqRsTuVwXyZ... ``` ## Error Codes | Code | Meaning | |------|---------| | 200 | Success | | 401 | Missing or invalid API key | | 402 | Insufficient credits | | 413 | Image exceeds 20MB limit | | 422 | Unsupported image format, corrupt file, or invalid/private URL | | 429 | Rate limit exceeded | | 502 | Could not load URL (DNS failure, connection error) | | 503 | Browser service unavailable | | 504 | Page load timed out (30s limit) |