API Reference

Code Screenshot API

Generate beautiful code screenshots programmatically. Free, no authentication required.

POST/api/v1/screenshot

Quick Start

bash
curl -X POST https://ray.tinte.dev/api/v1/screenshot \
  -H 'Content-Type: application/json' \
  -d '{
    "code": "console.log(\"Hello, World!\")",
    "language": "javascript",
    "theme": "one-hunter"
  }' -o screenshot.png

Returns a PNG image. The response Content-Type is image/png.

Parameters

NameTypeDefaultDescription
coderequiredstring-The source code to render
languagestring"tsx"Syntax highlighting language
themestring"one-hunter"Theme slug or inline TinteBlock
mode"dark" | "light""dark"Color scheme
paddingnumber32Outer padding in px (0-256)
fontSizenumber14Font size in px (8-32)
lineNumbersbooleantrueShow line numbers
titlestring""Window title bar text
backgroundstring"midnight"Gradient preset or hex color
scalenumber2Resolution multiplier (1-4)

Background presets: midnight sunset ocean forest ember steel aurora none

Supported Languages

TSXTypeScriptJavaScriptPythonRustGoHTMLCSSJSONBashSQLJavaC++RubySwiftKotlin

Themes

Choose from 500+ themes. Browse the full collection at tinte.dev/themes.

Pass any theme slug as the theme parameter, or provide an inline TinteBlock object for custom themes.

Code Examples

JavaScript / Node.js

javascript
const res = await fetch("https://ray.tinte.dev/api/v1/screenshot", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    code: 'console.log("Hello")',
    language: "javascript",
    theme: "one-hunter",
  }),
});
const blob = await res.blob();

Python

python
import requests

res = requests.post("https://ray.tinte.dev/api/v1/screenshot", json={
    "code": "print('Hello')",
    "language": "python",
    "theme": "one-hunter",
})
with open("screenshot.png", "wb") as f:
    f.write(res.content)

AI Agent Integration

Ray works natively with Claude Code, Cursor, and 40+ AI agents via the skills protocol.

terminal
npx skills add Railly/tinte

Once installed, ask your AI assistant to take a code screenshot.

Rate Limits

60 requests / minuteper IP address

No authentication required. Check usage at GET /api/v1/ratelimit-status