API reference

Endpoint reference

Every endpoint, parameter and response field. Paste your key once to fill it into the examples and the endpoint details below.

Base URL and format

Base URL, format and body limits
ItemValue
Base URLhttps://genpbr.com/api/v1
FormatJSON request and JSON response, UTF-8
AuthenticationHeader X-API-Key, or Authorization: Bearer
Body limit4 MB on generate-texture. Larger bodies return 413
Image outputPNG data URLs, one per requested map type
CORSEnabled for v1 routes

A request and its response

A POST with one base image and the map types you want. Each map comes back in the same JSON response.

Request
curl -X POST https://genpbr.com/api/v1/generate-texture \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $GENPBR_API_KEY" \
  -d '{
    "baseImage": "<base64 PNG>",
    "textureTypes": ["normal", "roughness", "metallic", "ao", "height"]
  }'
Response, trimmed
{
  "success": true,
  "textures": {
    "normal": "data:image/png;base64,iVBORw0KGgo...",
    "roughness": "data:image/png;base64,iVBORw0KGgo...",
    "metallic": "data:image/png;base64,iVBORw0KGgo...",
    "ao": "data:image/png;base64,iVBORw0KGgo...",
    "height": "data:image/png;base64,iVBORw0KGgo..."
  },
  "metadata": { "width": 1024, "height": 1024, "processingTime": 1250, "...": "..." },
  "usage": { "remainingQuota": 24, "monthlyQuota": 25, "rateLimit": 5 }
}

Code examples

Every example reads the key from GENPBR_API_KEY, so the same snippet runs on a laptop, in CI, or in an agent sandbox.

curl -X POST https://genpbr.com/api/v1/generate-texture \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $GENPBR_API_KEY" \
  -d '{
    "baseImage": "<base64 PNG>",
    "textureTypes": ["normal", "roughness", "metallic", "ao", "height"]
  }'

All endpoints

Search by name, path or tag. Each card lists the parameters, a request example, and every response code.

Stays in this browser tab only. Never ship a real key in client-side code.

Showing 8 of 8 endpoints

POST
/api/v1/generate-texture
core
texture-generation
Generate Texture

Generate PBR textures (normal, metallic, roughness, AO, height) from a base image.

Authentication

Include your API key in the X-API-Key header or Authorization header (Bearer token).

X-API-Key: your_api_key_here

Notes

  • Base images should be in PNG or JPG format, base64-encoded or provided as a URL
  • You can request one or more texture types in a single API call
  • All texture types are returned as base64-encoded PNG images
  • Monitor your usage with the usage object in the response
  • Rate limits reset every minute, monthly quotas reset on the 1st of each month
  • Free regenerations (same base image + same texture types) don't count against quota

Base64-encoded image data and texture types to generate.

Request Body Schema

{
  "type": "object",
  "required": [
    "baseImage",
    "textureTypes"
  ],
  "properties": {
    "baseImage": {
      "type": "string",
      "description": "Base64-encoded image data (with or without data URL prefix)"
    },
    "textureTypes": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "normal",
          "metallic",
          "roughness",
          "ao",
          "height"
        ]
      },
      "description": "Array of texture types to generate"
    },
    "options": {
      "type": "object",
      "properties": {
        "normalStrength": {
          "type": "number",
          "minimum": 0.1,
          "maximum": 5,
          "default": 5
        },
        "metallicIntensity": {
          "type": "number",
          "minimum": 0.1,
          "maximum": 5,
          "default": 0.8
        },
        "roughnessIntensity": {
          "type": "number",
          "minimum": 0.1,
          "maximum": 5,
          "default": 2
        },
        "aoIntensity": {
          "type": "number",
          "minimum": 0.1,
          "maximum": 5,
          "default": 2
        },
        "aoRadius": {
          "type": "number",
          "minimum": 1,
          "maximum": 10,
          "default": 12
        },
        "heightContrast": {
          "type": "number",
          "minimum": 0.1,
          "maximum": 3,
          "default": 1
        },
        "heightBrightness": {
          "type": "number",
          "minimum": -0.5,
          "maximum": 0.5,
          "default": 0
        },
        "heightInvert": {
          "type": "boolean",
          "default": false
        }
      }
    }
  }
}

Request Body Example

{
  "baseImage": "data:image/png;base64,iVBORw0KG...",
  "textureTypes": [
    "normal",
    "metallic",
    "roughness",
    "ao",
    "height"
  ],
  "options": {
    "normalStrength": 5,
    "metallicIntensity": 0.8,
    "roughnessIntensity": 2,
    "aoIntensity": 2,
    "aoRadius": 12
  }
}

Success Response (200)

Textures generated successfully

