Output Formats and Download URLs

Render posters as PNG, JPEG or WebP and consume the resulting download URLs.

A completed render returns a download_url that points to a public storage object (an asynchronous submission returns a 202 job first — see Asynchronous rendering). The format and size are controlled by the request's output object, and a dry run reports the resolved output dimensions without rendering.

Supported formats

| Format | Use case | Notes | | ------ | -------- | ----- | | png (default) | Print, archival | Lossless, largest filesize | | jpeg | Web, smaller files | Lossy | | webp | Web embedding | Smallest typical filesize |

SVG and PDF are not supported: output.format only accepts png, jpeg and webp, and any other value is rejected with a 400 that lists the supported formats.

Selecting a format and size

const poster = await client.posters.generate({
  location: { lat: 41.9028, lng: 12.4964 },
  style: 'ivory-ink-paper-v2',
  output: {
    format: 'jpeg',
    width: 1600,
    height: 2400,
    pixelRatio: 1,
  },
});
  • output.width / output.height are the base canvas size in pixels (256-8000). When omitted the size follows the poster's aspect ratio.
  • output.pixelRatio (1-5) multiplies both dimensions, preserves the aspect ratio and clamps the longest edge to 8000 px. It wins over the legacy options.high_res flag (which is the same as pixelRatio: 2).
  • metadata.dimensions in the response reports the final raster size.

Composition modes (map-only and transparent backgrounds)

output.mode defaults to "poster": the editorial frame with a text block, border, compass, texture, centered marker and an attribution band.

output.mode: "map-only" renders just the map on the full canvas: the text overlay, border/compass, texture, centered marker and attribution band are skipped and the margin defaults to 0. Map content — roads, terrain, custom markers and track routes — is still drawn. Attribution moves to metadata.attribution (and the X-Attribution image header), so you are responsible for displaying it (OpenFreeMap/OpenStreetMap both require visible attribution on rendered maps).

output.transparent: true skips the background fill and keeps PNG alpha. It requires mode: "map-only" (400 transparent_requires_map_only otherwise) and format: "png" (400 transparent_requires_png, with supported: ["png"]). mode: "map-only" cannot be combined with options.star_chart_base (400 map_only_incompatible). The response reports the result in metadata.mode, metadata.background (or "transparent"), metadata.margin_px and metadata.attribution; the image response carries the same values in the X-Poster-Mode, X-Background, X-Margin-Px and X-Attribution headers.

const map = await client.posters.generate({
  location: { lat: 46.5197, lng: 6.6323 },
  output: { mode: 'map-only', transparent: true, format: 'png' },
});

Saved maps persist the choice as config.format.outputMode / config.format.transparentBackground, and an explicit config.format.margin still wins over the map-only default.

Render-time limits

Renders are synchronous by default and must finish inside the function limit (120 s, with a request deadline 8 s inside that). The API rejects combinations that cannot finish with 422 render_too_large before rendering starts — the body names the largest size that fits (max_dimensions) and the allowed pixel ratio (max_pixel_ratio). A render that still overruns returns a JSON 504 render_timeout with retryable: true. Safe measured limits:

| Content | Safe final raster | | ------- | ----------------- | | Flat street maps | up to 2400x3600 px at pixelRatio 1 | | Terrain / color hillshading | long edge ≤ 1500 px at pixelRatio 1 | | Volumetric terrain or 3D buildings | long edge ≤ 1200 px at pixelRatio 1, one at a time |

The 422 render_too_large gate is part of the API contract, not a quirk of the synchronous path: asynchronous and dry runs apply the same measured limits.

Asynchronous rendering

Send "async": true on POST /posters/generate to return before the render finishes:

// SDK: submit + poll in one call (`wait: true` implies `async: true`).
const job = await client.posters.generate(
  {
    location: { lat: 46.5197, lng: 6.6323 },
    style: 'obsidian-gold-standard-v2',
    options: { terrain: true, volumetric_terrain: true },
  },
  { wait: true, idempotencyKey: 'lausanne-3d-01', timeoutMs: 15 * 60_000 },
);

if (job.status === 'completed' && job.download_url) {
  console.log(`Poster ready: ${job.download_url}`);
}

The first response is 202 Accepted with { id, status: "queued", created_at, expires_at, poll_url, estimated_seconds } (poll_url is absolute). Location carries the same URL, Retry-After suggests the first poll delay, X-Poster-ID repeats the id and the response is Cache-Control: private, no-store. estimated_seconds is a provisional estimate clamped to 15-240 s, not a deadline.

