> ## 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.

# MakeSeamless API reference: base URL, keys and answers

> The base URL, the x-api-key header, the status codes, how a fix runs as a job you poll, the images you get back and how the /v1 API is versioned.

## What is the base URL of the API?

Every request goes to one host, and every path starts with `/v1`.

```text theme={"theme":{"light":"github-light","dark":"vesper"}}
https://makeseamless.com/v1
```

Answers are JSON, except the images, which are PNG. The whole contract is one
OpenAPI 3.1 file at
[makeseamless.com/docs/openapi.json](https://makeseamless.com/docs/openapi.json).

## How do I authenticate a request?

A call that spends credits or reads your account carries an API key in the
`x-api-key` header. Keys begin with `smls_`. The check, a job and its images,
the plans and the service status need no key.

```js Node.js theme={"theme":{"light":"github-light","dark":"vesper"}}
const response = await fetch("https://makeseamless.com/v1/me", {
  method: "GET",
  headers: { "x-api-key": "smls_your_api_key" },
});

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

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

$ch = curl_init("https://makeseamless.com/v1/me");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "x-api-key: smls_your_api_key",
]);

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

echo $response;
```

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

response = requests.get(
    "https://makeseamless.com/v1/me",
    headers={"x-api-key": "smls_your_api_key"},
)

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

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

uri = URI("https://makeseamless.com/v1/me")
request = Net::HTTP::Get.new(uri)
request["x-api-key"] = "smls_your_api_key"

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 (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, err := http.NewRequest("GET", "https://makeseamless.com/v1/me", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("x-api-key", "smls_your_api_key")

	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;

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://makeseamless.com/v1/me"))
    .header("x-api-key", "smls_your_api_key")
    .GET()
    .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;

var request = new HttpRequestMessage(HttpMethod.Get, "https://makeseamless.com/v1/me");
request.Headers.Add("x-api-key", "smls_your_api_key");

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 GET "https://makeseamless.com/v1/me" \
  -H "x-api-key: smls_your_api_key"
```

[Authentication](https://makeseamless.com/docs/authentication.md) covers where to create a key and how to
keep it.

## What does each status code mean?

| Status | Meaning |
| - | - |
| `200` | The request succeeded. |
| `201` | The rating was stored. |
| `202` | The fix was accepted and runs in the background. Poll the job. |
| `401` | The key is missing, revoked or unknown. |
| `402` | Not enough credits for the fix. |
| `404` | No such job or image, or the image is no longer stored. |
| `409` | The job has no image yet, or none at all, or its rating window closed. |
| `413` | The file is larger than 40 MB. |
| `422` | The request or the image cannot be used. |
| `429` | A limit was reached. Read `Retry-After`. |
| `500` | Our side. |

Every error carries `error.code`, `error.message` and `error.retryable`.
[Errors](https://makeseamless.com/docs/errors.md) holds every code and a retry loop you can copy.

## How do I get the result of a fix?

`POST /v1/fix` answers `202` with a job at once. Poll
`GET /v1/jobs/{job_id}`, waiting the seconds in `Retry-After` between two
calls, until `status` is `succeeded` or `failed`. A succeeded job has the
fixed image at `result.image_url`. There is no callback: polling is the way
to learn a job is done.

## What size and format are the images?

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
none of the upload's metadata. Images are kept for 30 days.

## Which limits apply to requests?

Checks are limited per client, fixes per account, and the service has a
daily capacity for fixes. Each limit answers `429` with `Retry-After`.
[Rate and spend limits](https://makeseamless.com/docs/api-reference/limits.md) has the numbers.

## Will the API change under my code?

The version is in the path, and `v1` is current. A breaking change comes only
under a new prefix, such as `/v2`. Fields may be added to answers within
`v1`, so ignore the fields you do not know.

## Frequently asked questions

> [accordion] Does a failed fix cost credits?
>
> No, when it fails with `no_seamless_candidate`, `service_unavailable` or
> `interrupted`: the credits held at the start come back.

> [accordion] Can I fix the same file twice?
>
> Yes, and the second time is free. The same file with the same repeat type
> returns the stored result, marked `cached`.

> [accordion] Who can read a job?
>
> Anyone with its id, without a key. Keep job ids to yourself.


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