> ## Documentation Index
> Fetch the complete documentation index at: https://sudomock.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> The base URL is https://api.sudomock.com.
> Authenticate every request with the x-api-key header. Keys begin with sm_.
> A render returns the finished image at data.print_files[0].export_path. A request sent with is_async true returns a job_id to poll at GET /api/v1/jobs/{job_id}.
> Prefer the official SDKs over hand-written HTTP calls: npm install sudomock for Node, pip install sudomock for Python.

# Check the seams of a pattern tile

> Checks whether copies of a pattern tile meet without a visible line when it repeats on a mockup, and shows where a line appears. Send crop_aspect when the render places the tile with fit "crop", so the check sees exactly the tile the render shows. Free: no credits are used, and a tile checked before answers at once.

Tells you whether a tile meets its own copies cleanly before you repeat it
across a product. Send the tile as a public `url` or as `base64`, the same way
as a [background removal](https://sudomock.com/docs/api-reference/background-removal/remove-the-background-from-an-image.md).
The answer comes back in the same call, and a check costs no credits.

`status` reads `seamless`, `faint_seam` or `visible_seam`. `seams` lists only
the joins that are not seamless. `left_right` is where the right edge of one
copy meets the left edge of the next, and `top_bottom` is where the bottom edge
meets the top. Each entry has its own `status` and its `ranges`: half open
pixel spans, `[start, end)`, along that join. They count rows on `left_right`
and columns on `top_bottom`, so you can point at the exact stretch that breaks.

Send `crop_aspect`, the width divided by the height, when the render places
the tile with `fit` set to `crop`. The tile is then cut exactly the way the
render cuts it, the cut tile is what gets checked, and `width` and `height`
report its size.

`fixable` says whether [Fix seams](https://sudomock.com/docs/api-reference/patterns/fix-seams.md) accepts
the tile. When it does not, `unfixable_reason` says why: `transparent_edges`
for a tile with transparent pixels along its edges, `too_large` for a tile
above the size a fix takes. `previous_fix` hands back your latest successful
fix of the same image and crop, so you can reuse a tile you have already
repaired instead of paying for it again.

> [!NOTE]
>
> Checking the same image with the same `crop_aspect` again returns the first
> answer at once, and a repeat check does not count toward the
> [seam check rate](https://sudomock.com/docs/api-reference/usage-limits.md#seam-checks).

```js Node.js theme={"theme":{"light":"github-light","dark":"vesper"}}
const response = await fetch("https://api.sudomock.com/api/v1/check-seams", {
  method: "POST",
  headers: {
    "x-api-key": "sm_your_api_key",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "url": "https://example.com/pattern-tile.png"
  }),
});

const data = await response.json();
console.log(data);
```

```php PHP theme={"theme":{"light":"github-light","dark":"vesper"}}
<?php

$payload = <<<'JSON'
{
  "url": "https://example.com/pattern-tile.png"
}
JSON;

$ch = curl_init("https://api.sudomock.com/api/v1/check-seams");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "x-api-key: sm_your_api_key",
    "Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
```

```python Python theme={"theme":{"light":"github-light","dark":"vesper"}}
import requests

payload = {'url': 'https://example.com/pattern-tile.png'}

response = requests.post(
    "https://api.sudomock.com/api/v1/check-seams",
    headers={"x-api-key": "sm_your_api_key"},
    json=payload,
)

response.raise_for_status()
print(response.json())
```

```ruby Ruby theme={"theme":{"light":"github-light","dark":"vesper"}}
require "net/http"
require "uri"

uri = URI("https://api.sudomock.com/api/v1/check-seams")
request = Net::HTTP::Post.new(uri)
request["x-api-key"] = "sm_your_api_key"
request["Content-Type"] = "application/json"

request.body = <<~JSON
  {
    "url": "https://example.com/pattern-tile.png"
  }
JSON

response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
  http.request(request)
end

puts response.body
```

```go Go theme={"theme":{"light":"github-light","dark":"vesper"}}
package main

import (
	"bytes"
	"fmt"
	"io"
	"net/http"
)

func main() {
	payload := []byte(`{
  "url": "https://example.com/pattern-tile.png"
}`)

	req, err := http.NewRequest("POST", "https://api.sudomock.com/api/v1/check-seams", bytes.NewBuffer(payload))
	if err != nil {
		panic(err)
	}
	req.Header.Set("x-api-key", "sm_your_api_key")
	req.Header.Set("Content-Type", "application/json")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

```java Java theme={"theme":{"light":"github-light","dark":"vesper"}}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

String payload = """
{
  "url": "https://example.com/pattern-tile.png"
}
""";

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.sudomock.com/api/v1/check-seams"))
    .header("x-api-key", "sm_your_api_key")
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(payload))
    .build();

HttpResponse<String> response = HttpClient.newHttpClient()
    .send(request, HttpResponse.BodyHandlers.ofString());

System.out.println(response.body());
```

```csharp .NET theme={"theme":{"light":"github-light","dark":"vesper"}}
using System.Net.Http;
using System.Text;

var payload = """
{
  "url": "https://example.com/pattern-tile.png"
}
""";

var request = new HttpRequestMessage(HttpMethod.Post, "https://api.sudomock.com/api/v1/check-seams");
request.Headers.Add("x-api-key", "sm_your_api_key");
request.Content = new StringContent(payload, Encoding.UTF8, "application/json");

var client = new HttpClient();
var response = await client.SendAsync(request);

Console.WriteLine(await response.Content.ReadAsStringAsync());
```

```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}}
curl -X POST "https://api.sudomock.com/api/v1/check-seams" \
  -H "x-api-key: sm_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/pattern-tile.png"
  }'
