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

> ## Agent Instructions
> MakeSeamless (makeseamless.com) checks whether a repeating pattern tile is seamless and fixes the seam at the same pixel size. Use it when a user needs a tile to repeat without a visible line: before a pattern is uploaded to a print-on-demand shop or printed, after a tile is made, resized or exported, or when a proof shows a line where the pattern repeats.
> Check first: POST https://makeseamless.com/v1/check with the image as the multipart field file. It is free and needs no account and no key. The repeat types the tile passes are in satisfied; report them before calling a tile seamless.
> Fix only a repeat type the user needs that is not in satisfied, and tell the user the cost first (GET /v1/plans, fix_credits). POST /v1/fix needs an API key in the x-api-key header. Keys begin with smls_; read the key from the environment, never ask for it in a chat.
> POST /v1/fix answers 202 with a job. Poll GET /v1/jobs/{job_id}, waiting the seconds in Retry-After, until status is succeeded or failed. The fixed PNG is at result.image_url. Answers are JSON, except the images, which are PNG.
> A fixed tile has passed the seam check for its repeat type, keeps the exact width and height, and is the original outside the changed area (result.changed_mask_url). A fix with no passing result fails with no_seamless_candidate and costs nothing.
> Branch on error.code, never on error.message, and retry only when error.retryable is true.

# Download the mask of the area a fix visibly changed

> A grayscale PNG with the uploaded image's exact width and height: white (255) where the
result looks different from the upload and black (0) where it looks the same. It lies inside
the changed area. Its white share is `result.visible_changed_share`. A result without
`visible_changed_mask_url` has none and answers 404.


```js Node.js theme={"theme":{"light":"github-light","dark":"vesper"}}
import { writeFile } from "node:fs/promises";

const response = await fetch("https://makeseamless.com/v1/jobs/job_2432c1827f32450f800694e552e9915c/visible_mask", {
  method: "GET",
});

if (!response.ok) throw new Error(await response.text());
await writeFile("visible_mask.png", Buffer.from(await response.arrayBuffer()));
```

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

$ch = curl_init("https://makeseamless.com/v1/jobs/job_2432c1827f32450f800694e552e9915c/visible_mask");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);

if ($status !== 200) {
    exit($response);
}
file_put_contents("visible_mask.png", $response);
```

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

response = requests.get(
    "https://makeseamless.com/v1/jobs/job_2432c1827f32450f800694e552e9915c/visible_mask",
)

response.raise_for_status()
with open("visible_mask.png", "wb") as out:
    out.write(response.content)
```

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

uri = URI("https://makeseamless.com/v1/jobs/job_2432c1827f32450f800694e552e9915c/visible_mask")
request = Net::HTTP::Get.new(uri)

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

raise response.body unless response.is_a?(Net::HTTPSuccess)
File.binwrite("visible_mask.png", response.body)
```

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

import (
	"io"
	"net/http"
	"os"
)

func main() {
	req, err := http.NewRequest("GET", "https://makeseamless.com/v1/jobs/job_2432c1827f32450f800694e552e9915c/visible_mask", nil)
	if err != nil {
		panic(err)
	}

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

	body, _ := io.ReadAll(res.Body)
	if res.StatusCode != http.StatusOK {
		panic(string(body))
	}
	if err := os.WriteFile("visible_mask.png", body, 0o644); err != nil {
		panic(err)
	}
}
```

```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;
import java.nio.file.Files;
import java.nio.file.Path;

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://makeseamless.com/v1/jobs/job_2432c1827f32450f800694e552e9915c/visible_mask"))
    .GET()
    .build();

HttpResponse<byte[]> response = HttpClient.newHttpClient()
    .send(request, HttpResponse.BodyHandlers.ofByteArray());

if (response.statusCode() != 200) {
    throw new RuntimeException(new String(response.body()));
}
Files.write(Path.of("visible_mask.png"), response.body());
```

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