{
  "success": true,
  "textures": {
    "normal": "data:image/png;base64,...",
    "metallic": "data:image/png;base64,...",
    "roughness": "data:image/png;base64,...",
    "ao": "data:image/png;base64,..."
  },
  "metadata": {
    "width": 1024,
    "height": 1024,
    "generatedAt": "2025-01-15T12:00:00Z",
    "processingTime": 1250,
    "textureTypes": [
      "normal",
      "metallic",
      "roughness",
      "ao",
      "height"
    ],
    "isFreeRegeneration": false
  },
  "usage": {
    "remainingQuota": 95,
    "tier": "pro",
    "monthlyQuota": 2000,
    "rateLimit": 50,
    "isFreeRegeneration": false
  }
}

Response Schema

{
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean"
    },
    "textures": {
      "type": "object",
      "properties": {
        "normal": {
          "type": "string"
        },
        "metallic": {
          "type": "string"
        },
        "roughness": {
          "type": "string"
        },
        "ao": {
          "type": "string"
        }
      }
    },
    "metadata": {
      "type": "object",
      "properties": {
        "width": {
          "type": "number"
        },
        "height": {
          "type": "number"
        },
        "generatedAt": {
          "type": "string"
        },
        "processingTime": {
          "type": "number"
        },
        "textureTypes": {
          "type": "array"
        },
        "isFreeRegeneration": {
          "type": "boolean"
        }
      }
    },
    "usage": {
      "type": "object",
      "properties": {
        "remainingQuota": {
          "type": "number"
        },
        "tier": {
          "type": "string"
        },
        "monthlyQuota": {
          "type": "number"
        },
        "rateLimit": {
          "type": "number"
        },
        "isFreeRegeneration": {
          "type": "boolean"
        }
      }
    }
  }
}
401
Unauthorized

Invalid or missing API key. Check that your X-API-Key header is correct.

400
Bad Request

Invalid request body or missing required fields (baseImage, textureTypes).

429
Rate Limit Exceeded

Too many requests. Wait before retrying. Rate limits reset every minute.

402
Quota Exceeded

Monthly request limit reached. Upgrade your plan or wait for the next billing cycle.

500
Internal Server Error

An error occurred during texture generation. Please try again.

cURL

curl -X POST https://genpbr.com/api/v1/generate-texture \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "baseImage": "data:image/png;base64,...",
    "textureTypes": ["normal", "metallic", "roughness", "ao"],
    "options": {
      "normalStrength": 5.0,
      "metallicIntensity": 0.8,
      "roughnessIntensity": 2.0,
      "aoIntensity": 2.0,
      "aoRadius": 12.0
    }
  }'

JavaScript (Fetch)

const response = await fetch('https://genpbr.com/api/v1/generate-texture', {
  method: 'POST',
  headers: {
    'X-API-Key': 'your_api_key_here',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    baseImage: 'data:image/png;base64,...',
    textureTypes: ['normal', 'metallic', 'roughness', 'ao', 'height'],
    options: {
      normalStrength: 5.0,
      metallicIntensity: 0.8,
      roughnessIntensity: 2.0,
      aoIntensity: 2.0,
      aoRadius: 12.0,
    },
  }),
});

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

Python (Requests)

import requests

response = requests.post(
    'https://genpbr.com/api/v1/generate-texture',
    headers={
        'X-API-Key': 'your_api_key_here',
        'Content-Type': 'application/json',
    },
    json={
        'baseImage': 'data:image/png;base64,...',
        'textureTypes': ['normal', 'metallic', 'roughness', 'ao', 'height'],
        'options': {
            'normalStrength': 5.0,
            'metallicIntensity': 0.8,
            'roughnessIntensity': 2.0,
            'aoIntensity': 2.0,
            'aoRadius': 12.0,
        },
    },
)

data = response.json()
print(data['textures'])
POST
/api/v1/generate-from-url
core
texture-generation
Generate from URL

Generate PBR textures from an image URL instead of base64. Reduces payload size and simplifies integration.

GET
/api/v1/usage-stats
monitoring
analytics
Usage Statistics

Get real-time quota, usage history, and rate limit status programmatically.

GET
/api/v1/health-check
monitoring
public
Health Check

Check API health status, queue status, and estimated wait times. No authentication required.

GET
/api/v1/jobs/{id}
core
jobs
Get Job Status

Status, progress, result, and error for any async or batch generation job. One documented way to poll: generate-texture-async and batch-generate-textures both return a jobId that works here.

Plan-gated endpoints

Available on Starter, Pro, and Lifetime Founder plans.

POST
/api/v1/batch-generate-textures
Premium
premium
batch
async
Batch Generate Textures

Process multiple images in one request. Returns job ID for async processing. Perfect for bulk operations.

POST
/api/v1/generate-texture-async
Premium
premium
async
webhooks
Async Generate with Webhooks

Generate textures asynchronously with webhook support. Perfect for large files and long-running jobs.

POST
/api/v1/upscale-texture
Premium
premium
image-processing
Upscale Texture

Upscale generated textures 2x or 4x using high-quality bicubic interpolation.