```

```json Response theme={"theme":{"light":"github-light","dark":"vesper"}}
{
  "data": {
    "fixable": true,
    "height": 2048,
    "seams": [
      {
        "ranges": [
          [
            0,
            412
          ],
          [
            1630,
            2048
          ]
        ],
        "side": "left_right",
        "status": "visible_seam"
      }
    ],
    "status": "visible_seam",
    "width": 2048,
    "previous_fix": null,
    "unfixable_reason": null
  },
  "success": true
}
```


## OpenAPI

````yaml openapi.json POST /api/v1/check-seams
openapi: 3.1.0
info:
  title: SudoMock API
  description: >-
    Product mockup API. Render PSD templates, turn product photos into reusable
    mockups, create still images and videos, personalize text with fonts, and
    manage asynchronous jobs and signed webhooks.


    Every endpoint answers failures with the same envelope, so the status codes,
    the error_code values and the retry rule are documented once at
    https://sudomock.com/docs/errors rather than repeated per operation.
  version: 1.0.0
servers:
  - url: https://api.sudomock.com
    description: Production
security: []
tags:
  - name: PSD mockups
    description: Turn a Photoshop file into a reusable mockup, then render it.
  - name: Photo mockups
    description: Turn a product photo into a reusable mockup, then render artwork onto it.
  - name: Video mockups
    description: Render a mockup as a short video.
  - name: Fonts
    description: Upload and manage the fonts available to text layers.
  - name: Background removal
    description: Isolate a subject from its background as a standalone step.
  - name: Patterns
    description: Check a repeating pattern tile for seams and fix them.
  - name: Studio
    description: Open an embedded editor session and read what the customer produced in it.
  - name: Webhook endpoints
    description: Register signed endpoints and manage their secrets.
  - name: Webhook deliveries
    description: Inspect, replay and retry what those endpoints received.
  - name: Jobs
    description: Poll queued renders and read their results.
  - name: Account
    description: Read the current account, its plan and its remaining credits.
paths:
  /api/v1/check-seams:
    post:
      tags:
        - Patterns
      summary: Check a pattern tile for seams
      description: >-
        Checks whether copies of a pattern tile meet without a visible line when
        it repeats on a mockup, and shows where a line appears. Send crop_aspect
        when the render places the tile with fit "crop", so the check sees
        exactly the tile the render shows. Free: no credits are used, and a tile
        checked before answers at once.
      operationId: check_seams_api_v1_check_seams_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SeamCheckRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeamCheckResponse'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: Node.js
          source: >-
            const response = await
            fetch("https://api.sudomock.com/api/v1/check-seams", {
              method: "POST",
              headers: {
                "x-api-key": "sm_your_api_key",
                "Content-Type": "application/json",
              },
              body: JSON.stringify({
                "url": "https://example.com/pattern-tile.png"
              }),
            });


            const data = await response.json();

            console.log(data);
        - lang: PHP
          source: |-
            <?php

            $payload = <<<'JSON'
            {
              "url": "https://example.com/pattern-tile.png"
            }
            JSON;

            $ch = curl_init("https://api.sudomock.com/api/v1/check-seams");
            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                "x-api-key: sm_your_api_key",
                "Content-Type: application/json",
            ]);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);

            $response = curl_exec($ch);
            curl_close($ch);

            echo $response;
        - lang: Python
          source: |-
            import requests

            payload = {'url': 'https://example.com/pattern-tile.png'}

            response = requests.post(
                "https://api.sudomock.com/api/v1/check-seams",
                headers={"x-api-key": "sm_your_api_key"},
                json=payload,
            )

            response.raise_for_status()
            print(response.json())
        - lang: Ruby
          source: >-
            require "net/http"

            require "uri"


            uri = URI("https://api.sudomock.com/api/v1/check-seams")

            request = Net::HTTP::Post.new(uri)

            request["x-api-key"] = "sm_your_api_key"

            request["Content-Type"] = "application/json"


            request.body = <<~JSON
              {
                "url": "https://example.com/pattern-tile.png"
              }
            JSON


            response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do
            |http|
              http.request(request)
            end


            puts response.body
        - lang: Go
          source: "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tpayload := []byte(`{\n  \"url\": \"https://example.com/pattern-tile.png\"\n}`)\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sudomock.com/api/v1/check-seams\", bytes.NewBuffer(payload))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"x-api-key\", \"sm_your_api_key\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tbody, _ := io.ReadAll(res.Body)\n\tfmt.Println(string(body))\n}"
        - lang: Java
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            String payload = """
            {
              "url": "https://example.com/pattern-tile.png"
            }
            """;

            HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create("https://api.sudomock.com/api/v1/check-seams"))
                .header("x-api-key", "sm_your_api_key")
                .header("Content-Type", "application/json")
                .POST(HttpRequest.BodyPublishers.ofString(payload))
                .build();

            HttpResponse<String> response = HttpClient.newHttpClient()
                .send(request, HttpResponse.BodyHandlers.ofString());

            System.out.println(response.body());
        - lang: .NET
          source: >-
            using System.Net.Http;

            using System.Text;


            var payload = """

            {
              "url": "https://example.com/pattern-tile.png"
            }

            """;


            var request = new HttpRequestMessage(HttpMethod.Post,
            "https://api.sudomock.com/api/v1/check-seams");

            request.Headers.Add("x-api-key", "sm_your_api_key");

            request.Content = new StringContent(payload, Encoding.UTF8,
            "application/json");


            var client = new HttpClient();

            var response = await client.SendAsync(request);


            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: cURL
          source: |-
            curl -X POST "https://api.sudomock.com/api/v1/check-seams" \
              -H "x-api-key: sm_your_api_key" \
              -H "Content-Type: application/json" \
              -d '{
                "url": "https://example.com/pattern-tile.png"
              }'
