1---2name: ray3description: Generate code screenshots via ray.tinte.dev API. Use when user asks for code screenshots, code images, code snippets as images, or says "ray". Calls POST https://ray.tinte.dev/api/v1/screenshot and saves the PNG result.4---56# Ray - Code Screenshots78Generate code screenshots by calling the ray.tinte.dev API.910## API1112```13POST https://ray.tinte.dev/api/v1/screenshot14Content-Type: application/json15```1617## Parameters1819| Param | Type | Default | Notes |20|-------|------|---------|-------|21| `code` | string | *required* | 1-10,000 chars |22| `language` | string | `"typescript"` | typescript, javascript, python, rust, go, java, cpp, c, html, css, json, bash, sql, markdown, toml |23| `theme` | string or TinteBlock | `"one-hunter"` | Slug from tinte.dev or inline object |24| `mode` | `"dark"` \| `"light"` | `"dark"` | |25| `padding` | number | `32` | 0-256 |26| `fontSize` | number | `14` | 8-32 |27| `lineNumbers` | boolean | `true` | |28| `title` | string | `""` | Window chrome title (max 100) |29| `background` | string | `"midnight"` | One of: midnight, sunset, ocean, forest, ember, steel, aurora, none. Hex colors are not accepted. |30| `format` | `"png"` | `"png"` | PNG only |31| `scale` | number | `2` | 1-4 (retina) |3233## Notes3435- `background: "none"` returns a transparent RGBA PNG. Useful when you want to composite the screenshot onto a custom background.36- Returned PNGs always include some transparent margin around the window for the drop shadow, even with `padding: 0`. If you're compositing the result, trim that halo first (e.g. `magick input.png -trim +repage output.png`).37- Long snippets can take 30-60+ seconds to render. Use a per-request timeout when calling from scripts or agents.3839## Workflow40411. Identify the code to screenshot (from file, clipboard, or user input)422. Detect language from file extension or content433. Call the API via curl444. Save the PNG and open it4546## Example4748```bash49curl -s -X POST https://ray.tinte.dev/api/v1/screenshot \50 -H 'Content-Type: application/json' \51 -d '{52 "code": "const greeting = \"Hello, world!\";",53 "language": "typescript",54 "theme": "one-hunter",55 "title": "hello.ts"56 }' -o screenshot.png && open screenshot.png57```5859## Language Detection6061| Extension | Language |62|-----------|----------|63| .ts, .tsx | typescript |64| .js, .jsx | javascript |65| .py | python |66| .rs | rust |67| .go | go |68| .java | java |69| .cpp, .cc, .cxx | cpp |70| .c, .h | c |71| .html | html |72| .css | css |73| .json | json |74| .sh, .bash | bash |75| .sql | sql |76| .md | markdown |77| .toml | toml |7879## Themes8081- Default: `"one-hunter"` (Vercel-inspired dark theme)82- Any slug from tinte.dev: `"github-dark"`, `"dracula"`, `"catppuccin"`, etc.83- Inline TinteBlock object with 13 semantic colors (bg, tx, tx_2, tx_3, ui, ui_2, ui_3, ac_1, ac_2, ac_3, pr, sc, nt)