From a file to a cut sticker,
in one call.

This walkthrough builds the chain a print shop actually buys: background removal, a cut line in millimetres, and DXF export — one submit, one quote, one charge.

  1. Create a key

    An sk_test_ key is free, capped at 1 megapixel, and never charged. An sk_live_ key spends credits. Both are created in the dashboard.

    # Keep it in an environment variable, never in the source.
    export VECTORFY_KEY=sk_test_…
  2. Send the chain

    Every step is resolved through the engine registry, not just the first — and the estimate, the cap and the charge all come from the whole chain.

    curl -X POST http://localhost:8080/v1/pipeline \
      -H "Authorization: Bearer $VECTORFY_KEY" \
      -H "Idempotency-Key: $(uuidgen)" \
      -F file=@artwork.png \
      -F 'steps=[{"operation":"cutout","params":{"feather_px":0}},
                  {"operation":"cutline","params":{"output":"svg","bleed_mm":2}},
                  {"operation":"export","params":{"output":"dxf"}}]'
    Idempotency-Key is not optional. A network that drops after the server accepted the request is exactly how a customer pays twice; with this key the retry returns the same job instead of running it again.
  3. Get a 202, not a result

    The reply comes back immediately with an id and a quote. Real work outlives most clients' default timeout, which is why it is not returned inside the request.

    {
      "id": "job_29ab70d8e6d0f14f",
      "status": "queued",
      "estimated_credits": 4.25,
      "credits_charged": 0
    }
  4. Poll until it finishes

    Or register a webhook and get the same body pushed to you, HMAC-signed. A failed job is never charged and its hold is released in full.

    curl http://localhost:8080/v1/jobs/job_29ab70d8e6d0f14f \
      -H "Authorization: Bearer $VECTORFY_KEY"
    
    # A chain reports PER STEP. Copied from a real run of the call above.
    { "status": "succeeded",
      "credits_charged": 4.25,
      "duration_ms": 436,
      "result": { "url": "https://…/out.dxf" },
      "diagnostics": { "steps": [
        { "step": 1, "operation": "cutout", "engine": "grabcut",
          "diagnostics": { "confidence": 1.0, "subject_fraction": 0.609 } },
        { "step": 2, "operation": "cutline",
          "diagnostics": { "cut_mm": [78.77, 78.75], "cut_paths": 1,
                           "bleed_mm": 2.0, "dpi_source": "chain" } },
        { "step": 3, "operation": "export",
          "diagnostics": { "layer": "CutContour", "cut_mm": [78.74, 78.74] } } ] } }
    diagnostics are not decoration. cut_mm is the size the plotter will actually cut, in millimetres — measure it against the drawing before a production run.

When something fails

Every error is RFC 9457 with a stable code, an explanation, and a retryable field that says whether trying again is worth it. Each code has its own page.

{ "type": "https://…/errors/output_exceeds_plan_cap",
  "code": "output_exceeds_plan_cap",
  "status": 400,
  "retryable": false,
  "detail": "61.4 MP exceeds the 32 MP cap…" }

From here