API Reference
Vision Tool
Image understanding, OCR, and generation capabilities
Image Description
Analyze images using AI vision models.
Endpoint
POST /v1/vision/describeRequest
curl https://api.router9.com/v1/vision/describe \
-H "Authorization: Bearer sk-r9k-your-key" \
-H "Content-Type: application/json" \
-d '{
"mediaUrl": "https://example.com/photo.jpg",
"prompt": "What is in this image?"
}'| Parameter | Type | Required | Description |
|---|---|---|---|
mediaUrl | string | One of mediaUrl/mediaBase64 | URL to image |
mediaBase64 | string | One of mediaUrl/mediaBase64 | Base64-encoded image |
prompt | string | No | Specific question about the image |
Response
{
"success": true,
"result": {
"text": "The image shows a modern office space with developers working at their desks, multiple monitors displaying code editors."
}
}OCR (Text Extraction)
Extract all visible text from images — printed text, handwriting, signs, and labels.
Endpoint
POST /v1/vision/ocrRequest
curl https://api.router9.com/v1/vision/ocr \
-H "Authorization: Bearer sk-r9k-your-key" \
-H "Content-Type: application/json" \
-d '{
"mediaUrl": "https://example.com/document.jpg"
}'| Parameter | Type | Required | Description |
|---|---|---|---|
mediaUrl | string | One of mediaUrl/mediaBase64 | URL to image |
mediaBase64 | string | One of mediaUrl/mediaBase64 | Base64-encoded image |
Response
{
"success": true,
"tool": "vision.ocr",
"result": {
"blocks": [
{ "text": "Invoice #1234", "confidence": 0.98, "type": "printed" },
{ "text": "Total: $150.00", "confidence": 0.95, "type": "printed" }
],
"fullText": "Invoice #1234\nTotal: $150.00"
}
}Image Generation
Generate images from text descriptions.
Endpoint
POST /v1/image/generationsRequest
curl https://api.router9.com/v1/image/generations \
-H "Authorization: Bearer sk-r9k-your-key" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A futuristic city skyline at sunset, digital art"
}'| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Description of the image to generate |
Response
{
"created": 1714000000,
"data": [
{
"b64_json": "iVBORw0KGgo...",
"revised_prompt": "A futuristic city skyline at sunset, digital art"
}
]
}Quotas
| Plan | Image Understanding | Image Generation |
|---|---|---|
| Free | 5/period | 5/period |
| Assistant | 50/period | 50/period |
| Engineer | 1,000/period | 1,000/period |