# Relaystation Image Canvas Extend

> Relaystation Image Canvas Extend is a paid API for AI agents from api.relaystation.ai, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Extends an image's canvas on any side (top, bottom, left, right) by a specified number of pixels, filling the new area with a background color, copy, repeat, or mirror of the original.

## Facts

- Endpoint: POST https://api.relaystation.ai/v1/image/extend
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/relaystation-image-canvas-extend-2b9b4f71
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ngJN3PzLDtUFmla4MUhYs

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability relaystation-image-canvas-extend-2b9b4f71 -d '<json body>'
```

Example prompt: Take this product photo and extend the canvas by 100 pixels on each side, filling the new space with a plain white background (#FFFFFF) so I have breathing room around the image.

## When to prefer this

Choose this endpoint when you need to add canvas space around an existing image without cropping or altering the original content — for aspect ratio normalization, adding title space, creating uniform borders, or fitting images to a specific canvas size. Prefer over crop-based resizing when preserving the full original image is required.

## Known failure modes

- Image file too large (>50 MB via inputKey or >4 MiB inline base64) returns an error
- Invalid or malformed base64 input returns a parsing error
- Padding values outside allowed range (0–10000 px) return a validation error
- Unsupported extendWith enum value returns a bad request error
- Invalid hex color or out-of-range RGBA values return a validation error
- Missing required 'file' field returns a 400 bad request

## How this service works

$0.0003/MP. Pad or extend an image's canvas on any side — aspect-ratio fixes without cropping. 1¢ x402 min; remainder auto-credits — relaystation.ai/penny

## Output

A PNG image (returned as base64 inline or a scratch key) with the canvas extended by the specified pixel amounts on each requested side. The response includes the filename (e.g. 'extended.png'), MIME content type ('image/png'), and the size in bytes.

## Example request

```json
{
 "input": {
  "body": {
   "top": 50,
   "file": {
    "inline": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="
   },
   "left": 50,
   "right": 50,
   "bottom": 50,
   "background": "#FFFFFF",
   "extendWith": "background"
  },
  "type": "http",
  "method": "POST",
  "bodyType": "json"
 },
 "output": {
  "type": "image"
 }
}
```

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "type": "object",
     "properties": {
      "file": {
       "type": "object",
       "description": "cputools input-source: { inline: <base64 ≤ 4 MiB> } or { inputKey: <scratch key from /v1/cputools/upload-url, ≤ 50 MB> }."
      },
      "top": {
       "type": "integer",
       "minimum": 0,
       "maximum": 10000
      },
      "bottom": {
       "type": "integer",
       "minimum": 0,
       "maximum": 10000
      },
      "left": {
       "type": "integer",
       "minimum": 0,
       "maximum": 10000
      },
      "right": {
       "type": "integer",
       "minimum": 0,
       "maximum": 10000
      },
      "background": {
       "oneOf": [
        {
         "type": "string",
         "maxLength": 32,
         "description": "A hex color string (\"#rrggbb\")."
        },
        {
         "type": "object",
         "required": [
          "r",
          "g",
          "b"
         ],
         "properties": {
          "r": {
           "type": "integer",
           "minimum": 0,
           "maximum": 255
          },
          "g": {
           "type": "integer",
           "minimum": 0,
           "maximum": 255
          },
          "b": {
           "type": "integer",
           "minimum": 0,
           "maximum": 255
          },
          "alpha": {
           "type": "number",
           "minimum": 0,
           "maximum": 1
          }
         }
        }
       ]
      },
      "extendWith": {
       "type": "string",
       "enum": [
        "background",
        "copy",
        "repeat",
        "mirror"
       ]
      }
     }
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   },
   "required": [
    "type"
   ]
  }
 },
 "required": [
  "input"
 ]
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/relaystation-image-canvas-extend-2b9b4f71/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.relaystation.ai](https://www.zero.xyz/host/api.relaystation.ai/llms.txt)