components:
  schemas:
    SeamCheckRequest:
      properties:
        url:
          anyOf:
            - type: string
            - type: 'null'
          description: URL of the tile image (HTTP/HTTPS). Send either url or base64.
        base64:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Raw base64-encoded image bytes (no data: prefix). Send either url or
            base64.
        content_type:
          anyOf:
            - type: string
              pattern: ^image/(png|jpeg|webp|gif)$
            - type: 'null'
          description: >-
            Optional. The file type is detected from the image itself, so this
            field can be left out.
        crop_aspect:
          anyOf:
            - type: number
              exclusiveMinimum: 0
            - type: 'null'
          description: >-
            Optional. Width divided by height of the tile when the render places
            the artwork with fit "crop". The image is cut exactly as that render
            cuts it, then checked. Leave it out to check the whole image.
      additionalProperties: false
      type: object
      title: SeamCheckRequest
      description: >-
        Body for POST /api/v1/check-seams.


        The image source takes the same fields as background removal, and
        exactly

        one of them.
      example:
        url: https://example.com/pattern-tile.png
    SeamCheckResponse:
      properties:
        data:
          $ref: '#/components/schemas/SeamCheckData'
          description: The check result for the tile.
        success:
          type: boolean
          description: Success status
          default: true
      type: object
      required:
        - data
      title: SeamCheckResponse
      description: Whether the tile repeats cleanly, and where it does not.
      example:
        data:
          fixable: true
          height: 2048
          seams:
            - ranges:
                - - 0
                  - 412
                - - 1630
                  - 2048
              side: left_right
              status: visible_seam
          status: visible_seam
          width: 2048
          previous_fix: null
          unfixable_reason: null
        success: true
    SeamCheckData:
      properties:
        status:
          type: string
          enum:
            - seamless
            - faint_seam
            - visible_seam
          description: >-
            seamless: copies of the tile meet with no visible line. faint_seam:
            a faint line may show where copies meet. visible_seam: a line shows
            where copies meet.
        seams:
          items:
            $ref: '#/components/schemas/SeamSide'
          type: array
          description: >-
            The sides where copies meet with a seam. Empty when the tile is
            seamless.
        width:
          type: integer
          description: Width of the checked tile in pixels, after any crop
        height:
          type: integer
          description: Height of the checked tile in pixels, after any crop
        fixable:
          type: boolean
          description: Whether a seam fix can repair this tile.
        unfixable_reason:
          anyOf:
            - type: string
              enum:
                - transparent_edges
                - too_large
            - type: 'null'
          description: >-
            Why a seam fix cannot repair this tile: transparent_edges when its
            edges are not fully opaque, too_large when it is larger than a seam
            fix accepts. Null when fixable.
        previous_fix:
          anyOf:
            - $ref: '#/components/schemas/SeamPreviousFix'
            - type: 'null'
          description: >-
            Your latest completed seam fix of this same tile, or null. Its
            result can be used again at no cost.
      type: object
      required:
        - status
        - seams
        - width
        - height
        - fixable
      title: SeamCheckData
      description: Result payload for POST /api/v1/check-seams.
    SeamSide:
      properties:
        side:
          type: string
          enum:
            - left_right
            - top_bottom
          description: >-
            left_right: where the right edge of one copy meets the left edge of
            the next. top_bottom: where the bottom edge of one copy meets the
            top edge of the next.
        status:
          type: string
          enum:
            - faint_seam
            - visible_seam
          description: How strongly the seam shows on this side.
        ranges:
          items:
            items:
              type: integer
            type: array
          type: array
          description: >-
            Where along this side the seam shows, as pixel ranges [start, end)
            with end excluded: rows for left_right, columns for top_bottom.
      type: object
      required:
        - side
        - status
        - ranges
      title: SeamSide
      description: One side of the tile where copies meet with a seam.
    SeamPreviousFix:
      properties:
        job_id:
          type: string
          description: The seam fix job.
        result_url:
          type: string
          description: URL of the fixed tile.
        alternative_url:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            URL of a second fixed version when one was delivered, otherwise
            null.
      type: object
      required:
        - job_id
        - result_url
      title: SeamPreviousFix
      description: A seam fix you already ran on this same tile.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key with sm_ prefix. Get your key at
        https://sudomock.com/dashboard/api-keys

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.