Poll GET /posters/{id} (with the same API key) until the job is terminal:

| Status | Meaning | | ------ | ------- | | queued | Accepted, not started. | | rendering | A worker is rendering it. | | completed | download_url and metadata are populated. | | failed | error is { code, message, retryable, request_id } with render_timeout, render_failed, storage_failed, queue_timeout or job_expired. | | expired | Past the 30-day job retention mark; the stored object may still resolve. |

While the job is queued/rendering, download_url and metadata are null, poll_after_seconds suggests the next interval (3) and the poll response carries a matching Retry-After header. Every read of an existing job is 200, including failed and expired: the failure is data on the job, not a transport error. The read is scoped to the calling API key — another key, an unknown id or a malformed id all receive 404.

What async changes in this phase: the synchronous request deadline no longer applies (the render runs after the 202 and is retried once on a retryable failure), and a render that overruns ends as failed with render_timeout instead of failing the caller's request — with the quota unit charged at enqueue refunded for system failures. It does not bypass the function ceiling or the size gate: combinations that cannot finish are still rejected up front with 422 render_too_large, so estimated_seconds should be treated as a hint.

Submission rules:

  • Idempotency-Key (header, 1-255 characters) makes retries safe: repeating the same key returns the original job with the job's current status (queued/rendering/completed/failed/expired) and Idempotent-Replay: true, without rendering or charging again. A malformed header is a 400 before the body is parsed.
  • Each API key may have 2 jobs in progress on the free tier and 8 on Carto Plus. A further submission returns 429 with code: "concurrency_limit", limit, active, retry_after_seconds and a Retry-After header.
  • webhook_url (https only, maximum 2048 characters) is accepted and stored but callbacks are not delivered yet (HMAC signing is a later phase) — poll in the meantime.
  • GET /posters/{id} has its own rate-limit budget (120 requests per minute per key), separate from the 10/minute generate budget (see Rate Limits and Errors).

Dry runs

Send "dry_run": true on POST /posters/generate (or call client.posters.estimate() in the SDK) to resolve and price a request without rendering it. dry_run takes precedence over async.

The response is a 200 with a different shape from a real render:

{
  "dry_run": true,
  "request_id": "req_abc123",
  "resolved": {
    "config": { /* final Editor config, MapLibre style AST stripped to { id, name } */ },
    "style": { "id": "minimal", "name": "Minimal" },
    "palette": { "id": "ivory-ink-paper-v2", "name": "Ivory Ink" },
    "output": { "format": "png", "width": 2400, "height": 3600, "pixelRatio": 1, "dimensions": "2400x3600" },
    "view": { "center": [11.2, 64.5], "zoom": 4.6, "source": "bounds" },
    "text": { "title": "Lofoten", "subtitle": "Nordland, Norway", "source": "request" }
  },
  "cost": {
    "score": 9.54,
    "band": "high",
    "megapixels": 8.64,
    "weights": { "base": 1, "terrain": 0.3 },
    "predicted_render_ms": 33600,
    "predicted_seconds": 34,
    "model_version": "v1",
    "exceeds_render_limit": false,
    "max_dimensions": null,
    "max_long_edge_px": 3600,
    "quota": { "allowed": true, "used": 3, "limit": 10, "tier": "free", "charged": false }
  },
  "warnings": ["render_may_be_slow"]
}
  • resolved is exactly what a real render would use, at real final dimensions.
  • cost is a deterministic model: score is megapixels × layer weight, band is low/medium/high/over_limit, and model_version pins the calibration. predicted_render_ms/predicted_seconds are estimates, not deadlines. exceeds_render_limit (with max_dimensions) means a real render would be rejected with 422 render_too_large.
  • cost.quota is a read-only peek: charged is always false — a dry run never consumes a daily-quota unit. It still uses one slot of the per-minute rate limit, and it always returns JSON (Accept: image/* is ignored).
  • warnings is a list of stable codes, e.g. render_exceeds_sync_limit (a real render would 422) or render_may_be_slow (high cost band).

Use it to validate a design, surface the resolved title/subtitle or framing, and show a size/time estimate before spending a render.

Asset lifetime

download_url points at a permanent, public object: it does not expire, and there is no API to delete it. Treat any URL you publish as public forever. Asynchronous jobs carry a 30-day retention mark (expires_at) after which the job reads status: "expired" and download_url: null — that is a metadata guarantee, not object deletion, so an expired URL may still resolve. A retention policy that removes the stored object is planned; persist important assets to your own storage if you need guarantees.