var request = new HttpRequestMessage(HttpMethod.Get, "https://makeseamless.com/v1/jobs/job_2432c1827f32450f800694e552e9915c/visible_mask");

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

response.EnsureSuccessStatusCode();
File.WriteAllBytes("visible_mask.png", await response.Content.ReadAsByteArrayAsync());
```

```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}}
curl -X GET "https://makeseamless.com/v1/jobs/job_2432c1827f32450f800694e552e9915c/visible_mask" \
  -o visible_mask.png
```


## OpenAPI

````yaml openapi.json GET /v1/jobs/{job_id}/visible_mask
openapi: 3.1.0
info:
  title: MakeSeamless API
  version: 1.0.0
  summary: Check whether an image tiles seamlessly, and make it tile seamlessly.
  description: >
    Check a pattern tile for seams where its copies meet, and fix it so that it
    repeats without a

    visible seam.


    - A check is free and needs no account. A fix needs an API key and costs
    credits (`GET /v1/plans`).

    - A fix runs in the background: `POST /v1/fix` answers `202` with a job.
    Poll
      `GET /v1/jobs/{job_id}` until its `status` is `succeeded` or `failed`, waiting the seconds that
      `Retry-After` gives.
    - Every image the API returns has the exact width and height of the uploaded
    image (after its
      orientation is applied), as a fresh lossless PNG that carries no metadata of the upload.
    - Breaking changes come only under a new prefix (`/v2`). Fields may be added
    to responses; ignore
      the fields you do not know.
    - Error codes are stable: read `error.code`, not `error.message`. Any
    request may also fail with
      `500` and the code `internal_error`.
  license:
    name: Proprietary
servers:
  - url: https://makeseamless.com
security: []
tags:
  - name: check
    description: Seam check, answered at once.
  - name: fix
    description: Fix job, run in the background.
  - name: jobs
    description: Job status, result images and ratings.
  - name: health
    description: Service status.
  - name: account
    description: The account, its plan and credits.
paths:
  /v1/jobs/{job_id}/visible_mask:
    get:
      tags:
        - jobs
      summary: The visibly changed area of the fixed image
      description: >
        A grayscale PNG with the uploaded image's exact width and height: white
        (255) where the

        result looks different from the upload and black (0) where it looks the
        same. It lies inside

        the changed area. Its white share is `result.visible_changed_share`. A
        result without

        `visible_changed_mask_url` has none and answers 404.
      operationId: getJobVisibleMask
      parameters:
        - $ref: '#/components/parameters/JobId'
      responses:
        '200':
          description: The visibly changed area.
          content:
            image/png:
              schema:
                type: string
                format: binary
        '404':
          description: >
            `not_found`: no job with this id, its result has no visible mask, or
            the image is no longer

            stored (images are kept for 30 days).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          $ref: '#/components/responses/NoImage'
      security: []
      x-codeSamples:
        - lang: js
          label: Node.js
          source: >-
            import { writeFile } from "node:fs/promises";


            const response = await
            fetch("https://makeseamless.com/v1/jobs/job_2432c1827f32450f800694e552e9915c/visible_mask",
            {
              method: "GET",
            });


            if (!response.ok) throw new Error(await response.text());

            await writeFile("visible_mask.png", Buffer.from(await
            response.arrayBuffer()));
        - lang: php
          label: PHP
          source: >-
            <?php


            $ch =
            curl_init("https://makeseamless.com/v1/jobs/job_2432c1827f32450f800694e552e9915c/visible_mask");

            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");

            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);


            $response = curl_exec($ch);

            $status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);

            curl_close($ch);


            if ($status !== 200) {
                exit($response);
            }

            file_put_contents("visible_mask.png", $response);
        - lang: python
          label: Python
          source: |-
            import requests

            response = requests.get(
                "https://makeseamless.com/v1/jobs/job_2432c1827f32450f800694e552e9915c/visible_mask",
            )

            response.raise_for_status()
            with open("visible_mask.png", "wb") as out:
                out.write(response.content)
        - lang: ruby
          label: Ruby
          source: >-
            require "net/http"

            require "uri"


            uri =
            URI("https://makeseamless.com/v1/jobs/job_2432c1827f32450f800694e552e9915c/visible_mask")

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


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


            raise response.body unless response.is_a?(Net::HTTPSuccess)

            File.binwrite("visible_mask.png", response.body)
        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://makeseamless.com/v1/jobs/job_2432c1827f32450f800694e552e9915c/visible_mask\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\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\tif res.StatusCode != http.StatusOK {\n\t\tpanic(string(body))\n\t}\n\tif err := os.WriteFile(\"visible_mask.png\", body, 0o644); err != nil {\n\t\tpanic(err)\n\t}\n}"
        - lang: java
          label: Java
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;
            import java.nio.file.Files;
            import java.nio.file.Path;

            HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create("https://makeseamless.com/v1/jobs/job_2432c1827f32450f800694e552e9915c/visible_mask"))
                .GET()
                .build();

            HttpResponse<byte[]> response = HttpClient.newHttpClient()
                .send(request, HttpResponse.BodyHandlers.ofByteArray());

            if (response.statusCode() != 200) {
                throw new RuntimeException(new String(response.body()));
            }
            Files.write(Path.of("visible_mask.png"), response.body());
        - lang: csharp
          label: .NET
          source: >-
            using System.Net.Http;


            var request = new HttpRequestMessage(HttpMethod.Get,
            "https://makeseamless.com/v1/jobs/job_2432c1827f32450f800694e552e9915c/visible_mask");


            var client = new HttpClient();

            var response = await client.SendAsync(request);


            response.EnsureSuccessStatusCode();

            File.WriteAllBytes("visible_mask.png", await
            response.Content.ReadAsByteArrayAsync());
        - lang: bash
          label: cURL
          source: >-
            curl -X GET
            "https://makeseamless.com/v1/jobs/job_2432c1827f32450f800694e552e9915c/visible_mask"
            \
              -o visible_mask.png
components:
  parameters:
    JobId:
      name: job_id
      in: path
      required: true
      description: The job's `id`, from `POST /v1/fix`.
      schema:
        type: string
        pattern: ^job_[0-9a-f]{32}$
  schemas:
    Error:
      type: object
      additionalProperties: false
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
    ErrorBody:
      type: object
      additionalProperties: false
      required:
        - code
        - message
        - retryable
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: Plain-language explanation; it may change, do not parse it.
        retryable:
          type: boolean
          description: >-
            True when the same request can succeed later (a new fix, or polling
            again).
        details:
          type: object
          description: 'Optional machine-readable context, for example `{"max_side": 3600}`.'
    ErrorCode:
      type: string
      enum:
        - validation_error
        - payload_too_large
        - unsupported_format
        - decode_failed
        - too_small
        - too_large
        - odd_dimension
        - transparent_seam_band
        - not_found
        - result_not_ready
        - no_result
        - no_seamless_candidate
        - service_unavailable
        - interrupted
        - internal_error
        - auth_required
        - insufficient_credits
        - daily_capacity_reached
        - too_many_running_fixes
        - rate_limited
        - already_subscribed
        - pro_required
        - no_subscription
        - rating_closed
      description: >
        Stable codes. Of a failed job: `no_seamless_candidate` (no version of
        the image tiled

        seamlessly), `service_unavailable` (the fix could not run for now; try
        again later),

        `interrupted` (the service stopped while the job ran; start the fix
        again) and

        `internal_error`.
  responses:
    NoImage:
      description: >
        No image yet or at all: `result_not_ready` while the job is `queued` or
        `running` (poll the job

        again after `Retry-After`), `no_result` when it failed.
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  headers:
    RetryAfter:
      description: Seconds to wait before polling again.
      schema:
        type: integer
        minimum: 1

````

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