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
| Item | Value |
|---|---|
| Base URL | https://genpbr.com/api/v1 |
| Format | JSON request and JSON response, UTF-8 |
| Authentication | Header X-API-Key, or Authorization: Bearer |
| Body limit | 4 MB on generate-texture. Larger bodies return 413 |
| Image output | PNG data URLs, one per requested map type |
| CORS | Enabled 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.
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"]
}'{
"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
/api/v1/generate-textureGenerate 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_hereNotes
- 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"
}
}
}
}
}Invalid or missing API key. Check that your X-API-Key header is correct.
Invalid request body or missing required fields (baseImage, textureTypes).
Too many requests. Wait before retrying. Rate limits reset every minute.
Monthly request limit reached. Upgrade your plan or wait for the next billing cycle.
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'])/api/v1/generate-from-urlGenerate PBR textures from an image URL instead of base64. Reduces payload size and simplifies integration.
/api/v1/usage-statsGet real-time quota, usage history, and rate limit status programmatically.
/api/v1/health-checkCheck API health status, queue status, and estimated wait times. No authentication required.
/api/v1/jobs/{id}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.
/api/v1/batch-generate-texturesProcess multiple images in one request. Returns job ID for async processing. Perfect for bulk operations.
/api/v1/generate-texture-asyncGenerate textures asynchronously with webhook support. Perfect for large files and long-running jobs.
/api/v1/upscale-textureUpscale generated textures 2x or 4x using high-quality bicubic interpolation.